¿Cómo encontrar un lugar al hacer compras reglas carrito de precios aplicado?

magento.stackexchange https://magento.stackexchange.com/questions/1148

  •  16-10-2019
  •  | 
  •  

Pregunta

Estoy buscando lugar en código donde se aplican las reglas de compras carrito de precios. Permite decir, he creado una regla y cuando agrego algún producto a la cesta de la cual coincide con esta regla, se aplicará esta regla y puedo cambiar un precio. Estoy tratando de explorar SalesRules módulo, pero sin éxito. Tal vez alguien me puede dar una dirección correcta?

¿Fue útil?

Solución

The starting point for all salesrules are in the Observer:

\Mage_SalesRule_Model_Observer::sales_quote_address_discount_item()

There \Mage_SalesRule_Model_Validator::process() is called, where it is checked whether the rule should be applied:

if (!$this->_canProcessRule($rule, $address)) {
    continue;
}

if (!$rule->getActions()->validate($item)) {
    continue;
}

and afterwards the discounts are applied.

I hope this helps you on your way into the salesrules.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top