What's your biggest current challenge? Have your say in Community Polls along the right column.

Replacing dynamic checkout buy buttons with book on request button

Replacing dynamic checkout buy buttons with book on request button

RupertWB
Visitor
1 0 0

OBJECTIVE: Not all of my products are instantly bookable and so for certain products I wish to have a primary call to action which is a 'Book on request' button which should either click to an enquiry form or open an email.

 

APPROACH: I understand (both from Shopify support & Chat GPT) that the way to do this is to:

 

1) Create a second product template (product.on-request.json)

2) Create a new section (or snippet) for the 'book on request' button  (product-on-request-button.liquid)

3) Customise the new template to remove the buy buttons and reference the 'book on request' section

4) Select the new template for the applicable products

 

PROBLEM: However when doing this (code below as advised by Shopify support) I get an 'Invalid JSON: unexpected token' error when saving the customisation to the template (step 3). One thing I do note is that the format/structure of the code for referencing the new section is entirely different to the way other sections are referenced in the file.

 

QUESTION: Is the problem here the approach or the code? Would anyone be able to review code below and advice how to correct?

 

Thanks in advance, Rupert

 

**************

 

CODE  (STEP 2, new section, product-on-request-button.liquid): 

 

<a href="mailto:name@company.com?subject=Request to book {{product.sku}}
{{ product.title }}&body=I'm interested in booking {{ product.sku }} with the following trip details:

Date Number of travellers Any specific options

." class="custom-email-button">Book on Request</a>

{% schema %}
{
"name": "product-on-request-button",
"settings": [],
"blocks": [
{
"type": "request_button",
"name": "Request Button",
"settings": []
}
]
}
{% endschema %}
{% stylesheet %}

{% endstylesheet %}

{% javascript %}

{% endjavascript %}

 

CODE: STEP 3 (New template, product.on-request.json)

 

{% section 'product-on-request-button' %},

 

TYPICAL CODE STRUCTURE TEMPLATE PAGE

 

"price": {
"type": "price",
"settings": {
}
},
"variant_picker": {
"type": "variant_picker",
"settings": {
"picker_type": "button"
}
},

Reply 1 (1)

Dwalker-BTA
Shopify Partner
26 1 2

Hi @RupertWB, with BookThatApp (https://apps.shopify.com/bookthatapp) you could allow some products to be booked instantly, and for the "Book on request" products, you could set the capacity to "0" and enable the "Waitlist" setting. This will allow your customers to sign up to be notified when the product is available. Another workaround is to use the "Deposit" feature (https://support.zetya.com/hc/en-us/articles/4514738224271-Deposits) to capture partial payments to reserve the booking. For bookings you wish to confirm, you would send the final invoice to the customer. Whereas, the bookings that you won't honor, you can refund the customer the deposit and delete the booking.