How can I enable/disable related products on the product page?

Enable/disable related products on the cart page by doing the following steps:

1. Go to Online store->Themes->Modular theme

2. Click "Actions"

3. Click "Edit code"

4. Search for the "Sections" folder

5. Open the "product-template.liquid" file

6. On line 9 add the following block of code 

{% assign showRel = section.settings.showRel %}

Before

After

7. On around line 136 and before the for loop add the following block of code 

{% if showRel %}

    On around line 140 and before the section element add the following block of code

{% if collection.products_count > 1 %}

Before

After

8. Add the following block of code to the lines 210 & 212 before and after the end of the for loop

{% endif %}

Before

After

9. On line 277 add the following block of code before the {% endschema %}

,{ "type": "header", "content": "Related products" }, { "type": "checkbox", "id": "showRel", "label": "Show related products", "default": true }

Before

After

Note: Don't forget the commas!

10. Click "Save"

11. In your theme's editor click on the "Product pages" from the dropdown menu or click on a random product

12. Click  "Product pages"

13. You can enable/disable related products through the "Show related products" checkbox