Jump to content

SOLVED!!! Products on Special???


Recommended Posts

Help Folks. I am having trouble having things show up in the Specials category. I discount items and throw on the On Sale sticker but they don't show up there. I'm a novice and could sure use some advice. Thanks!!!!

www.thehandsomegent.com

Link to comment
Share on other sites

Are you sure you are applying a reduction to the product (right above the "on sale" checkbox, titled "Reduction Amount"), and are you sure the product is enabled and you are saving them after the edits?

This usually does the trick, and I haven't heard of any problems like this...

So your prices-drop.php exists which calls on the getPricesDrop function from classes/Product.php

Search for this function in your classes/Product.php file. Here is a copy of what mine looks like... please note mine is modified version that fixes the pagination problem and I believe this is the one used in the latest version.

   static public function getPricesDrop($id_lang, $pageNumber = 0, $nbProducts = 10, $count = false, $orderBy = NULL, $orderWay = NULL, $beginning = false, $ending = false)
   {
       global $link, $cookie;
       if (!Validate::isBool($count))
           die(Tools::displayError());

       if ($pageNumber < 0) $pageNumber = 0;
       if ($nbProducts < 1) $nbProducts = 10;
       if (empty($orderBy) || $orderBy == 'position') $orderBy = 'myprice';
       if (empty($orderWay)) $orderWay = 'DESC';
       if ($orderBy == 'id_product' OR $orderBy == 'price' OR $orderBy == 'date_add')
           $orderByPrefix = 'p';
       elseif ($orderBy == 'name')
               $orderByPrefix = 'pl';
       if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay))
           die (Tools::displayError());
       $currentDate = date('Y-m-d H:m:i');
       if ($count)
       {
           $sql = '
           SELECT COUNT(DISTINCT p.`id_product`) AS nb
           FROM `'._DB_PREFIX_.'product` p
           WHERE p.`active` = 1
           AND (`reduction_price` > 0 OR `reduction_percent` > 0)
           '.((!$beginning AND !$ending) ?
           '    AND (`reduction_from` = `reduction_to` OR (`reduction_from` <= \''.pSQL($currentDate).'\' AND `reduction_to` >= \''.pSQL($currentDate).'\'))'
           :
               ($beginning ? 'AND `reduction_from` <= \''.pSQL($beginning).'\'' : '').($ending ? 'AND `reduction_to` >= \''.pSQL($ending).'\'' : '')).'
           AND p.`id_product` IN (
               SELECT cp.`id_product`
               FROM `'._DB_PREFIX_.'category_group` cg
               LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
               WHERE cg.`id_group` '.(!$cookie->id_customer ?  '= 1' : 'IN (SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.intval($cookie->id_customer).')').'
           )';
           $result = Db::getInstance()->getRow($sql);
           return intval($result['nb']);
       }
       $sql = '
       SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, p.`ean13`, i.`id_image`, il.`legend`, t.`rate`, (p.`reduction_price` + (p.`reduction_percent` * p.`price`)) AS myprice, m.`name` AS manufacturer_name
       FROM `'._DB_PREFIX_.'product` p
       LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
       LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = p.`id_tax`)
       LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`)
       WHERE (`reduction_price` > 0 OR `reduction_percent` > 0)
       '.((!$beginning AND !$ending) ?
           'AND (`reduction_from` = `reduction_to` OR (`reduction_from` <= \''.pSQL($currentDate).'\' AND `reduction_to` >= \''.pSQL($currentDate).'\'))'
       :
           ($beginning ? 'AND `reduction_from` <= \''.pSQL($beginning).'\'' : '').($ending ? 'AND `reduction_to` >= \''.pSQL($ending).'\'' : '')).'
       AND p.`active` = 1
       AND p.`id_product` IN (
           SELECT cp.`id_product`
           FROM `'._DB_PREFIX_.'category_group` cg
           LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
           WHERE cg.`id_group` '.(!$cookie->id_customer ?  '= 1' : 'IN (SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.intval($cookie->id_customer).')').'
       )
       ORDER BY '.(isset($orderByPrefix) ? pSQL($orderByPrefix).'.' : '').'`'.pSQL($orderBy).'`'.' '.pSQL($orderWay).'
       LIMIT '.intval($pageNumber * $nbProducts).', '.intval($nbProducts);
       $result = Db::getInstance()->ExecuteS($sql);
       if($orderBy == 'price')
       {
           Tools::orderbyPrice($result,$orderWay);
       }
       if (!$result)
           return false;
       return Product::getProductsProperties($id_lang, $result);
   } 



Also, you might want to apply the reduction to a product and verify in the database the reduction amount and on_sale (if checked) are being retained/saved in the database.

These are just some thoughts... HTH!

Link to comment
Share on other sites

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...