Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

Opencart coupon history not working with Paypal


in catalog/model/checkout/coupon.php
change:

Code:

  public function getCoupon($code) {

to

Code:

 public function getCoupon($code,$noverify=0) {

AND change

Code:

       if ($status) {
             return array(

to

Code:

       if (($status)||($noverify)) {
             return array(

Next, in catalog/model/total/coupon.php in the confirm function right near the bottom change

Code:

    $coupon_info = $this->model_checkout_coupon->getCoupon($code);

to

Code:

    $coupon_info = $this->model_checkout_coupon->getCoupon($code,1);

Here is the VQMod xml file:

<?xml version="1.0" encoding="utf-8"?>
<modification>
<id>Fix Coupon Codes (so they register after using paypal or similar payment gateway)</id>
<version>1.0.0</version>
<vqmver>2.1.0</vqmver>
<author>Sanjoy Roy </author>
<file name="catalog/model/checkout/coupon.php">
<operation>
<search position="replace"><![CDATA[ public function getCoupon($code) { ]]></search>
<add><![CDATA[ public function getCoupon($code, $verify = true) { ]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ if ($status) { ]]></search>
<add><![CDATA[ if ($status || $verify === false) { ]]></add>
</operation>
</file>

<file name="catalog/model/total/coupon.php">
<operation>
<search position="replace"><![CDATA[ $coupon_info = $this->model_checkout_coupon->getCoupon($code); ]]></search>
<add><![CDATA[ $coupon_info = $this->model_checkout_coupon->getCoupon($code, false); ]]></add>
</operation>
</file>
</modification>
Advertisements

Comments are closed.

%d bloggers like this: