TiaNex Shopping Posted March 3, 2016 Share Posted March 3, 2016 can't update image positions when multi-store context and images not in default shop(shopid=1) when you have not one store, image 1,image 2 in shop 1, image 3,image 4 in shop 2, when you change the image position it will caused error, the ajax return "Property Image->id_product is empty" can't create right image entity, i found a temp solution : not associate with the shop when the entity is 'Image' in \Adapter\Adapter_EntityMapper.php change the code $sql->leftJoin($entity_defs['table'] . '_shop', 'c', 'a.`' . bqSQL($entity_defs['primary']) . '` = c.`' . bqSQL($entity_defs['primary']) . '` AND c.`id_shop` = ' . (int)$id_shop); // Get shop informations if (Shop::isTableAssociated($entity_defs['table'])) { if($entity_defs['classname']=='Image'){ $sql->leftJoin($entity_defs['table'] . '_shop', 'c', 'a.`' . bqSQL($entity_defs['primary']) . '` = c.`' . bqSQL($entity_defs['primary']).'`'); }else{ $sql->leftJoin($entity_defs['table'] . '_shop', 'c', 'a.`' . bqSQL($entity_defs['primary']) . '` = c.`' . bqSQL($entity_defs['primary']) . '` AND c.`id_shop` = ' . (int)$id_shop); } } 1 Link to comment Share on other sites More sharing options...
Rhobur Posted May 16, 2017 Share Posted May 16, 2017 Nice one! Struggled with this for hours now, saw that the image->id_product was empty but until your post didn't pinpoint where it happens. Thanks! 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