Install cms products when other module installed an override

Hi, i'm trying to use your free plugin : free products to CMS. I added the shortcode on a CMS page : {product:78} (for example) But nothing is displayed. When i'm in debug mode here is the error message : (1/1) ClassNotFoundException Attempted to load class "ProductListingPresenter" from the global namespace. Did you forget a "use" statement for e.g. "PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductListingPresenter" or "PrestaShop\PrestaShop\Core\Product\ProductListingPresenter"? in CmsController.php line 105 Thanks in advance for your help. FYI : I'm using a custom theme.
 

Hello
when you installed the module "cms products" from our offer - your shop had existing override of CmsController.php (overrides/controllers/front/CmsController.php) that was installed by other module.
Because of this override from module "cms products" was not installed properly by prestashop. It is not an issue of module "cms producst" nor module that previously applied an override. It is the way of how prestashop - unfortunately - works.

How to solve it?
go to overrides/controllers/front/CmsController.php
and right before:
class CmsController extends CmsControllerCore

add missing not installed code:
use PrestaShop\PrestaShop\Adapter\Image\ImageRetriever;
use PrestaShop\PrestaShop\Adapter\Product\PriceFormatter;
use PrestaShop\PrestaShop\Core\Product\ProductListingPresenter;
use PrestaShop\PrestaShop\Adapter\Product\ProductColorsRetriever;


Share on Google Plus

About VEKIA

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment