Post by mhdibrahim92 » Thu May 21, 2020 4:03 pm

In a product i have set the minimum quantity as 10
product price = 50/- Rs
i have added a product option as

Blue (option value name) - 0/- Rs(price)
Green(option value name) - 20/- Rs(price)
Black(option value name) - 10/- Rs(price)

so by default the product price will be set as 500/- Rs(50*10), as the minimum quantity is set as 10

now after select the Green option, the price shows 700/- Rs instead of showing 520/- Rs
Here, the product option price also gets multiplied with minimum quantity and i want to exclude the minimum quantity value....
Can you help me to achieve this?

New member


Thu Apr 13, 2017 9:37 pm

Post by opencartmart » Thu May 21, 2020 4:17 pm

You can achieve modifying the cart library file i.e. system/library/cart/cart.php

Find the line:

Code: Select all

'total'           => ($price + $option_price) * $cart['quantity'],
Replace with:

Code: Select all

'total'           => ($price  * $cart['quantity']) + $option_price,
1. Don't modify the file directly. Use ocmod instead
2. This change will affect all products

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart

Active Member


Wed Oct 02, 2013 3:59 am
Who is online

Users browsing this forum: No registered users and 26 guests