Hi @technase
This has to be done by using meta fields. You can follow this process to create the meta fields and update the code.
Create product meta field
Step 1: Go to Settings > Custom data > Products
Step 2: Create “Add definition”
Step 3: Create a definition named “Free digital product”. The type should be set to “File”
Step 4: Save the meta field
Code changes:
If you are using latest version of the dawn theme you can replace the file “buy-buttons.liquid” with below codes:
Note: Please take backup of your original files before making any changes to them.
{% comment %}
Renders product buy-buttons.
Accepts:
- product: {Object} product object.
- block: {Object} passing the block information.
- product_form_id: {String} product form id.
- section_id: {String} id of section to which this snippet belongs.
- show_pickup_availability: {Boolean} for the pickup availability. If true the pickup availability is rendered, false - not rendered (optional).
Usage:
{% render 'buy-buttons', block: block, product: product, product_form_id: product_form_id, section_id: section.id, show_pickup_availability: true %}
{% endcomment %}
{%- if product != blank -%}
{%- liquid
assign gift_card_recipient_feature_active = false
if block.settings.show_gift_card_recipient and product.gift_card?
assign gift_card_recipient_feature_active = true
endif
assign show_dynamic_checkout = false
if block.settings.show_dynamic_checkout and gift_card_recipient_feature_active == false
assign show_dynamic_checkout = true
endif
-%}
{%- else -%}
{%- endif -%}
{%- if show_pickup_availability -%}
{{ 'component-pickup-availability.css' | asset_url | stylesheet_tag }}
{%- assign pick_up_availabilities = product.selected_or_first_available_variant.store_availabilities
| where: 'pick_up_enabled', true
-%}
{%- endif -%}
If you are using any old version of dawn theme, you can provide me the buy-buttons.liquid codes and i will write the updated code.
After making all the chanegs, you can go to the respective proucts and add the free download files. All the products that has this file will show the download link.
If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
Makka