Answer the question
In order to leave comments, you need to log in
How to transfer an array with tier prices with tax to JSON?
An array of tier prices can be obtained in Magento 2 in several ways.
For example, something like this:
$allTiers = $_product->getTierPrice();
$checktiers = array_filter($allTiers);
$tierPriceArray[] = array('qty'=> $price['price_qty'], 'price'=> $price['website_price]?>
[{"price_id":"30","website_id":"0","all_groups":"1","cust_group":32000,"price":"45.490000","price_qty":"5.0000","percentage_value":null,"website_price":"45.490000"},{"price_id":"31","website_id":"0","all_groups":"1","cust_group":32000,"price":"39.990000","price_qty":"15.0000","percentage_value":null,"website_price":"39.990000"},{"price_id":"32","website_id":"0","all_groups":"1","cust_group":32000,"price":"35.000000","price_qty":"30.0000","percentage_value":null,"website_price":"35.000000"},{"price_id":"33","website_id":"0","all_groups":"1","cust_group":32000,"price":"33.120000","price_qty":"33.0000","percentage_value":null,"website_price":"33.120000"}]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question