3

Currently, I am using the following code in addtocart.phtml to retrieve tier price data:

$allTiers     = $_product->getTierPrice();
$checktiers   = array_values($allTiers);
$tierPrices   = json_encode($checktiers);

This only works for simple products and not configurable products that contain simple products. The output on the configurable products always return empty array.

How can I retrieve tier price data from a configurable product that contains multiple simple products?

Any help?

Thanks in advance...!!!

2
  • Hey, did you solve this? Commented Aug 20, 2020 at 19:44
  • @simonthesorcerer : For my requirement, I have to override this file vendor/magento/module-swatches/view/frontend/web/js/swatch-renderer.js in my theme. Commented Aug 21, 2020 at 10:06

0

Your Answer

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