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

Hi,
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 3.0.2.0. 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. :)

Regards
arslan

Newbie

Posts

Joined
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,

find:

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) . ")");

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
Who is online

Users browsing this forum: Bing [Bot] and 387 guests