foresiteg Posted April 24, 2020 Share Posted April 24, 2020 Hello First my post here. I have a problem managing attributes for products in multistore. My Prestashop version is 1.7.6.4 This is my shop configuration in multistore. Shop1 (group) ---> shop1 ---> shop1.cooki.it Shop2 (group) ---> shop2 --> shop2.cooki.it I created a couple of attributes for shop 2 (and only for shop 2) but when I create a product with combination in the right panel of "Combination" tab i can' t see my new attributes. The system continue to visualize / assign only the attributes from shop1. I don't understand why. Probably it's a simple stuff but it's one day I tried to understand where is the configuration issue and I can't find. Thanks for your help Link to comment Share on other sites More sharing options...
foresiteg Posted April 26, 2020 Author Share Posted April 26, 2020 anynone can help me or suggest any hints? Link to comment Share on other sites More sharing options...
carlosr Posted April 29, 2020 Share Posted April 29, 2020 Yes the problem become from controller! because the store id it's not setup properly! please add the store id like this: in : src\PrestaShopBundle\Controller\Admin\ProductController.php around line #608 // MODIFIED BY OSI // $language['id_shop'] returned always 1, with this new value we get the original shop on current $oc_id_shop = $this->getContext()->shop->id; $doctrine = $this->getDoctrine()->getManager(); $language = empty($languages[0]) ? ['id_lang' => 1, 'id_shop' => $oc_id_shop] : $languages[0]; $attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop((int) $language['id_lang'], $oc_id_shop); it's all! Link to comment Share on other sites More sharing options...
foresiteg Posted April 30, 2020 Author Share Posted April 30, 2020 IT WORKS! Carlosr thanks you so much! 👏 Link to comment Share on other sites More sharing options...
Sgarbo Posted November 18, 2020 Share Posted November 18, 2020 On 4/29/2020 at 4:33 AM, carlosr said: Yes the problem become from controller! because the store id it's not setup properly! please add the store id like this: in : src\PrestaShopBundle\Controller\Admin\ProductController.php around line #608 // MODIFIED BY OSI // $language['id_shop'] returned always 1, with this new value we get the original shop on current $oc_id_shop = $this->getContext()->shop->id; $doctrine = $this->getDoctrine()->getManager(); $language = empty($languages[0]) ? ['id_lang' => 1, 'id_shop' => $oc_id_shop] : $languages[0]; $attributeGroups = $doctrine->getRepository('PrestaShopBundle:Attribute')->findByLangAndShop((int) $language['id_lang'], $oc_id_shop); it's all! Hello carlosr, I don't know how to apply your solution. I've the same problem of foresiteg, and I found a temporary "solution" by editing this at line 656. i changed from findByLangAndShop (1,1) to (2,3) But this cannot be a permanent solution. Yours looks much better to me. But how should I implement it? Where should I go to edit in the file? Or just copy and paste the code you wrote, somewhere? (Prestashop 1.7.4.3) $attributeGroups = $this ->getDoctrine() ->getManager() ->getRepository('PrestaShopBundle:Attribute') ->findByLangAndShop(2, 3); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now