2

We have customized bundles to add mandatory custom options to the bundle items. Problem is, if you edit a bundle from cart the changed custom options on bundle-item level is not recognized by the standard compare function, as this function currently does not know about this customization.

Procedure:

  1. Select bundle and make the selections.
  2. Add bundle to cart.
  3. In cart press edit in bundle line.
  4. Magento opens the configure id and you can change the bundle.
  5. Change a custom option on bundle-item level.
  6. Press "update cart".
  7. If just a custom option was changed, Magento does not recognize the change.

Questions:

Which function/source compares current bundle with bundle in cart if something was changed and a update of the existing bundle in cart is necessary.

1
  • Can somebody please help ... what function in magento compares the content of the shopping cart with the updated bundle or simple sku with options ... and deceides an update is needed?
    – Kozure
    Commented May 12, 2016 at 12:32

1 Answer 1

1

Take a look at Mage_Sales_Model_Quote_Item::representProduct($product).

It compares a quote item with a configured product (i.e. custom options, bundle options etc. are set) that would be added to the cart and returns true if it is considered the same item. In that case, Mage_Sales_Quote::updateItem() only updates the qty.

Note that you should not change anything in this method, just understand how it works. As soon as your own "custom options" are really saved as custom options (as Magento knows them) in the quote item, it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.