Jump to content

More products on specials module !! pls how ??


datmos

Recommended Posts

yeah man, thanks it works, jquery and the arrows images don't work, but i don't want it, but, there is a maxims specils productos to 10.

10 products maxim listed on the module.

i want less. you know how ? i search in the module but i don't found thee number "10" :S

thanks again :D

Link to comment
Share on other sites

hi again :D

Ok, the module works perfect.

The problem ? its showing 10 products 1 by 1 with autoscrolling, if i put the mouse over the scrolling stops.

ok all works well, except for the 10 products showed.

i think this problem is from prices-drop.php, because in this page, by default, it show 10 specials.

im not sure :S

Link to comment
Share on other sites

  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());

       if ($count)
       {
           $sql = '
           SELECT COUNT(DISTINCT p.`id_product`) AS nb
           FROM `'._DB_PREFIX_.'product` p
           WHERE 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 (`reduction_price` > 0 OR `reduction_percent` > 0) and 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']);
       }
       $currentDate = date('Y-m-d');
       $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);
   }


/classes/Product.php
search function getPricesDrop and insert my 'new' function, vice the found.
Excuse me for my english, i'm from russia.
Good luck!

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