skip to Main Content

Is there an option to get customisation of one product in collection and apply the customisation to all the products that comes under the same collection?

For Example:

If we customised the product such as added a link, sorted sections or blocks, inserted a text section, etc… for the product “XXXX” that comes under category “Police”, can we apply the customisation to all the products that falls under same “Police” category?

2

Answers


  1. If I understand correctly, you want a section that will be global ( the same ) for each product.

    Well that’s what sections exactly do at the moment if you include them in your page.

    If you add a {% section 'product-template' %} and create all the necessary options they will be applied to each product that use the product template.

    Login or Signup to reply.
  2. In product-templet file you can check for collection Id/name and then
    update product UI as you wish.

    <div id="productId" class="{{product.id}}" style="display:hidden" >
    
     {% if collection.name == “Police” %}
    
      <div class="product-detail" itemscope itemtype="http://schema.org/Product">
       {% Here Your Customized UI to Show Products of Collection %}
          <div class="product-detail__title-and-price">
            <h1 class="product-title" itemprop="name">{{ product.title }}</h1>
    
            <div class="price-area emphasised">
              {% if variant.compare_at_price > variant.price %}
              <span class="was-price theme-money">{{ variant.compare_at_price | money }}</span>
              {% endif %}
              <span class="price theme-money">{{ variant.price | money }}</span>
            </div>
          </div>
        </div>
    
    {% endif %}
    
     <div class="product-detail" itemscope itemtype="http://schema.org/Product">
    {%Your Customized UI to Show Products of Collection %}
     </div>
    
    </div>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search