X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Setting Discount Coupon to expire beyond 31/12/2003 (https://forum.x-cart.com/showthread.php?t=5066)

parmar 11-03-2003 11:20 AM

Setting Discount Coupon to expire beyond 31/12/2003
 
I'm setting up a Discount Coupon for one of our partners. X-Cart date range in Coupon setting only goes up to 31/12/2003. How will I be able to extend that beyond end December 2003? Or Will I have to wait until the New Year and re-issue the coupon?

funkydunk 11-03-2003 11:29 AM

New code for modules/discount coupons/coupons.tpl
version 3.4.x - did this today for another client


Code:

{* $Id: coupons.tpl,v 1.10 2003/04/22 10:10:59 svowl Exp $ *}
{include file="location.tpl" last_location="Store coupons"}
{include file="main/popup_product_js.tpl"}
This page allows you to define coupons that you wish to accept for your store. Each coupon allows a customer to receive a discount when he/she orders products from your store. 



 If a customer enters a valid coupon code during checkout, the store will deduct the discount amount from their order total.



{capture name=dialog}



{if $coupons ne ""}
<table width="100%" border=0>
<form action="coupons.php" method="POST">
<tr><td class=TableHead>Coupon</td><td class=TableHead>Status</td><td class=TableHead>Disc.</td><td class=TableHead>Min.</td><td class=TableHead>Times</td><td class=TableHead colspan=2>Expires</td></tr>
{section name=prod_num loop=$coupons}
<tr>
<td>
{$coupons[prod_num].coupon}
</td>
<td>
<select name="status-{$coupons[prod_num].coupon}">
<option value=A {if $coupons[prod_num].status eq "A"}selected{/if}>Active</option>
<option value=D {if $coupons[prod_num].status eq "D"}selected{/if}>Disabled</option>
<option value=U {if $coupons[prod_num].status eq "U"}selected{/if}>Used</option>
</select>
</td>
<td>{if $coupons[prod_num].coupon_type eq "absolute"}{include file="currency.tpl" value=$coupons[prod_num].discount}{elseif  $coupons[prod_num].coupon_type eq "percent"}{$coupons[prod_num].discount}%{else}Free ship.{/if}</td>
<td>{include file="currency.tpl" value=$coupons[prod_num].minimum}</td>
<td align=center>{$coupons[prod_num].times_used}/{$coupons[prod_num].times}</td>
<td nowrap>
{$coupons[prod_num].expire|date_format:"%b/%d/%Y"}
</td>
<td><input type="button" value="Delete" onClick="document.location='coupons.php?mode=delete&coupon={$coupons[prod_num].coupon}'"></td>
</tr>
<tr>
<td colspan=7>
This coupon applies on orders
{if $coupons[prod_num].productid ne 0}
which contain product #{$coupons[prod_num].productid}
{elseif $coupons[prod_num].categoryid ne 0}
which contain product(s) from category #{$coupons[prod_num].categoryid}
{else}
greater than {include file="currency.tpl" value=$coupons[prod_num].minimum}
{/if}
</td>
</tr>
{/section}
<tr>
<td></td><td colspan=5><input type=submit value="Update"></td>
</tr>
</form>
</table>
<hr size=1 noshade>
{/if}
<font class=AdminTitle>Add new coupon</font>
<form action="coupons.php?mode=update" method="POST" name=coupon_form>
<table border=0>
<tr><td>Coupon # <font class="Star">*</font></td><td><input type=text size=24 name=coupon_new></td></tr>
<tr><td>Times to use</td><td><input type=text size=8 value="1" name=times_new></td></tr>
<tr><td>Status</td>
<td>
<select name=status_new>
<option value=A>Active</option>
<option value=D>Disabled</option>
</select>
</td></tr>
<tr><td>Discount</td><td><input type=text size=24 name=discount_new value="0.00"></td></tr>
<tr><td>Coupon type</td>
<td>
<select name=coupon_type_new>
<option value=absolute>{$config.General.currency_symbol} off</option>
<option value=percent>% off</option>
<OPTION value=free_ship>Free shipping</OPTION>
</select>
</td></tr>
<tr><td>Expires</td>
<td>
{math equation=year+1 year=$config.Company.end_year assign=endyear}
{html_select_date prefix="new_" start_year=$config.Company.start_year end_year=$endyear month_format="%b"}
</td></tr>
<TR>
<TD valign=top>Apply to</TD>
<TD>
<table border=0>
<tr><td valign=top><INPUT type=radio name=apply_to value="any" checked></td><td>order total, {$config.General.currency_symbol}
<input type=text size=24 name=minimum_new value="0.00"></td></tr>
<tr><td valign=top><INPUT type=radio name=apply_to value="product"></td><td>one product
<INPUT type=hidden name=productid_new><INPUT type=text disabled size=24 name=productname><INPUT type=button onClick="javascript:popup_product('coupon_form.productid_new','coupon_form.productname');" value="Browse"></td></tr>
<tr><td valign=top><INPUT type=radio name=apply_to value="category"></td><td>one category


<SELECT name=categoryid_new>
{section name=cats loop=$allcategories}
<OPTION value="{$allcategories[cats].categoryid}">{$allcategories[cats].category}</OPTION>
{/section}
</SELECT>
</td>
</tr>
</table>
 </table>


<input type="submit" value="Add coupon">
</form>
{/capture}
{include file="dialog.tpl" title="Store coupons" content=$smarty.capture.dialog extra="width=100%"}


Lingerieblowout 11-03-2003 04:54 PM

here an easy fix to correct 2003 dates
 
Change this line in your config.php


$config["Company"]["end_year"] = 2010;

change the date (2010) field to whatever you want...

:lol:

Michael
http://www.lingerieblowout.com

parmar 11-05-2003 12:22 AM

Thank you guys.

Lingerieblowout 11-05-2003 09:46 AM

No Problem
 
Glad we can help... :lol:

turtle 11-25-2003 10:32 AM

Funkydunk's code works perfectly, and I think will increase the year to 2005 as the calendar rolls into Jan 1, 2004, etc for following years.

boxerbay 12-08-2003 02:05 PM

i have xcart 322 and this does not work for me. I changed the tpl file but now the year shows as just a zero with no option to change it.

HELP

boxerbay 12-08-2003 02:13 PM

i hate when i do that. I post then 5 minutes later a i figure it out on my own. In coupon.tpl just edit the line where it shows 2003 as the expiration. I set mine to 2005.

{html_select_date prefix="new_" start_year=2001 end_year=2005 month_format="%b"}

Hope that helps.

leon 12-09-2003 10:52 AM

It happens to all of us at some point, first we get frustrated with some minor change, then we find out right after posting.

Although in bigger issues, even though you could find a way around it is recommended to post (IMHO), since you have alot of points of view and new information that could help you out.


All times are GMT -8. The time now is 06:18 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.