Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Easy Advanced Specials - Error


Guest

Recommended Posts

I have installed the advanced specials but every time that I try to set a discount I got an error.

 

Warning: preg_match() [function.preg-match]: Compilation failed: numbers out of order in {} quantifier at offset 10 in /home/endom0/public_html/admin/specials_enhanced.php on line 120

 

Warning: Cannot modify header information - headers already sent by (output started at /home/endom0/public_html/admin/specials_enhanced.php:120) in /home/endom0/public_html/admin/includes/functions/general.php on line 22

 

Line 120 from specials_enhanced.php

if(preg_match("/^[0-9]{1,3}([" . $currencies->currencies[DEFAULT_CURRENCY]["decimal_point"] . "][0-9]{1," . intval($currencies->currencies[DEFAULT_CURRENCY]["decimal_places"]) . "})?%$/", $discount))

$discount_percent = true;

 

$discount = floatval(str_replace($currencies->currencies[DEFAULT_CURRENCY]["decimal_point"], ".", $discount));

}

 

I think it is because in yen currencie you don´t have decimal places, it is like 10,000yen.

I have tested it with a currencie that has decimal places and it worked... is there anything that I can do to make it work?

 

Thanks in advance!

Hara - Japan

Link to comment
Share on other sites

  • 6 months later...

I just also had this issue, and was able to resolve it by editing specials_enhanced.php

 

find this code:

if(preg_match("/^[0-9]{1,3}([" . $currencies->currencies[DEFAULT_CURRENCY]["decimal_point"] . "][0-9]{1," . 
intval($currencies->currencies[DEFAULT_CURRENCY]["decimal_places"]) . "})?%$/", $discount))

replace with:

if(preg_match("/^[0-9]{1,3}([" . $currencies->currencies[DEFAULT_CURRENCY]["decimal_point"] . "][0-9]{0," . 
intval($currencies->currencies[DEFAULT_CURRENCY]["decimal_places"]) . "})?%$/", $discount))

As you may be able to see all that was changed was the 1 to a 0

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...