FROM CACHE - en_header

How to add some text (and hyperlink) above" add to cart" in product page (debut theme) ?

Noctis
Tourist
30 0 0

In debut theme the default product description area is below the "add to cart" button.
But I want to also add some text above the add to cart button. Also, I want to add a hyperlink, which is a photo pop up.

Please help

Replies 11 (11)
drakedev
Shopify Partner
622 133 184

In order to do that you need to modify the theme's code, in particular you need to focus on file product-template.liquid

Around line 212 you will find the code that display the buttons and you can add your code just before there.

           <div class="product-form__error-message-wrapper product-form__error-message-wrapper--hidden{% if section.settings.enable_payment_button %} product-form__error-message-wrapper--has-payment-button{% endif %}"
              data-error-message-wrapper
              role="alert">
              <span class="visually-hidden">{{ 'general.accessibility.error' | t }} </span>
              {% include 'icon-error' %}
              <span class="product-form__error-message" data-error-message>{{ 'products.product.quantity_minimum_message' | t }}</span>
            </div>

            {%- comment -%}
            After this comment you can add your custom code, and it will appear before the buttons
            {%- endcomment -%}

            <div class="product-form__controls-group product-form__controls-group--submit">
              <div class="product-form__item product-form__item--submit
                {%- if section.settings.enable_payment_button %} product-form__item--payment-button {%- endif -%}
                {%- if product.has_only_default_variant %} product-form__item--no-variants {%- endif -%}">

 

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.
Noctis
Tourist
30 0 0

what is the code to add text or hyperlink?

Have no idea...

thanks

Simranjeet
Shopify Partner
76 9 15

Hi Noctis, 

Can you share the page url and also clarify what type of text you would like to add ?

Thanks 

Simranjeet Singh

Noctis
Tourist
30 0 0

https://www.mercistore.co/collections/find-your-pawducts%E2%9D%A4/products/customizable-phone-cases

check it.

I want to add a line of text above add to cart, some text will be hyperlink to a photo pop up.

 

shwetart
Excursionist
14 0 5

Hi, 

I want to add about coupon code and free shipping above add to cart on product page. Can we do this?

Simranjeet
Shopify Partner
76 9 15

Hey @shwetart Yes, we can. Please share the store url.

shwetart
Excursionist
14 0 5
Simranjeet
Shopify Partner
76 9 15

@shwetart 

I looked into it and it would require me to access the theme files to built a dynamic section for it, so it would be easier for you to make changes in future. Would you mind if I send collaborator access to the store theme ? this would be free of charges though : )

 

shwetart
Excursionist
14 0 5
Simranjeet
Shopify Partner
76 9 15
shwetart
Excursionist
14 0 5

Thank u @Simranjeet .. for helping us. You have been very good at your work and given us exactly what we wanted Hope to work with you future.