Jump to content

Problems with the suppliers page


vincii007

Recommended Posts

Hi Everyone,

 

I am using PS 1.6 with the warehouse theme and my shop as three issues which i am not able to sort out,

 

1) The Suppliers page shows all the suppliers but the total number of products in the shop shows under 1 supplier only rest all suppliers it shows 0.However when we go to the supplier it shows the associated products properly.

 

2) The front office search doesn't search anything at all, i have rebuild he index but when we search any product or any keyword the message is " no match found "

 

3) I have used a code which i found in my presta blog for getting the language selector in line but it has ruined my top bar.

 

The url to my shop is www.listerz.com

 

Can anyone please help on these ?

 

Thank you

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

SOLUTION:
 

I just had to open class/Manufacturer.php, delete $results = ...... );  from line 191 to line 205 and write the code below instead.

 

$results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
                    SELECT  p.`id_manufacturer`, COUNT(DISTINCT p.`id_product`) as nb_products
                    FROM `'._DB_PREFIX_.'product` p USE INDEX (product_manufacturer)
                    '.Shop::addSqlAssociation('product', 'p').'
                    LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`)
                    WHERE p.`id_manufacturer` != 0 AND product_shop.`visibility` NOT IN ("none")
                    '.($active ? ' AND product_shop.`active` = 1 ' : '').'
                    '.($all_group ? '' : ' AND EXISTS (
                        SELECT 1
                        FROM `'._DB_PREFIX_.'category_group` cg
                        LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
                        WHERE p.`id_product` = cp.`id_product` AND cg.`id_group` '.$sql_groups.'
                    )').'
                    GROUP BY p.`id_manufacturer`'

                );

Link to comment
Share on other sites

  • 1 month later...

SOLUTION:

 

I just had to open class/Manufacturer.php, delete $results = ...... );  from line 191 to line 205 and write the code below instead.

 

$results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
                    SELECT  p.`id_manufacturer`, COUNT(DISTINCT p.`id_product`) as nb_products
                    FROM `'._DB_PREFIX_.'product` p USE INDEX (product_manufacturer)
                    '.Shop::addSqlAssociation('product', 'p').'
                    LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`)
                    WHERE p.`id_manufacturer` != 0 AND product_shop.`visibility` NOT IN ("none")
                    '.($active ? ' AND product_shop.`active` = 1 ' : '').'
                    '.($all_group ? '' : ' AND EXISTS (
                        SELECT 1
                        FROM `'._DB_PREFIX_.'category_group` cg
                        LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
                        WHERE p.`id_product` = cp.`id_product` AND cg.`id_group` '.$sql_groups.'
                    )').'
                    GROUP BY p.`id_manufacturer`'

                );

 this is for manufacturer, but for supplier not.

I've been checking new Supplier.php file of new version of Prestashop on GitHub but code is the same, I think the problem wasn't fixe

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