Update your Product Page to Shopify 2.0 - Just like Dawn

Did you try to update your theme to Shopify 2.0 but your product page does not look like what Theme Dawn has?

Updating Product Page into Dynamic blocks Like Dawn Theme Shopify 2.0

 

  1. Go to Shopify Online store> Themes > Actions > Edit code
  2. Go to section folder and locate product-template.liquid
  3. Add a for statement after the class=”grid_item”, like code below

           {% for blocks in section.blocks %}

  1. Add a case statement after the for statement, like code below

           {% case blocks.type %}

  1. In product-template.liquid, locate and add the when statement before each of the following
    1. Product title
    2. Product price
    3. Product form
    4. Product description
    5. Product social
  2. Add a when statement before the following
    1. Product title = product-single__title
    2. Product price = product__price
    3. Product form = form 'product'
    4. Product description = product-single__description
    5. Product social = include 'social-sharing
  3. Add a blocks in schema with the name and type of each blocks
     "blocks": [         

                            {

                               "name": "product title",

                               "type": "product_title",

                               "limit": 1

                                             },

                               {

                               "name": "product price",

                               "type": "product_ price ",

                               "limit": 1

                                             },

                               {

                               "name": "product form",

                               "type": "product_form",

                               "limit": 1

                                             },

                               {

                               "name": "product description",

                               "type": "product_description",

                               "limit": 1

                                             },

                               {

                               "name": "product social",

                               "type": "product_social",

                               "limit": 1

                                             }

                                ]

  1. Open template folder and locate product.lquid
  2. Copy the bottom code from product.liquid, except the {% section %} and comments
  3. Go to product-template.liquid and paste the code before the {% schema %}
  4. Delete the product.liquid file in template folder
  5. Go to templates folder and add a new template
  6. Create a new template for product with a template type JSON
  7. Since, we deleted the product.liquid, we can just click the “Create Template” and keep the name product as is
  8. Create the section type and add the product-recommendation in the section. Also the blocks
     

    {

      "sections": {

    “product_page”: {

    “type”: “product-template”,

    “blocks”: {

                  “title”: {

    “type”:  “product_title”

    },

    “price”: {

    “type”:  “product_price”

    },

    “form”: {

    “type”:  “product_form”

    },

    “description”: {

    “type”:  “product_description”

    },

    “social”: {

    “type”:  “product_social”

    },

    }

    },

                                             “block_order”: [“title”,”price”,”form”,”description”,”social”]

                                             “product_recommendations”: {

                                             “type”: “product-recommendations”

                                             }           

      "order": [“product_page”, “product_recommendations”]

    }

 

 

 (",) If you have questions, please free to contact us at "Chat with us"

Leave us a comment