Adding variant price to ATC button - Sense Theme

Topic summary

A user seeks to display variant or product prices directly within the Add to Cart button on Shopify’s Sense theme, sharing a screenshot example.

Solution Provided:
A PageFly expert offers JavaScript code to be inserted before the </body> tag in theme.liquid. The code dynamically adds the price to the ATC button and updates when variants change. Custom CSS styling is also possible via the added class.

Implementation Issues:

  • The solution works initially and receives positive feedback from multiple users
  • However, limitations emerge:
    • Price disappears from the button when the pricing block is hidden/removed
    • Requires double-clicking to update when variant prices differ
    • Hides entirely if the product price block is hidden

Current Status:
The basic functionality is confirmed working, but users request fixes for the edge cases involving hidden price blocks and variant price updates. No follow-up solutions have been provided yet for these specific issues.

Summarized with AI on November 15. AI used: claude-sonnet-4-5-20250929.

Hi all,

I was wondering how to include the variant (or product) price within the Add to Cart button in Sense theme. Example in the screenshot.

Screen Shot 2022-05-18 at 4.37.02 PM.png

1 Like

@csamer

can you please send store url

I’m Richard Nguyen - CRO Expert at PageFly- Free Landing Page Builder.

You can add my code as follows: theme → Edit > Search “theme.liquid”. Then paste the code before the tag:

You can also customize the css for the added content with the class "custom-content "

If you find my comment useful, please let me know by giving it a Like. Thank you!

Richard - PageFly

1 Like

It worked perfectly! Thank you @PageFly-Richard

Hi Richard,

Your code is definetly works BUT when I hide or remove Pricing block, it’s not shows the price on the ‘add to cart’ button.

I want to hide or remove it because I wanted to show the price just on the add to cart button.

Can you fix this too? Thanks.

I’ve been trying to figure this out for days now, and your solution work. Thank you so much!

Hi Richard, Can you advise if we can use this code to include the variant (or product) price within the Add to Cart button in Local theme.

This works, sort of :slightly_smiling_face:

It needs a double click to update the price if the variant prices are different.

It hides if the product price block is hidden :upside_down_face:

Any solutions? :crossed_fingers:

elin