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

Excluding coupns

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #1  
Old 10-01-2012, 12:36 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 900
 

Default 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?
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #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

The following 5 users thank totaltec for this useful post:
ADDISON (08-09-2013), carpeperdiem (08-02-2013), Dougrun (10-01-2012), MAPerformance (12-20-2012), mcanitano (07-30-2014)
  #3  
Old 10-01-2012, 01:57 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,197
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #4  
Old 10-01-2012, 02:10 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 900
 

Default Re: Excluding coupns

what version is your func.cart.php based on? i see a difference that not commented.
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #5  
Old 10-01-2012, 02:37 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 900
 

Default 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

__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote

The following 2 users thank Dougrun for this useful post:
carpeperdiem (08-02-2013), mcanitano (07-30-2014)
  #6  
Old 10-02-2012, 08:55 AM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 900
 

Default Re: Excluding coupns

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.
Attached Files
File Type: txt no_coupon_func.cart.php_4.5.2.txt (145.0 KB, 36 views)
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote

The following 2 users thank Dougrun for this useful post:
carpeperdiem (08-02-2013), totaltec (10-02-2012)
  #7  
Old 10-02-2012, 09:12 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Excluding coupns

Glad you got it sorted out. Thanks for providing your solutions/discoveries for the community.
__________________
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
  #8  
Old 10-19-2012, 11:21 AM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 900
 

Default Re: Excluding coupns

do you think theres anything in this mod that would disable my UPS realtime rates from showing up?
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
  #9  
Old 10-19-2012, 12:50 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

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.
__________________
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
  #10  
Old 10-19-2012, 12:53 PM
 
Dougrun Dougrun is offline
 

X-Adept
  
Join Date: Apr 2012
Posts: 900
 

Default Re: Excluding coupns

nevermind, seems i had to re-register the UPS tool in order to get it working again.
__________________
4.7.x xcart store
Business 5.4xx
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4



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 01:36 PM.

   

 
X-Cart forums © 2001-2020