Introduction:
This document outlines the steps required to change the default on PDP to one-time purchase.
This can be done by navigating to the theme's code files and commenting out a specific code in the smartrr-product.liquid file.
Prerequisites:
- Collaborative Access to the Shopify store theme files
Steps:
Step 1: To access the theme's code files, log in to the Shopify Admin panel and click on the Online Store option from the left navigation menu. From there, click on Themes and select the theme that needs to be updated. Click on Actions and select 'Edit Code'.
Step 2: Navigate to the smartrr-product.liquid file In the code editor, navigate to the snippets folder and find the smartrr-product.liquid file. Open the file in the editor.
Step 3: Locate the code to be commented out In the smartrr-product.liquid file, find the following line of code:
{% if foloop.index0 == 0 %} checked="checked"{% endif %}
This code sets the default option for the product as the first variant in the list. We need to comment out this code to change the default option to one-time purchase.
Step 4: Comment out the code. To comment out the code, simply add a pair of opening and closing comment tags ('{% comment %} ' and {% endcomment %} ) around the code that needs to be disabled. The updated code should look like this:
{% comment %}
{% if foloop.index0 == 0 %} checked="checked"{% endif %}
{% endcomment %}
Step 5: Save the changes. Once the code has been updated, save the changes made to the smartrr-product.liquid file by clicking on the 'Save' button.
Step 6: Preview the changes Preview the changes made by clicking on the 'Preview' button in the top right corner of the code editor. This will open a preview of the PDP (Product Detail Page) in a new tab, where you can verify that the default option has been changed to one-time purchase.
Conclusion: By following the above steps, you can update the default on PDP to one-time purchase.