Jump to content

Same image on product colors combinations


Artem

Recommended Posts

I need to add color combinations to product. Every combination has its own image. ID of combinations are present in when getting product xml. ID of images also present in combination xml. But when I change color on product page, image does not change. In the combination edit panel in all combinations first image checked, but not the image with desired color. How can I correctly add combinations with images.

Combination XML:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<combination>
	<id><![CDATA[4812]]></id>
	<id_product xlink:href="http://garant-dom.com.ua/api/products/4616"><![CDATA[4616]]></id_product>
	<location></location>
	<ean13></ean13>
	<upc></upc>
	<quantity><![CDATA[0]]></quantity>
	<reference></reference>
	<supplier_reference></supplier_reference>
	<wholesale_price><![CDATA[200.000000]]></wholesale_price>
	<price><![CDATA[0.000000]]></price>
	<ecotax><![CDATA[0.000000]]></ecotax>
	<weight><![CDATA[0.000000]]></weight>
	<unit_price_impact><![CDATA[0.00]]></unit_price_impact>
	<minimal_quantity><![CDATA[1]]></minimal_quantity>
	<default_on><![CDATA[0]]></default_on>
	<available_date><![CDATA[0000-00-00]]></available_date>
<associations>
<product_option_values node_type="product_option_values">
	<product_option_values xlink:href="http://garant-dom.com.ua/api/product_option_values/332">
	<id><![CDATA[332]]></id>
	</product_option_values>
</product_option_values>
<images node_type="image">
	<image xlink:href="http://garant-dom.com.ua/api/images/combinations/4812/10989">
	<id><![CDATA[10989]]></id>
	</image>
</images>
</associations>
</combination>
</prestashop>

