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

Coupons Extension mod

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #11  
Old 08-21-2012, 12:10 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Coupons Extension mod

/var/log
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #12  
Old 08-21-2012, 04:25 PM
 
plnewton plnewton is offline
 

Advanced Member
  
Join Date: Sep 2011
Posts: 65
 

Default Re: Coupons Extension mod

Well I got a little further, there was an error in the log about it not being able to find a field so I cleared the cache and it is now letting me add the coupon

when I test it is seems to only apply the discount from the first product in the cart and the rest stay at full price.

in the log file I am getting the following:
<?php die(); ?>
[21-Aug-2012 00:50:16] Warning: Smarty error: unable to read resource: "provider/home.tpl" in /home8/fivdoll3/public_html/include/lib/smarty/Smarty.class.php on line 1093
[21-Aug-2012 00:51:26] Warning: Smarty error: unable to read resource: "provider/home.tpl" in /home8/fivdoll3/public_html/include/lib/smarty/Smarty.class.php on line 1093
[21-Aug-2012 00:51:38] Warning: Smarty error: unable to read resource: "provider/home.tpl" in /home8/fivdoll3/public_html/include/lib/smarty/Smarty.class.php on line 1093
[21-Aug-2012 17:50:05] Error: Smarty error: [in customer/home.tpl line 27]: syntax error: unrecognized tag 'var' (Smarty_Compiler.class.php, line 590) in /home8/fivdoll3/public_html/include/lib/smarty/Smarty.class.php on line 1093
[21-Aug-2012 18:00:28] Error: Smarty error: [in modules/Manufacturers/customer_manufacturer_products.tpl line 15]: syntax error: unrecognized tag: text-decoration: underline;

color: #70254A; (Smarty_Compiler.class.php, line 446) in /home8/fivdoll3/public_html/include/lib/smarty/Smarty.class.php on line 1093
[21-Aug-2012 18:11:33] Error: Smarty error: [in customer/home.tpl line 27]: syntax error: unrecognized tag 'var' (Smarty_Compiler.class.php, line 590) in /home8/fivdoll3/public_html/include/lib/smarty/Smarty.class.php on line 1093
[21-Aug-2012 18:17:26] Error: Smarty error: [in modules/Manufacturers/customer_manufacturer_products.tpl line 15]: syntax error: unrecognized tag: text-decoration: underline;

color: #70254A; (Smarty_Compiler.class.php, line 446) in /home8/fivdoll3/public_html/include/lib/smarty/Smarty.class.php on line 1093


I am know expert so not sure what to make of it??
__________________
Version 4.4.3
Reply With Quote
  #13  
Old 08-21-2012, 06:22 PM
 
plnewton plnewton is offline
 

Advanced Member
  
Join Date: Sep 2011
Posts: 65
 

Default Re: Coupons Extension mod

I have done a compare on the files and there are allot of differences between my files and the files supplied in the extention

I am running version 4.43

Here are the version numbers at the tops of my files:
func.cart.php,v 1.126.2.43 2011/04/14 08:45:16 aim
config.php,v 1.23.2.2 2011/04/22 12:14:16 aim
func.php,v 1.23.2.4 2011/04/14 08:45:16 aim
import.php,v 1.24.2.1 2011/01/10 13:11:56 ferz (same as Mod)
coupons.php,v 1.61.2.2 2011/01/10 13:12:08 ferz (same as Mod)
coupons.tpl,v 1.5.2.1 2010/12/15 09:44:40 aim (same as Mod)

Files versions in extension for 4.4.x:
func.cart.php,v 1.126.2.8 2011/01/10 13:11:51 ferz
config.php,v 1.23.2.1 2011/01/10 13:11:56 ferz
func.php,v 1.23.2.1 2011/01/10 13:11:56 ferz
import.php,v 1.24.2.1 2011/01/10 13:11:56 ferz
coupons.php,v 1.61.2.2 2011/01/10 13:12:08 ferz
coupons.tpl,v 1.5.2.1 2010/12/15 09:44:40 aim


Hope this sheds some light??

Cheers
__________________
Version 4.4.3
Reply With Quote
  #14  
Old 08-21-2012, 10:53 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Coupons Extension mod

Quote:
Originally Posted by plnewton

when I test it is seems to only apply the discount from the first product in the cart and the rest stay at full price.


This is how standard XC coupons work, if you want it to apply to all products you will have to comment out

if ($discount_coupon_data["apply_product_once"] == "Y")
break;

from func.cart.php

As for the smarty errors - they have nothing to do with this mod
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #15  
Old 08-21-2012, 10:55 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Coupons Extension mod

Quote:
Originally Posted by plnewton
I have done a compare on the files and there are allot of differences between my files and the files supplied in the extention

The files in the mod are form 4.4.5 - last version in the branch. You are not supposed to copy the whole file just the changes in it. They should work just fine with 4.4.3 as well
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #16  
Old 08-21-2012, 11:05 PM
 
plnewton plnewton is offline
 

Advanced Member
  
Join Date: Sep 2011
Posts: 65
 

Default Re: Coupons Extension mod

That fixed it!!

Thanks
__________________
Version 4.4.3
Reply With Quote
  #17  
Old 08-22-2012, 06:59 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Coupons Extension mod

Quote:
Originally Posted by cflsystems
This is how standard XC coupons work, if you want it to apply to all products you will have to comment out

if ($discount_coupon_data["apply_product_once"] == "Y")
break;

from func.cart.php
This appears to be a setting you can control for the coupon. It seems to only get set to "Y" if the coupon is absolute ($ off) and either "Cart contains the product," "Cart contains products from the category," or the new "Cart contains following product codes" (new) is selected. This causes the next section to appear "How to apply the discount" and the first radio button is selected for "Discount is applied once per order." Otherwise, the default is "N". If you don't choose "Discount is applied once per order" it should apply to all products.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #18  
Old 08-22-2012, 09:16 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Coupons Extension mod

Yes this only works on $ off when you can select if the coupon applies to all products or first one only, % off sets this value to apply to first coupon only

Default XC code for product for example

Code:
if ($how_to_apply_p != 'N') $how_to_apply_p = 'Y'; // Apply discount once per order

When you select % discount $how_to_apply_p variable has no value so its value is set to "Y". So QT decided that if you want % off this should be applied to first product only no matter what. Of course this can be changed in the code but I didn't change the default XC behaviour on this - my mod just follows it
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #19  
Old 08-23-2012, 02:33 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Coupons Extension mod

This seems like an oversight. Since you are working with coupons have you considered reporting this to QT?
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #20  
Old 08-23-2012, 03:21 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Coupons Extension mod

I have not. Not sure what the logic is behind - $ off can be for one product or all; % off is only for one product. This has always been like that. Since the selector for this shows only if you select $ off I think this is how they wanted it to work
__________________
Steve Stoyanov
CFLSystems.com
Web Development
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 07:35 PM.

   

 
X-Cart forums © 2001-2020