A user running Dawn 12 theme needs help modifying custom code that displays estimated delivery dates on product pages. Current issue: The delivery date shows for all products, including sold-out items.
Goal: Display delivery dates only for in-stock products, with dynamic updates when customers select different variants.
Progress so far:
Initial code uses a custom Liquid block with JavaScript to calculate delivery dates (5-10 business days, excluding weekends)
One suggestion provided: wrap the code in {% if product.available %} tags
Problem with this solution: It’s static and doesn’t respond to variant changes
Remaining challenge: The code needs to dynamically show/hide delivery dates based on real-time variant availability as customers make selections.
Another user expressed interest in the same solution. The discussion remains open with no working solution yet.
Summarized with AI on November 11.
AI used: claude-sonnet-4-5-20250929.
I need help with a code issue on my product page. My product page shows an estimated delivery date, but it appears even for sold-out items. I want to display the date only for items that are in stock.
Can anyone guide me on how to modify this to work only for available products? Thanks!
I’m using Dawn 12 theme.
Here is the code that I added in a custom liquid block on my product page:
Thanks Lee, The code you provided works but it’s static, doesn’t reacts to the change of variant.
I want the estimated delivery date to dynamically update or disappear based on the availability of the selected variant. If the new variant is in stock, the delivery date should update to reflect this variant’s delivery timeline. If the variant is out of stock or unavailable, the delivery date should not be displayed at all.