Hi, is it possible to have a free gift added to the order when a person spends over a certain amount of money?
Rob
Printable View
Hi, is it possible to have a free gift added to the order when a person spends over a certain amount of money?
Rob
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
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:
Response by PM.
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:
Enter:PHP 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'];
Then edit:PHP Code:
// 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
To:PHP Code:
$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']);
PHP Code:
$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']);
http://www.zen-cart.com/wiki/index.p..._World_Example
explains how to achieve.