Product xml:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<product>
	<id><![CDATA[4616]]></id>
	<id_manufacturer><![CDATA[0]]></id_manufacturer>
	<id_supplier><![CDATA[0]]></id_supplier>
	<id_category_default xlink:href="http://garant-dom.com.ua/api/categories/472"><![CDATA[472]]></id_category_default>
	<new></new>
	<cache_default_attribute><![CDATA[4811]]></cache_default_attribute>
	<id_default_image xlink:href="http://garant-dom.com.ua/api/images/products/4616/10988" not_filterable="true"><![CDATA[10988]]></id_default_image>
	<id_default_combination xlink:href="http://garant-dom.com.ua/api/combinations/4811" not_filterable="true"><![CDATA[4811]]></id_default_combination>
	<id_tax_rules_group xlink:href="http://garant-dom.com.ua/api/tax_rule_groups/1"><![CDATA[1]]></id_tax_rules_group>
	<position_in_category not_filterable="true"><![CDATA[0]]></position_in_category>
	<manufacturer_name not_filterable="true"></manufacturer_name>
	<quantity not_filterable="true"><![CDATA[0]]></quantity>
	<type not_filterable="true"><![CDATA[simple]]></type>
	<id_shop_default><![CDATA[1]]></id_shop_default>
	<reference></reference>
	<supplier_reference></supplier_reference>
	<location></location>
	<width><![CDATA[0.000000]]></width>
	<height><![CDATA[0.000000]]></height>
	<depth><![CDATA[0.000000]]></depth>
	<weight><![CDATA[0.000000]]></weight>
	<quantity_discount><![CDATA[0]]></quantity_discount>
	<ean13><![CDATA[0]]></ean13>
	<upc></upc>
	<cache_is_pack><![CDATA[0]]></cache_is_pack>
	<cache_has_attachments><![CDATA[0]]></cache_has_attachments>
	<is_virtual><![CDATA[0]]></is_virtual>
	<on_sale><![CDATA[0]]></on_sale>
	<online_only><![CDATA[0]]></online_only>
	<ecotax><![CDATA[0.000000]]></ecotax>
	<minimal_quantity><![CDATA[1]]></minimal_quantity>
	<price><![CDATA[0.000000]]></price>
	<wholesale_price><![CDATA[10.000000]]></wholesale_price>
	<unity></unity>
	<unit_price_ratio><![CDATA[0.000000]]></unit_price_ratio>
	<additional_shipping_cost><![CDATA[0.00]]></additional_shipping_cost>
	<customizable><![CDATA[0]]></customizable>
	<text_fields><![CDATA[0]]></text_fields>
	<uploadable_files><![CDATA[0]]></uploadable_files>
	<active><![CDATA[1]]></active>
	<redirect_type><![CDATA[404]]></redirect_type>
	<id_product_redirected><![CDATA[0]]></id_product_redirected>
	<available_for_order><![CDATA[1]]></available_for_order>
	<available_date><![CDATA[0000-00-00]]></available_date>
	<condition><![CDATA[new]]></condition>
	<show_price><![CDATA[1]]></show_price>
	<indexed><![CDATA[1]]></indexed>
	<visibility><![CDATA[both]]></visibility>
	<advanced_stock_management><![CDATA[0]]></advanced_stock_management>
	<date_add><![CDATA[2018-10-02 14:57:48]]></date_add>
	<date_upd><![CDATA[2018-10-02 15:04:21]]></date_upd>
	<meta_description><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[]]></language></meta_description>
	<meta_keywords><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[]]></language></meta_keywords>
	<meta_title><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[Кресло Major]]></language></meta_title>
	<link_rewrite><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[erge]]></language></link_rewrite>
	<name><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[Кресло Major]]></language></name>
	<description><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[<p>Кресло, Сиденье Ткань, Цвет: Желтый / Каркас Металл Хромированный</p>
<p>Доступные цвета:</p>
<div id="kolory_ico_list"><a style="text-decoration: none;" href="produkt.php?product_id=1790"><img src="../images/kolory/green.jpg" /> ciemny zielony</a><br /><a style="text-decoration: none;" href="produkt.php?product_id=1787"><img src="../images/kolory/restpom.jpg" /> musztardowy</a><br /><a style="text-decoration: none;" href="produkt.php?product_id=2552"><img src="../images/kolory/blue.jpg" /> niebieski</a><br /><a style="text-decoration: none;" href="produkt.php?product_id=1789"><img src="../images/kolory/orange.jpg" /> pomarańczowy</a><br /><a style="text-decoration: none;" href="produkt.php?product_id=1788"><img src="../images/kolory/grey.jpg" /> szary</a><br /><a style="text-decoration: none;" href="produkt.php?product_id=2551"><img src="../images/kolory/yellow.jpg" /> ż&oacute;łty</a></div>
<p>Размеры:</p>
<div id="wymiary_ico"><img src="images/piktogramy/krzesla_p2.png" />72 cm <img src="images/piktogramy/krzesla_p4.png" />36 cm <img src="images/piktogramy/krzesla_p1.png" />84 cm <img src="images/piktogramy/krzesla_p3.png" />49 cm</div>]]></language></description>
	<description_short><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[]]></language></description_short>
	<available_now><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[]]></language></available_now>
	<available_later><language id="3" xlink:href="http://garant-dom.com.ua/api/languages/3"><![CDATA[]]></language></available_later>
<associations>
<categories node_type="categories">
	<categories xlink:href="http://garant-dom.com.ua/api/categories/450">
	<id><![CDATA[450]]></id>
	</categories>
	<categories xlink:href="http://garant-dom.com.ua/api/categories/472">
	<id><![CDATA[472]]></id>
	</categories>
</categories>
<images node_type="images">
	<images xlink:href="http://garant-dom.com.ua/api/images/products/4616/10988">
	<id><![CDATA[10988]]></id>
	</images>
	<images xlink:href="http://garant-dom.com.ua/api/images/products/4616/10989">
	<id><![CDATA[10989]]></id>
	</images>
	<images xlink:href="http://garant-dom.com.ua/api/images/products/4616/10990">
	<id><![CDATA[10990]]></id>
	</images>
	<images xlink:href="http://garant-dom.com.ua/api/images/products/4616/10991">
	<id><![CDATA[10991]]></id>
	</images>
	<images xlink:href="http://garant-dom.com.ua/api/images/products/4616/10992">
	<id><![CDATA[10992]]></id>
	</images>
	<images xlink:href="http://garant-dom.com.ua/api/images/products/4616/10993">
	<id><![CDATA[10993]]></id>
	</images>
