ican Posted September 26, 2018 Share Posted September 26, 2018 Does anyone know, How to get shop id in Prestashop 1.7. For example, We can get language id by (int)$languages[0]['id_lang'] in .php file. Link to comment Share on other sites More sharing options...
tdsoft Posted September 26, 2018 Share Posted September 26, 2018 you can use: $id_shop = (int)Shop::getContextShopID(); Link to comment Share on other sites More sharing options...
tantan199 Posted September 26, 2018 Share Posted September 26, 2018 This could also work. $this->context->shop->id Link to comment Share on other sites More sharing options...
ican Posted September 26, 2018 Author Share Posted September 26, 2018 3 hours ago, tantan199 said: This could also work. $this->context->shop->id I want to put it here. $attributeGroups = $this ->getDoctrine() ->getManager() ->getRepository('PrestaShopBundle:Attribute') ->findByLangAndShop((int)$languages[0]['id_lang'], 1); at the last instead of 1. It's not working. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted September 26, 2018 Share Posted September 26, 2018 54 minutes ago, ican said: I want to put it here. $attributeGroups = $this ->getDoctrine() ->getManager() ->getRepository('PrestaShopBundle:Attribute') ->findByLangAndShop((int)$languages[0]['id_lang'], 1); at the last instead of 1. It's not working. In which file you are making these changes means module file, class file, controller file, vendor file etc? Link to comment Share on other sites More sharing options...
ican Posted September 26, 2018 Author Share Posted September 26, 2018 24 minutes ago, Knowband Plugins said: In which file you are making these changes means module file, class file, controller file, vendor file etc? in src\PrestaShopBundle\Controller\Admin|ProductController.php Link to comment Share on other sites More sharing options...
ican Posted September 26, 2018 Author Share Posted September 26, 2018 2 hours ago, Knowband Plugins said: In which file you are making these changes means module file, class file, controller file, vendor file etc? DO YOU HAVE ANY IDEA? Link to comment Share on other sites More sharing options...
dinesh badrukhiya Posted September 27, 2018 Share Posted September 27, 2018 you can try : (int) ['id_shop'] Link to comment Share on other sites More sharing options...
ican Posted September 27, 2018 Author Share Posted September 27, 2018 7 hours ago, dinesh badrukhiya said: you can try : (int) ['id_shop'] Thanks but this is not id for shop. Link to comment Share on other sites More sharing options...
ican Posted September 28, 2018 Author Share Posted September 28, 2018 On 9/26/2018 at 4:56 PM, Knowband Plugins said: In which file you are making these changes means module file, class file, controller file, vendor file etc? Any idea? What is the variable for shop id? 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