Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3813 Widoki

Hello i'm working on a table like this

https://drive.google.com/open?id=1de_8vJPLPEA-C9v2AH4cB6ahHX_c-bfe

I'm using a module called "Website Variant Cart by webkul" but i've customized it to make it look like the img before

as you can see i have color variants in 1 colum but i need to set each of the color buttons to change the variant img in the product img as odoo works by default..

This is the code that i am using


<td id="colors-variant">
<t t-if="variant_id.attribute_value_ids" t-foreach="variant_id.attribute_value_ids" t-as="p_attribute_value">
<div>
<span>
<label t-attf-style="background-color:#{p_attribute_value.html_color}" t-attf-class="css_attribute_color #{'active' if first_possible_combination == p_attribute_value else ''}">
<input type="radio" name="attrib"/>
</label>
</span>

</div>
</t>
</td>


This works to render the color in my column but i need to click on it and change the variant img as odoo do it with the original function 

Awatar
Odrzuć
Autor

Thank you @Ravi Gadhia

I tried what you said, but i get this error *'product.product' object has no attribute 'attribute_id' *

i'm trying diferent things but i don't figure it out how to set it correctly

Najlepsza odpowiedź

you have to set all/required attributes on input radio element like in original code 
https://github.com/odoo/odoo/blob/12.0/addons/sale/views/sale_product_configurator_templates.xml#L295

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
paź 22
4848
0
lut 24
1050
2
cze 20
3522
1
lip 19
4142
3
maj 25
1145