跳至内容
菜单
此问题已终结
5 回复
9320 查看

Hello

How can I change the order of variants displayed on a website page.

Say I sell hammers: 7cm, 12 cm and 18 cm

Currently the website item hammer offers them (as variants) 18cm first, then 7cm, then 12 cm

How can I change this order to be alphanumeric? I couldn't find a variant sequence number.

Thanks

形象
丢弃
最佳答案

In v.17, you can just change the order that the attributes are listed in (topmost is displayed first). Website -> eCommerce -> Attributes and then reorder the attributes. When a product has 2 or more of these attributes, it will display the image for a variant that matches the highest attribute first.

形象
丢弃
最佳答案

Sorting For Odoo v17/18:

The sequence value from older versions is now hidden, so older posts are confusing since they feature a sequence value.

In newer versions to sort product variants do this:
1) Go Sales > Settings > Product Attributes.
2) Select the Attribute
3) Drag the 6 dots (row) up/down and save.
4) [Optional] If there's pagination (1/40 of 150 eg).
5) Click the 1/40 and add a 0 behind => 1/400 of 150
6) This will open up all the variants and let you drag/drop all 150 of them.

Note:
The row order is how the selection of the attribute will be sorted (sales, website etc).




形象
丢弃
最佳答案

Hi, 

It took me a while but I found it under:

 Settings [Sales] -> Atributes [Product catalog/Variants]   -> Target Atribute -> Edit order by drag and dorp

形象
丢弃
最佳答案

This is an old question but I encountered it myself just now, and an answer that doesn't involve customisation might be useful for others. 

In V11 at least, you can rearrange the sequence of the 'Variant Values' list, which is found by clicking on the 'VARIANT PRICES' text button in the Product Template form.  Put the values in the order that you want the variants to display on your website by clicking on the four arrows icon and dragging them.  That's it!

形象
丢弃
最佳答案

You inherit model product.product and define new field "Sequence". Additionally change sort order in this model to:

_order = 'sequence,default_code,name_template'

and modify tree/form views to show new field.

形象
丢弃