Zen Cart Logo

A free gift question?

Locked

Views: 3,237

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
28 Apr 2008, 2:40 PM
#1
robwuk avatar

robwuk

Zen Follower

Join Date:
Aug 2005
Location:
United Kingdom
Posts:
458
Plugin Contributions:
0

A free gift question?

Hi, is it possible to have a free gift added to the order when a person spends over a certain amount of money?

Rob

1 May 2008, 3:53 PM
#2
robwuk avatar

robwuk

Zen Follower

Join Date:
Aug 2005
Location:
United Kingdom
Posts:
458
Plugin Contributions:
0

Re: A free gift question?

or adding another line on the order totals, i can set this to £0.00 just so they can see they are getting a free gift with each order

Rob

17 May 2008, 10:26 AM
#3
cdelab avatar

cdelab

New Zenner

Join Date:
Aug 2007
Posts:
47
Plugin Contributions:
0

Re: A free gift question?

Hello,

You can create a coupon with a reduction of 0.0001 (if you enter 0 the coupon will not be displayed).

But this is not a really good solution because on the invoice the customer read :

coupon : CODE_COUPON -0.00

And I'd like to see :

Coupon : CODE_COUPON (COUPON DESC) -0.00

So that you can explain in coupon description that you are offering a gift for free.

Can someone suggest the code to display "coupon description" on the invoice.

Moreover, the best solution will be to :

  • add a line in the cart with the article
  • redeem the total with the price of the item
  • So decrease stock of this item

A future mod for anybody with good development skills :smile:

17 May 2008, 1:00 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: A free gift question?

Response by PM.

21 May 2008, 9:12 PM
#5
ralphpina avatar

ralphpina

New Zenner

Join Date:
Oct 2007
Location:
Austin, TX
Posts:
2
Plugin Contributions:
0

Re: A free gift question?

This is how I did it, it may not be 100% compatible and I would welcome anyone's criticism, but it works for me.

edit includes/modules/order_total/ot_coupon.php

After this code:

if ($od_amount['type'] == 'S') $order->info['shipping_cost'] = 0;
      $sql = "select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . (int)$_SESSION['cc_id'] . "'";
      $zq_coupon_code = $db->Execute($sql);
      $this->coupon_code = $zq_coupon_code->fields['coupon_code'];

Enter:

// bof edit to show coupon description
     $coupon_desc_query = "select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . (int)$_SESSION['cc_id'] . "'";
     $coupon_code_exec = $db->Execute($coupon_desc_query);
     $this->coupon_desc = $coupon_code_exec->fields['coupon_description'];
     // eof edit to show coupon description

Then edit:

$this->output[] = array('title' => $this->title . ': ' . '<a href="javascript:couponpopupWindow(\'' . zen_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $_SESSION['cc_id']) . '\')">' . $this->coupon_code . '</a> :',
                              'text' => '-' . $currencies->format($od_amount['total']),
                              'value' => $od_amount['total']);

To:

      $this->output[] = array('title' => $this->title . ': ' . '<a href="javascript:couponpopupWindow(\'' . zen_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $_SESSION['cc_id']) . '\')">' . $this->coupon_code . '</a> (' . $this->coupon_desc . ') :',
                              'text' => '-' . $currencies->format($od_amount['total']),
                              'value' => $od_amount['total']);