Jump to content

Variable $nom des déclinaisons


Chibanou
 Share

Recommended Posts

Bonjour,

Je génère mon flux catalogue XMLvia un module mais les noms des produits, malgré les déclinaisons, reste le même. Je souhaiterais pouvoir y ajouter le nom des déclinaisons à la suite (ex:chaise haute Zaaz ; rouge, chaise haute Zaaz ; verte, etc...).

 

Voici la partie concernée originale :

$article = $xml->addChild('article');

$article->addChild('type', $p_type);

$pa_ref = isset($pa['reference']) ? $pa['reference'] : $product['reference'];

$article->addCData('ref', $pa_ref);

$supplier_ref = isset($pa['supplier_reference']) ? $pa['supplier_reference'] : $product['supplier_reference'];

$article->addCData('ref_ext', $supplier_ref);

$weight = (isset($pa['weight']) AND $pa['weight'] != 0) ? $pa['weight'] : $product['weight'];

$article->addChild('gauge', $weight);

$ean13 = (isset($pa['ean13'])) ? $pa['ean13'] : $product['ean13'];

$article->addCData('ean13', $ean13);

$article->addCData('lib', $product['name']);

$article->addCData('description',$product['description_short']);

 

Et celle que j'ai commencé à modifié mais n'étant pas développeur je ne sais pas comment attribuer la bonne valeur à "$attribute['name']" sachant qu'elle se situe dans la colonne "Name" de "attribute_lang" de la BDD :

 

$article = $xml->addChild('article');

$article->addChild('type', $p_type);

$pa_ref = isset($pa['reference']) ? $pa['reference'] : $product['reference'];

$article->addCData('ref', $pa_ref);

$supplier_ref = isset($pa['supplier_reference']) ? $pa['supplier_reference'] : $product['supplier_reference'];

$article->addCData('ref_ext', $supplier_ref);

$weight = (isset($pa['weight']) AND $pa['weight'] != 0) ? $pa['weight'] : $product['weight'];

$article->addChild('gauge', $weight);

$ean13 = (isset($pa['ean13'])) ? $pa['ean13'] : $product['ean13'];

$article->addCData('ean13', $ean13);

$pa_name = (isset($pa['name'])) ? $pa['name'] : $product['name'];

$pa_attributes = (isset($pa['attributes'])) ? $pa['attributes'] : $attribute['name'];

$article->addCData('lib', $pa_name. " ; " .$pa_attributes);

$article->addCData('description',$product['description_short']);

 

Merci pour votre aide et bon week end !

Loïc

Edited by Nomaya (see edit history)

Share this post


Link to post
Share on other sites

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More