</images>
<combinations node_type="combinations">
	<combinations xlink:href="http://garant-dom.com.ua/api/combinations/4811">
	<id><![CDATA[4811]]></id>
	</combinations>
	<combinations xlink:href="http://garant-dom.com.ua/api/combinations/4812">
	<id><![CDATA[4812]]></id>
	</combinations>
	<combinations xlink:href="http://garant-dom.com.ua/api/combinations/4813">
	<id><![CDATA[4813]]></id>
	</combinations>
	<combinations xlink:href="http://garant-dom.com.ua/api/combinations/4814">
	<id><![CDATA[4814]]></id>
	</combinations>
	<combinations xlink:href="http://garant-dom.com.ua/api/combinations/4815">
	<id><![CDATA[4815]]></id>
	</combinations>
	<combinations xlink:href="http://garant-dom.com.ua/api/combinations/4816">
	<id><![CDATA[4816]]></id>
	</combinations>
</combinations>
<product_option_values node_type="product_option_values">
	<product_option_values xlink:href="http://garant-dom.com.ua/api/product_option_values/331">
	<id><![CDATA[331]]></id>
	</product_option_values>
	<product_option_values xlink:href="http://garant-dom.com.ua/api/product_option_values/332">
	<id><![CDATA[332]]></id>
	</product_option_values>
	<product_option_values xlink:href="http://garant-dom.com.ua/api/product_option_values/333">
	<id><![CDATA[333]]></id>
	</product_option_values>
	<product_option_values xlink:href="http://garant-dom.com.ua/api/product_option_values/334">
	<id><![CDATA[334]]></id>
	</product_option_values>
	<product_option_values xlink:href="http://garant-dom.com.ua/api/product_option_values/335">
	<id><![CDATA[335]]></id>
	</product_option_values>
	<product_option_values xlink:href="http://garant-dom.com.ua/api/product_option_values/336">
	<id><![CDATA[336]]></id>
	</product_option_values>
</product_option_values>
<product_features node_type="product_features"/>
<tags node_type="tags"/>
<stock_availables node_type="stock_availables">
	<stock_availables xlink:href="http://garant-dom.com.ua/api/stock_availables/9668">
	<id><![CDATA[9668]]></id>
	<id_product_attribute><![CDATA[0]]></id_product_attribute>
	</stock_availables>
	<stock_availables xlink:href="http://garant-dom.com.ua/api/stock_availables/9669">
	<id><![CDATA[9669]]></id>
	<id_product_attribute><![CDATA[4811]]></id_product_attribute>
	</stock_availables>
	<stock_availables xlink:href="http://garant-dom.com.ua/api/stock_availables/9670">
	<id><![CDATA[9670]]></id>
	<id_product_attribute><![CDATA[4812]]></id_product_attribute>
	</stock_availables>
	<stock_availables xlink:href="http://garant-dom.com.ua/api/stock_availables/9671">
	<id><![CDATA[9671]]></id>
	<id_product_attribute><![CDATA[4813]]></id_product_attribute>
	</stock_availables>
	<stock_availables xlink:href="http://garant-dom.com.ua/api/stock_availables/9672">
	<id><![CDATA[9672]]></id>
	<id_product_attribute><![CDATA[4814]]></id_product_attribute>
	</stock_availables>
	<stock_availables xlink:href="http://garant-dom.com.ua/api/stock_availables/9673">
	<id><![CDATA[9673]]></id>
	<id_product_attribute><![CDATA[4815]]></id_product_attribute>
	</stock_availables>
	<stock_availables xlink:href="http://garant-dom.com.ua/api/stock_availables/9674">
	<id><![CDATA[9674]]></id>
	<id_product_attribute><![CDATA[4816]]></id_product_attribute>
	</stock_availables>
</stock_availables>
<accessories node_type="products"/>
<product_bundle node_type="products"/>
</associations>
</product>
</prestashop>
Edited by Artem (see edit history)
Link to comment
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
×
×
  • Create New...