View Single Post
  #2  
Old 10-01-2012, 01:46 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Excluding coupns

Well I think it will require custom code, I haven't seen a module that allows you to exclude products from coupons.

I did this recently, here is my changelog:
Edit /include/func.cart.php
Edit /include/product_modify.php
ALTER TABLE `xcart_products` ADD `coupons_avail` CHAR( 1 ) NOT NULL DEFAULT 'Y' AFTER `discount_avail`
Edit /common_files/main/product_details.tpl

/include/product_modify.php look for:
'discount_avail' => $discount_avail,
After it add:
'coupons_avail' => $coupons_avail,

I am attaching my changed func.cart.php just search it for the word coupons, I believe everything is commented.

/common_files/main/product_details.tpl look for:
PHP Code:
<tr>
  {if 
$geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[discount_avail]" /></td>{/if}
  <
td class="FormButton" nowrap="nowrap">{$lng.lbl_apply_global_discounts}:</td>
  <
td class="ProductDetails">
  <
input type="checkbox" name="discount_avail" value="Y"{if $product.productid eq "" or $product.discount_avail eq "Y"checked="checked"{/if} />
  </
td>
</
tr
After it add:
PHP Code:
<tr>
  {if 
$geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[coupons_avail]" /></td>{/if}
  <
td class="FormButton" nowrap="nowrap">{$lng.lbl_apply_coupons}:</td>
  <
td class="ProductDetails">
  <
input type="checkbox" name="coupons_avail" value="Y"{if $product.productid eq "" or $product.coupons_avail eq "Y"checked="checked"{/if} />
  </
td>
</
tr

This should give you a checkbox on the product page and the ability to enable/disable coupons for that product. Don;t forget to run the SQL patch from my changeolg above. Be sure you are doing all of this on a dev site rather than your live store.
Attached Files
File Type: txt func.cart.php.txt (139.6 KB, 44 views)
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote