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?
|
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:
PHP Code:
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. |
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
|
Re: Excluding coupns
what version is your func.cart.php based on? i see a difference that not commented.
|
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 |
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. |
Re: Excluding coupns
Glad you got it sorted out. Thanks for providing your solutions/discoveries for the community.
|
Re: Excluding coupns
do you think theres anything in this mod that would disable my UPS realtime rates from showing up?
|
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. |
Re: Excluding coupns
nevermind, seems i had to re-register the UPS tool in order to get it working again.
|
Re: Excluding coupns
fyi, upgrading from gold to gold plus does not effect this mod. even though the "on sale" module places a checkbox on the bottom of the product page, it didnt touch my "apply coupons" checkbox and it still works on the checkout page.
|
Re: Excluding coupns
Quote:
I can verify this works like a charm on my 4.4.3 Gold site. I searched Mike's func.cart.php file for "coupons_avail" to find the additional code and added into my file (located at include/func/func.cart.php, not include/func.cart.php as noted). You also need to add a language variable for "lbl_apply_coupons". |
Re: Excluding coupns
just to confirm, this also works on AlteredCarts Onepage Checkout module which I switched to yesterday.
|
Re: Excluding coupns
I can verify that between Mike's post #2 and Doug's post #5 and #6 - works in 4.5.4.
This is a brilliant patch! Especially useful if you make gift certificates a PRODUCT -- and you must exclude coupon codes from GC purchases. Thanks guys! J PS - don't forget to run cleanup.php and/or purge your caches. |
Re: Excluding coupns
still works in 4.6 too.
|
Re: Excluding coupns
I noticed that I can no longer change the coupon checkbox on the product page with this mod in 4.6.1. I have to manually go in the table and change it. It does stick, it just doesnt take the product pages changes. Any idea where I should look?
The other checkboxes work when i change them, just not this one since the upgrade.. |
Re: Excluding coupns
Amazing work! Thanks guys. I can confirm it works on v4.5.5. This is great, as we have a category for clearance items, and people have been "double dipping" by applying coupon codes to clearance items. Not anymore :)
|
Re: Excluding coupns
also works in 4.6.4
|
Re: Excluding coupns
upgraded to 4.7.2 and this no longer works, I cannot get the func.cart.php file working. It makes the entire store go blank.
|
Re: Excluding coupns
Doug, not sure (we don't use 4.7.x) but it may be due to 4.7 using Smarty3? Check into that and see what you can find out
|
Re: Excluding coupns
maybe Totaltec can help?
|
Re: Excluding coupns
Doug,
Got your PM. I'd like to help and have time to look into it, but I'm swamped. Busier than I have ever been. |
Re: Excluding coupns
I seem to recall XC was working on some similar feature regarding applying coupons to products. Any XC people want to chime in on whether a new feature may have disabled our old hack?
|
Re: Excluding coupns
I fixed it! Must have been copying too much, i did a side by side comparison and it worked much better than searching for "coupons_"
Works on 4.7.2 |
Re: Excluding coupns
this is broken again, and i'm on 4.7.4. I have products that have accept coupons unchecked but xc is applying them. Anyone on 4.7.4 have this working?
|
Re: Excluding coupns
its a coupon that gives an absolute $ discount, maybe I need more exclusion lines added? Gotta be in the func.cart.php somewhere.
|
Re: Excluding coupns
Just followed these exact instructions basically for Version 4.7.6 and it worked beautifully. Nice to find some help from yourself from 6 years ago!
|
Re: Excluding coupns
the only problem is it doesnt exclude free shipping coupons. we need to figure that one out.
|
Re: Excluding coupns
Have you tried adding some code for coupon_type is/not free_ship ?
|
Re: Excluding coupns
I didnt write any of the code so thats not my expertise.
|
Re: Excluding coupns
This is somehow now broken in 4.7.11. all my coupons can now be applied to any item so I need a fix. Anyone willing to work on this?
|
Re: Excluding coupns
nevermind, my other site it does work so i'll do a compare and figure out whats up..
|
Re: Excluding coupns
i'd love to include (exclude) freeshipping coupon types to the ones excluded, i'm searching in the func,cart,php file but not sure where to add it.
i tried this: Code:
if ( but that excluded every item, even if coupons were checked. The original is missing the Code:
&& $product['coupons_avail'] != 'Y' |
All times are GMT -8. The time now is 04:22 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.