cancel
Showing results for 
Search instead for 
Did you mean: 

in which file can control total price on magento2

in which file can control total price on magento2

 

we want to do a dev like the following image:

1.jpg

if the product is 1th-100th , each price of the product is 190€

if the product is 101th-150th , each price of the product is 250€

if the product is 151th-175th , each price of the product is 500€

if the product is 176th-200th , each price of the product is 1000€

 

the max-stock is: 200 , and if customer want to buy 120 products

the current total price should be:  20*190 + 50*250 + 25*500 + 25*1000 = 53800

and the unit price should be: 53800/120 = 448.3333333 ≈ 448.33

 

after doing the dev on Quote\Model\Quote\Address\Total\Subtotal.php  protected function _initItem($address, $item)

the unit price is ok , but the total price still not ok , it becomes to 448.33*120=53799.60 , right algorithm should be :

20*190 + 50*250 + 25*500 + 25*1000 = 53800

 

2.jpg

 

but i can't find the file which to change this functionality , is any one can help me?

thank you for your reply.