We have opencart installed as a Mijoshop component in a Joomla site, and in our opencart integration with a zoo application, we offer multiple discounts on our products based on user's profile and preferences entered on the product page. When user click "Add to Basket", our product page passes multiple parameters with various discount details to opencart.
Previously Opencart was storing users' basket in session, so we added additional parameters for the discounts, and it was working well.
Opencart is now storing user basket in database table, which only refers to the product code. Hence, opencart is ignoring the discount parameters that are sent by our product page.
There seems no option to add additional parameters to record the applicable discounts, please advice how can we pass the multiple discount details from product page to opencart basket and make it working as before?
Did we … ever had this feature built-in the core where the oc_cart table would contain such fields out-of-the-box? I must of missed a field or two since the beginning where I still doubt this feature was ever built-in on that database table …There seems no option to add additional parameters to record the applicable discounts, please advice how can we pass the multiple discount details from product page to opencart basket and make it working as before?

An alternative to your suggestion would be to add such feature in your custom theme common.js file where the product gets added to the cart. By adding an additional AJAX request call, you could create a session super global on the browser for the customer in order to add this total amount in the order total confirm() method.
As an alternative, as opposed to the common.js file, you could also simply create an order total extension module that would include a controller file like other order total extension modules already have and create a session super global variable to retain your calculated discount price before adding that amount into the oc_customer_transaction table. Of course, this option would only work for registered users as we speak as it would be useless to create a discounted price for guest users since the oc_cart database table gets its records deleted every hour by default on anyhow.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
There's no generic solution for this, because it seems like your discounts are pretty much custom. You need to redevelop your modification and nobody will just give you a solution, which you then implement. If you can't figure out yourself, how to do this, ask for commercial support from one of the developers.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Who is online
Users browsing this forum: ocmod.space and 42 guests