Magento Cart Rule BUG - Wrongly applied when "less than" and configurable product -


i found out magento seems have bug since 1.8 relating cart rules.

let's have configurable products , want add "discount" specific product if qty less 50. in case surcharge not discount (you can add negative discount it'll surcharge changing 2 files see http://php.quicoto.com/extra-fee-shopping-cart-price-rules-magento/).

so magento do?

1) checks if rule valid product 2) if not checks if configurable product, takes first simple product, , check rule against that.

in case true cause qty less 50 ( cause simple product not in cart.... )

extending rule "less 50 , more 1" didn't worked.

    $product = $object->getproduct();     if (!($product instanceof mage_catalog_model_product)) {         $product = mage::getmodel('catalog/product')->load($object->getproductid());     }      // here, everythign correct. $valid false cause item less x times in cart..     $valid = parent::validate($object);      // part makes no sense, cause he's checking on child not in cart.      /** /      if (!$valid && $product->gettypeid() == mage_catalog_model_product_type_configurable::type_code) {         $children = $object->getchildren();         $valid = $children && $this->validate($children[0]);     }/**/ 

this small snippet related it, , in eyes doesn't make sense. why rule should checked against first product of configurable one? why randomly check rule against other product?

does has idea that?

my solution now, comment line out ... ;-) , rule applied should.

greets felix

here's image rule in magento backend

looks $object instance of mage_sales_quote_item. if so, explains why rule being checked against first child - because the only child of configurable product in cart. can't more 1 child of particular configurable product item in cart @ same time


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -