Post by hrevis25 » Tue Feb 18, 2020 1:02 am

Hey,
what i want to achieve is that i want to add an extra field in the totals page.

For example, i have added an extra field in each customer in database called "Customer_discount" and i want to show it in the minicart and cart page.

Any ideas on how to achieve this?

Thanks.

Active Member

Posts

Joined
Wed Apr 19, 2017 8:27 pm

Post by straightlight » Tue Feb 18, 2020 3:48 am

While the OC version has not been posted, you'd need to add your customer_discount field in your system/library/cart/cart.php file in the getProducts() method. Then, from your catalog/controller/checkout/cart.php file and catalog/controller/common/cart.php file, you could re-pull the field and output the results in your common/cart.tpl and checkout/cart.tpl files.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by hrevis25 » Tue Feb 18, 2020 7:08 pm

straightlight wrote:
Tue Feb 18, 2020 3:48 am
While the OC version has not been posted, you'd need to add your customer_discount field in your system/library/cart/cart.php file in the getProducts() method. Then, from your catalog/controller/checkout/cart.php file and catalog/controller/common/cart.php file, you could re-pull the field and output the results in your common/cart.tpl and checkout/cart.tpl files.
Yes sorry, my bad.
We 're talking about OC ver.: 2.3.0.2

Active Member

Posts

Joined
Wed Apr 19, 2017 8:27 pm
Who is online

Users browsing this forum: No registered users and 4 guests