2
votes

You know that opencart has got special price function. You can create it from admin panel for products. When quantity increased, you can decrease prices from special prices menu in admin panel.

  1. 1 unit $10,
  2. 2 unit $9,
  3. 3 unit $8 ...

When you added to cart this product. It happens like this cart;

  1. if you added 1 unit product to cart = $10
  2. if you added 2 unit product to cart = $18
  3. if you added 3 unit product to cart = $24

I try to change it like this. When i wrote their prices for quantities from special prices menu in admin panel. It must be its price for its quantity. So i try to do this;

  1. if you added 1 unit product to cart = $10
  2. if you added 2 unit product to cart = $9
  3. if you added 3 unit product to cart = $8

More than this would calculate $2.66 for per product.

I created an input radio form for product page. It is dynamic. It takes datas from special prices. Everything is good until this point. But when i added a product to cart. It takes its price for one product.

I tried to change it from controller. I edited quantity x prices string. But when i added more then 3 product. It started to calculate its price as 0. Because I didnt define 4th product from special price menu.

The most important thing is for me, Quantities and their total prices must show on product page. When consumers checked radio buttons on product page. It must show correctly in cart.

I checked, i couldnt find any extension like this. I hope, you understood what i want.

1
First of all, it is Discount what are You talking about, not specials. Second - provide us with Your code You have written so that we can identify and solve the problems. And why don't You just set the price of the product in discounts to be 4.5 for two products, 2.66 for three of them, etc? This would be much easier than reworking whole process...shadyyx
shadyyx is totally right here, you're mis-using the system if that's how you want to get the pricing. Prices are calculated per item and that is how you enter the price (a single unit not the total for X products)Jay Gilford
OpenCart specific questions are best asked on area51.stackexchange.com/proposals/77558/opencartPacerier

1 Answers

1
votes

I'd suggest first trying the built-in features in OC. You can either use the Discount feature or the Options feature. With Discount, you can set different discount per quantities (unlike when using special). Seems to me as this is what you are looking for. You will need to add the volume discount description either in the product description (manually) or with php/js in the product.tpl file (automatically).

If the inventory tracking is not important to you, you can also use Options and create special options for each product such as 'Buy 2nd item at $10 off' or 'Add 2 more for $xx' etc.

If you wanted to write some code, you can add a javascript code on your product.tpl template and calling a validator function when adding to cart. The function will look at the selected options and change the data accordingly.

Hope this helps!