Originally Posted by
mc12345678
There's a lot of possible directions to take this and/or the cause at this point. This new order_total module... how much/what has been changed away from the ot_gv code? Has it been modified to be a unique set of code?
It almost sounds like the code still has at least some remnant of the ot_gv "definition" and based on the description that it may have a coding error causing it to always attach to those documents (unless I misunderstood).
Hi mc12345678,
Originally, I started with a copy of the ot_gv code and made it unique by renaming all references to that module (vars, defines, etc.).
I abandoned that route once I found the gift card addon. I installed the gift card addon, which is an orders total module. Since my goal is to have a gift card type function and use it like a customer loyalty program where a customer can earn $$ that is credited to their card, I thought this would be a better route and modify from there.
I first tested the GC module as is to make sure it was working as described. After a few fixes, it seemed to be working except for the issue that prompted my question about the code registering as if it was the GV module.
I have gone through most of the gift card code line-by-line since I have made several modifications to fit my needs. I traced back where the GV defines get inserted to the order.php class. It is the only reference to the GV defines in all of the Zen Cart code.
includes/classes/order.php
Code:
'payment_method' => (($this->info['payment_module_code'] == '' and $this->info['payment_method'] == '') ? PAYMENT_METHOD_GV : $this->info['payment_method']),
'payment_module_code' => (($this->info['payment_module_code'] == '' and $this->info['payment_method'] == '') ? PAYMENT_MODULE_GV : $this->info['payment_module_code']),
Looking at the code above, I would need to set those array elements to my gift card defines so the GV ones are not used. So, the question would be where in my code and how would I correctly set these so they are used when an order is paid for using a gift card?
Code:
$this->info['payment_method'] = PAYMENT_METHOD_GIFTCARD;
$this->info['payment_module_code'] = PAYMENT_MODULE_GIFTCARD;
Hope I'm explaining this clearly, thanks!
Bookmarks