Hi,
I am having some trouble with a code and I could really use some of your help!
On my Shopify website I have 6 different collection. One of the collections is called“Free Wallpaper” and I want customers to be able to download free wallpaper from there without having to go through a check out as the wallpaper is free.
I want there to be several different wallpapers and the customer can choose which one they want and click on the download button.
I uploaded the wallpapers as “Products” and tagged them as “downloadable” and put them on $0.00 and removed the “physical product.”
I used the Debutify version 4.8.0 and not the Dawn Theme. I followed a guide for the dawn theme thinking it wouldn’t be that different. The video says that in “section”there is a main-product.liquid file whoever I can’t find that one.
I can only find product-template.liquid in “Snippets” , product-template.liquid in “Sections" and product.json in Templates - which one do I need to choose?
I have tried these codes:
Here’s a summary of what we have tried so far to replace the “Add to Cart” button with a “Download” button for free wallpapers:
- Added a “downloadable” Tag:
- You added a tag called “downloadable” to the product in Shopify’s admin to help differentiate products that should have a download button instead of an “Add to Cart” button.1. Modify the Button Code Logic:
- If the product had the tag “downloadable,” it would show a download link instead of the “Add to Cart” button.
- We tried modifying the code in the relevant Liquid file to include a conditional check:
- Specifically, we used this condition: {%- if product.tags contains ‘downloadable’ -%} to determine which button should be displayed.1. Inserted a Download Button:
- For products with the “downloadable” tag, we inserted an tag linking to the file URL directly:
- This button would replace the original “Add to Cart” button when the condition was met.1. Code Debugging Attempts:
- To confirm if the conditional statement was being executed properly, we suggested adding visible indicators (
tags) to see which condition was being triggered on the storefront.1. Placement and File Corrections:
- We ensured that the conditional code was placed where the original “Add to Cart” button code was located.
- Made sure to edit the correct files, which are typically product-template.liquid in sections or snippets depending on the theme.1. Issues Encountered:
- Despite these changes, the “Add to Cart” button continued to display for the “downloadable” product
What am I doing wrong or missing?
![]()
Thank you!!