yireo/Yireo_GoogleTagManager2

Price in add_to_cart event datails always the cheapest simple variant

Closed this issue · 2 comments

When adding a configurable product to the cart (add_to_cart), the event data contains the price of the cheapest simple product linked to the configurable product, not the price of simple product that was added.

This can be fixed by changing the following line

(float)$product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()

(float)$product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()
to:
(float)$product->getFinalPrice()

Thanks. This is now committed here, ready for the next release: 7391e47

The code was like that a while back and the issue I had, it was returning the wrong price (currency) for multi-store setup. See: 523cd14

So, it needs further investigation.