Post by arslankhaan » Sat Sep 29, 2018 6:54 pm

I trust everybody is doing fine. I am satisfied whenever I contacted, someone must replied me generously. I am yet testing my site and I am having a problem with opencart version Gift Voucher code is being sent through email prior to payment. Whenever I purchse a gift voucher through an account and send it to second account, an email is sent to second account with gift voucher code with second code being able to apply the voucher code, although payment has not been made by purchasing account. It should not happen. Gift Voucher Code should only be sent through email when purchasing account has made the payment. I have searched all through but to no result. Perhaps my searchmay be poor. Please any idea? I would be greatly thankful for any help. :)




Tue May 08, 2018 7:43 pm

Post by straightlight » Sun Oct 07, 2018 2:17 am

Currently, only orders are being focused when creating a voucher during checkout or when using the API. To enforce customer accounts,

in catalog/model/extension/total/voucher.php file,


Code: Select all

$order_query = $this->db->query("SELECT order_id FROM `" . DB_PREFIX . "order` WHERE order_id = '" . (int)$voucher_query->row['order_id'] . "' AND order_status_id IN(" . implode(",", $implode) . ")");
replace with:

Code: Select all

$order_query = $this->db->query("SELECT order_id FROM `" . DB_PREFIX . "order` WHERE order_id = '" . (int)$voucher_query->row['order_id'] . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND order_status_id IN(" . implode(",", $implode) . ")");

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Straightlight Administrator / Quality Assurance Analyst / Programmer / Opencart Tester

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 28 guests