Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Coupons & Products
 
Reply
   X-Cart forums > Considering X-Cart > Considering using X-Cart for my project
 
Thread Tools Search this Thread
  #21  
Old 08-13-2012, 10:43 AM
  elaine's Avatar 
elaine elaine is offline
 

X-Cart team
  
Join Date: Dec 2008
Posts: 166
 

Default Re: Coupons & Products

Quote:
Originally Posted by Sueberu
How do I eliminate those few products from getting this coupon applied.

I'm afraid, the "Discount Coupons" module doesn't allow for such exceptions. You can create a coupon either per individual product or per category like it is described at http://help.x-cart.com/index.php?title=X-Cartiscount_Coupons#Adding_Discount_Coupons

However we can tailor your X-Cart copy to your very needs within our custom development service upon your request: http://www.x-cart.com/request_quote.html
__________________
X-Cart team
Reply With Quote
  #22  
Old 08-13-2012, 10:53 AM
 
Sueberu Sueberu is offline
 

Member
  
Join Date: Aug 2005
Posts: 29
 

Default Re: Coupons & Products

Thanks for the reply. I appreciate it.
__________________
4.0.14
Reply With Quote
  #23  
Old 10-16-2012, 03:27 PM
 
Dougrun Dougrun is online now
 

X-Adept
  
Join Date: Apr 2012
Posts: 628
 

Default Re: Coupons & Products

see this thread: http://forum.x-cart.com/showthread.php?t=65013
__________________
4.7.x xcart store
Business 5.3xx
Reply With Quote

The following user thanks Dougrun for this useful post:
elaine (10-17-2012)
  #24  
Old 12-20-2012, 03:08 PM
 
griff4594 griff4594 is offline
 

Newbie
  
Join Date: Dec 2012
Posts: 3
 

Default Re: Coupons & Products

I was wondering if there was a way to have a free shipping coupon work only for select shipping methods.

I have already added the select option in my admin under the coupons admin in skin/common_files/modules/Discount_Coupons/coupons.tpl and added the database entry free_shipping_option to the xcart_discount_coupons table. Here is what I added to the coupons.tpl file (the commented out section):

<tr>
<td class="FormButton">{$lng.lbl_coupon_type}:</td>
<td>&nbsp;</td>
<td>
<select name="coupon_type_new" onchange="javascript: checkDCBox();">
<option value="percent"{if $coupon_data.coupon_type_new eq "percent"} selected="selected"{/if}>{$lng.lbl_coupon_type_percent}</option>
<option value="absolute"{if $coupon_data.coupon_type_new eq "absolute"} selected="selected"{/if}>{$config.General.currency_symbol} {$lng.lbl_coupon_type_absolute|wm_remove|escape}</option>
<option value="free_ship"{if $coupon_data.coupon_type_new eq "free_ship"} selected="selected"{/if}>{$lng.lbl_coupon_freeshiping}</option>
</select>
</td>
</tr>

<tr>
<td class="FormButton">Please Choose the Free Shipping Types:</td>
<td>&nbsp;</td>
<td>{include file="main/free_shipping_selector.tpl" extra='multiple="multiple"' size="10" field="free_shipping_option[]"}</td>
</tr>

Then I made new file called free_shipping_selector.tpl and it reads:


{*
$Id: category_selector.tpl,v 1.4 2010/06/08 10:17:47 igoryan Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
<script type="text/javascript">
//<![CDATA[
var isNN = document.layers ? true : false;
var isIE = document.all ? true : false;
var mouseX;
var mouseY;

init();

{literal}

function init() {
if ( isNN )
document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = handleMouseMove;
}

function handleMouseMove(evt) {
mouseX = !isIE ? evt.pageX : window.event.clientX;
mouseY = !isIE ? evt.pageY : window.event.clientY;

return true;
}

function hideTitle(id) {
var layer = document.getElementById(id);
layer.style.display = "none";
}

function showTitle(value, position) {
if (value.length < 40) {
return;
}
if (!isIE) {
var layer = document.getElementById('layer');
setTimeout("hideTitle('layer');", 3000);
layer.innerHTML = value;
} else {
var layer = document.getElementById('iframe');
setTimeout("hideTitle('iframe');", 3000);
layer.style.width = value.length * 6;
layer.contentWindow.document.body.innerHTML = value;
layer.contentWindow.document.body.style.fontSize = "12px";
layer.contentWindow.document.body.style.marginLeft = "0px";
layer.contentWindow.document.body.style.marginTop = "0px";
layer.contentWindow.document.body.style.background = "#FFFBD3";
}
layer.style.display = "";
if (position == 'left') {
var length = layer.style.width.substr(0, layer.style.width.length - 2);
layer.style.left = (mouseX - length) + "px";
} else if (position == 'right') {
layer.style.left = mouseX+"px";
}
layer.style.top = mouseY+"px";
}
{/literal}
//]]>
</script>
<div id='layer' style="display:none; position:absolute; background-color:#FFFBD3; border:1px solid #000000;left:0px;top:0px;z-index: 10;"></div>
<select name="{$field|default:"categoryid"}"{$extra} onchange="javascript: showTitle(this.options[this.selectedIndex].text, 'right');"{if $size} size="{$size}"{/if}>
{if $display_empty eq 'P'}
<option value="">{$lng.lbl_please_select_category}</option>
{elseif $display_empty eq 'E'}
<option value="">&nbsp;</option>
{/if}

<!------------------ Custom Free Shipping Type Option ------------------------->

{php}

$result = mysql_query("SELECT shipping FROM xcart_shipping WHERE active = 'Y'");
if (!$result) {
die("Query to show fields from table failed");
}

while($option = mysql_fetch_array($result))
{
$shipping_option = $option['shipping'];
$option = "<option value=" . $shipping_option . ">".$shipping_option."</option>";
echo $option;

}

{/php}

<!------------------ Custom Free Shipping Type Option ------------------------->

</select>

In my provider/coupons.php file I added the lines below to line 177 and 178 :

if(is_array($free_shipping_option))
$free_shipping_option = serialize($free_shipping_option);

This all adds the option window into the coupons admin and updates the database. But I need it to take effect for the cart.php page as well and I am lost as far as to where to add the if statement for it. I have read a few posts but they do not get this specific about this type of customization.

Help.....
__________________
Ver. 4.5.4
xMenus
Reply With Quote
  #25  
Old 12-20-2012, 03:10 PM
 
griff4594 griff4594 is offline
 

Newbie
  
Join Date: Dec 2012
Posts: 3
 

Default Re: Coupons & Products

Well I did figure out that the if statement needs to be in includes/func/func.cart.php but I need some help where to add it or the correct syntax.
__________________
Ver. 4.5.4
xMenus
Reply With Quote
  #26  
Old 12-27-2012, 10:17 AM
 
griff4594 griff4594 is offline
 

Newbie
  
Join Date: Dec 2012
Posts: 3
 

Default Re: Coupons & Products

Well I have decided to write a module from scratch. I find it is easier than trying to find all of the variables I need to edit the existing coupon module. I have it almost done. I just need to write the if/else statements to update the shipping on the cart.php page. I'll post updates when I'm done.
__________________
Ver. 4.5.4
xMenus
Reply With Quote
Reply
   X-Cart forums > Considering X-Cart > Considering using X-Cart for my project


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:10 PM.

   

 
X-Cart forums © 2001-2018