aleh250 Posted January 13, 2019 Share Posted January 13, 2019 By saving Product in context "All Shops" I want to get id_image of "CoverImage" of "this"-product for each shop. For instance we have Multistore of 3 Shops, each of shops has Product_id "8" but with diferent Cover Image. (id_image: 23,35,36) Edit product "8" in context "All Shops" and Save: public function hookActionProductUpdate() { ... if (Shop::getContext() == Shop::CONTEXT_SHOP) { $shops[] = $this->context->shop->id; } else { foreach (Shop::getCompleteListOfShopsID() as $key => $shop) { $shops[] = (int)$shop; } } ... foreach ($shops as $key => $id_shop) { ... $image = Product::getCover((int)($id_product)); $params = array( 'id_image' => (int)$image['id_image'], ... ... } ... } But this code returns the same id_image of CoverImage. (for first(default) Shop) Can someone help? Thanks in advance. Link to comment Share on other sites More sharing options...
aleh250 Posted January 21, 2019 Author Share Posted January 21, 2019 function getCover in Product.php: public static function getCover($id_product, Context $context = null) Someone know what should be second parameter ($context) ? I tried pass there $id_shop, but nothing changed 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