- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to add custom charges (fee) to item row total into cart for magento 2?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to add custom charges (fee) to item row total into cart for magento 2?
You can implement it as a custom checkout.cart.totals handler: https://mage2.pro/t/1070
Or you can just set it up as a tax:
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to add custom charges (fee) to item row total into cart for magento 2?
Thanks for your answer.
Actually I need code to increase row total of item through pro-grammatically after event of add to cart. e.g. If product A has price $14 Then I need row total as $14(Price) + $2(Fee) = $16(Row Total of item).
Item | Price | Qty | Subtotal |
LifeLong Fitness IV | $14.00 + $2(fee) | 1 | $16.00 |
How to override model quote item class. that was as Mage_Sales_Model_Quote_Item in magento 1 and from which class in magento 2.
How to override method public function calcRowTotal() in magento 2.
Please help me for the same.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to add custom charges (fee) to item row total into cart for magento 2?
Were you able to achieve this? I'm looking for exactly the same solution.
EDIT: I need this for Magento 1.9.x
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to add custom charges (fee) to item row total into cart for magento 2?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to add custom charges (fee) to item row total into cart for magento 2?
Hi,
Overwrite Magento\Quote\Model\Quote\Item class calcRowTotal() method and set $this->setCalculationPrice($total);
That's it.