Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customise bulk products on same collection in shopify theme

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?

like image 768
Senthil Vel Avatar asked Sep 13 '25 11:09

Senthil Vel


2 Answers

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.

like image 191
drip Avatar answered Sep 15 '25 08:09

drip


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>
like image 40
Nirmal Bajpai Avatar answered Sep 15 '25 10:09

Nirmal Bajpai