View Single Post
  #3  
Old 08-25-2004, 04:56 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default another fix

I'm adding some more fixes as I get a better idea of how the coupon code works. It seems that after you make the above modifications, you cannot enter a coupon code once the free shipping discount has kicked in. To remedy that, I had to modify the skindir/customer/main/cart.tpl file. The very last part of the template file is the only part we need to change. So change this:
Code:
{if $cart.coupon_discount == 0 && $products != ""} {if $active_modules.Discount_Coupons ne ""} {include file="modules/Discount_Coupons/add_coupon.tpl} {/if} {/if}
To this:
Code:
{*if $cart.coupon_discount == 0 && $products != ""*} {if $active_modules.Discount_Coupons ne ""} {include file="modules/Discount_Coupons/add_coupon.tpl} {/if} {*/if*}

I just commented out the IF statement that encloses the coupon entry form. That keep the coupon entry form from being hidden once there is already a discount being used (which happens when the free shipping discount is automatically applied). I'm not sure why the templates were designed to hide the coupon form in the first place. If you enter multiple discount coupons, it only figures in the last one entered, so there doesn't seem to be any danger of customers entering the same code multiple times and getting additional discounts. The only problem I see remaining is that if you use an actual "free shipping" coupon type, it will kill the automatic free shipping discount and hides the discount display in your cart total, but I guess that's by design. It would be nicer if free shipping coupons displayed the free shipping as a discount the same way the other coupons do. Maybe I'll fix that in a later post.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote