Jump to content

Can't Update Image Positions When Multi-Store Context And Images Not In Default Shop(Shopid=1)


TiaNex Shopping

Recommended Posts

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);
                 }
            }
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...