Jump to content

Discounts not showing correctly as a %


gray

Recommended Posts

Just finally got around to using discounts on version 1.4.5.1

 

But I find that even thou the discounts are set as % percentage, it shows as £. How can I correct it ??

 

Also how can show the discounts in reverse order ie 10 quantity the first. ??

 

presta5.jpg

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Hi had, some problem.

 

But you can fix ordering by opening SpecificPrice.php

and change function:

 

public static function getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group)
   {
       $now = date('Y-m-d H:i:s');
       $res = Db::getInstance()->ExecuteS('
           SELECT *,
                   '.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group).'
           FROM `'._DB_PREFIX_.'specific_price`
           WHERE   `id_product` IN(0, '.(int)$id_product.') AND
                   `id_shop` IN(0, '.(int)$id_shop.') AND
                   `id_currency` IN(0, '.(int)$id_currency.') AND
                   `id_country` IN(0, '.(int)$id_country.') AND
                   `id_group` IN(0, '.(int)$id_group.')
                   AND
                   (
                       (`from` = \'0000-00-00 00:00:00\' OR \''.$now.'\' >= `from`)
                       AND
                       (`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`)
                   )
                   ORDER BY `from_quantity` DESC, `score` DESC
       ');

 

to

public static function getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group)
{
 $now = date('Y-m-d H:i:s');
 $res = Db::getInstance()->ExecuteS('
  SELECT *,
 '.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group).'
  FROM `'._DB_PREFIX_.'specific_price`
  WHERE   `id_product` IN(0, '.(int)$id_product.') AND
 `id_shop` IN(0, '.(int)$id_shop.') AND
 `id_currency` IN(0, '.(int)$id_currency.') AND
 `id_country` IN(0, '.(int)$id_country.') AND
 `id_group` IN(0, '.(int)$id_group.')
 AND
 (
  (`from` = \'0000-00-00 00:00:00\' OR \''.$now.'\' >= `from`)
  AND
  (`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`)
 )
 ORDER BY `from_quantity` ASC, `score` ASC
 ');

 

so simply DESC to ASC

 

Hope this helps

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi - Yes that sorted out the

 

how can show the discounts in reverse order ie 10 quantity the first. ??

 

but has anyone any ideas on

 

even thou the discounts are set as % percentage, it shows as £. How can I correct it ??
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...