Search code examples
phpcontent-management-systemprestashopprestashop-1.5prestashop-1.6

Manufacturers page not working after upgrade


A prestashop website at version 1.4.1.4 was working with manufacturer.php file for manufacturer pages. The update to 1.6.0.6 unfortunatley deleted that file because it has been considered as deprecated (URL structure changed after CMS update).

One consequence is the change in the URL structure.

from:

url/manufacturer.php?id_category=6

to :

url/index.php?id_manufacturer=6&controller=manufacturer&id_lang=2

So now, the first URL structure is giving 404.

The problem:

In the old website, when the id_manufacturer is set to 0, the url returns a page containing a list of all manufacturers. When it is set to the id of a specific manufacturer, the url returns products of that specific manufacturer. With the new version, the results are the same EXCEPT for the id=0 (404 page). In other words, I cannot find what is id_manufacturer to return the list of manufacturers.

If I am not wrong, Prestashop gives id=0 by default to the page of manufacturers list? What is going wrong in your point of you? It looks like I need to override ManufacturerController like in 'Home' category page not working after update. But please, do these overrides are only workarounds that might be broken in the next updates when core Prestashop team correct these mistakes (if they are mistakes).

Any insights are highly appreciated.

EDIT: I am sorry, yesterday I maybe didn't clarify the point very well. In fact the url is working for id=0 (it displays all parts of the page). But for where the list of manufactrurers should appear, I have "Il n'y aucun fabricant." even I have 80 manufacuturers in my database. Thanks again


Solution

  • There is no need of any override, I just tested it and with no id specified, or id=0, it gives the manufacturer list page on 1.6.0.6. See this bit from that controller

        if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop())
        {
            $this->productSort();
            $this->assignOne();
            $this->setTemplate(_PS_THEME_DIR_.'manufacturer.tpl');
        }
        else
        {
            $this->assignAll();
            $this->setTemplate(_PS_THEME_DIR_.'manufacturer-list.tpl');
        }
    

    So either of these

    index.php?controller=manufacturer&id_lang=1&id_manufacturer=0

    index.php?controller=manufacturer&id_lang=1

    Should be working fine!