X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   Excluding coupns (https://forum.x-cart.com/showthread.php?t=65013)

Dougrun 10-01-2012 12:36 PM

Excluding coupns
 
Im trying to think up a way to exclude coupons from our sale items without getting custom work done. The sale items are already in multiple categories so limiting it to one isn't possible. Any mods or add-ons out there that have coupon exclusions?

totaltec 10-01-2012 01:46 PM

Re: Excluding coupns
 
1 Attachment(s)
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.

cflsystems 10-01-2012 01:57 PM

Re: Excluding coupns
 
This may work for you - http://www.cflsystems.com/coupons-extension-for-x-cart.html. It doesn't exclude but allows you to select exact products to apply coupon to

Dougrun 10-01-2012 02:10 PM

Re: Excluding coupns
 
what version is your func.cart.php based on? i see a difference that not commented.

Dougrun 10-01-2012 02:37 PM

Re: Excluding coupns
 
Hmm, it seems to work on the backend but my cart is still applying it to unchecked items. I'l lhave to go through my func.cart.php and find it.

btw, had to add
lbl_apply_coupons


Dougrun 10-02-2012 08:55 AM

Re: Excluding coupns
 
1 Attachment(s)
nevermind, I finally got it working, thanks. attached is the 4.5.2 func.cart.php file needed.

Also, if anyone needs to modify their own cart.php file, search for "coupons_" not just coupon, way too many of those.

totaltec 10-02-2012 09:12 AM

Re: Excluding coupns
 
Glad you got it sorted out. Thanks for providing your solutions/discoveries for the community.

Dougrun 10-19-2012 11:21 AM

Re: Excluding coupns
 
do you think theres anything in this mod that would disable my UPS realtime rates from showing up?

totaltec 10-19-2012 12:50 PM

Re: Excluding coupns
 
I can't imagine there would be, but can't rule it out if nothing else has been changed. Simple solution try reverting the changes you've made and see if it fixes the problem.

Real time rates are notoriously touchy, you never know if it is on your side or theirs.

Dougrun 10-19-2012 12:53 PM

Re: Excluding coupns
 
nevermind, seems i had to re-register the UPS tool in order to get it working again.


All times are GMT -8. The time now is 12:25 PM.

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