Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Apply coupon even when discount is 0.00

Apply coupon even when discount is 0.00

Started by shopville on 12 Feb 2014, 5:41 PM · Views: 1,189

Results 1 to 6 of 6
12 Feb 2014, 5:41 PM
#1
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Apply coupon even when discount is 0.00

Hello,
Here's what i'm trying to accomplish, i want to have a coupon code which provides no discount or additional product, it is just for tracking purposes (we will gift customer using the coupon) but if the discount amount is 0.00 the coupon will not show on order, is there a way to tweak it should show even when 0.00 discount?

TIA

12 Feb 2014, 6:11 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Apply coupon even when discount is 0.00

While you could take out the safety check of a value being set for the discount in the ot_coupon.php by changing the > 0 to >= 0 ...

  function process() {
    global $order, $currencies;
    $order_total = $this->get_order_total(isset($_SESSION['cc_id']) ? $_SESSION['cc_id'] : '');
    $od_amount = $this->calculate_deductions($order_total['total']);
    $this->deduction = $od_amount['total'];
[B]    if ($od_amount['total'] >[/B]=[B] 0) {[/B]

You will/may have other customizations to make the discount make sense ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

13 Feb 2014, 3:54 PM
#3
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Apply coupon even when discount is 0.00

Ajeh:

While you could take out the safety check of a value being set for the discount in the ot_coupon.php by changing the > 0 to >= 0 ...

function process() {
global $order, $currencies;
$order_total = $this->get_order_total(isset($_SESSION['cc_id']) ? $_SESSION['cc_id'] : '');
$od_amount = $this->calculate_deductions($order_total['total']);
$this->deduction = $od_amount['total'];
[B] if ($od_amount['total'] >[/B]=[B] 0) {[/B]

> 
> You will/may have other customizations to make the discount make sense ...

It works, but this way a discount coupon field is displayed on all orders with a 0.00 discount
13 Feb 2014, 3:57 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Apply coupon even when discount is 0.00

Try using:

    if ($od_amount['total'] >[B]=[/B] 0 [B]&& isset($_SESSION['cc_id'])[/B]) {

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

13 Feb 2014, 9:08 PM
#5
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Apply coupon even when discount is 0.00

Ajeh:

Try using:

if ($od_amount['total'] >[B]=[/B] 0 [B]&& isset($_SESSION['cc_id'])[/B]) {

Works! Thanks a mil!
13 Feb 2014, 10:14 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Apply coupon even when discount is 0.00

Thanks for the update that this was able to work for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!