第 105 期 广告投放之 同一产品系列 置顶不同商品 高效管理和使用产品系列
点击这里查看视频演示 本期 YouTube 链接(免登录观看 4K)
通过复制产品系列进行投放是一种不够高级的方式,随着时间的推移,可能导致店铺后台很多个产品系列,并且记不起哪个能删哪个不能删,对于客户而言也会很混乱。本期视频教你如果在同一个产品系列,置顶不同产品,而不需要额外复制产品系列。
Impulse 主题代码一键复制
其他主题,如需帮忙添加,点击这里
Symmetry 原主题代码
{% for product in collection.products %}
{% render 'product-block', product: product, custom_aspect_ratio: chosen_aspect_ratio, manual_image_load: manual_image_load, animate: true %}
{% endfor %}
修改后代码
{% assign handles = collection.sort_by | split: "," %}
{% if current_page == 1 %}
{% for handle in handles %}
{% assign topProduct = all_products[handle] %}
{% if topProduct != empty %}
{% render 'product-block', product: topProduct, custom_aspect_ratio: chosen_aspect_ratio, manual_image_load: manual_image_load, animate: true %}
{% endif %}
{% endfor %}
{% endif %}
{%- for product in collection.products -%}
{% if handles contains product.handle %}
{% continue %}
{% else %}
{% render 'product-block', product: product, custom_aspect_ratio: chosen_aspect_ratio, manual_image_load: manual_image_load, animate: true %}
{% endif %}
{% endfor %}
使用方法
?page=1&sort_by=product.handle 如果多个的话,用英文逗号分隔,不需要使用空格
💡
温馨提示:参考视频演示复制产品 handle,不要复制后面的变体数值
?variant=id
例如:
https://example.com/collections/sale/?page=1&sort_by=bike,ring,mattress