In this tutorial, we will take you through how to add BookThatApp Booking Forms to the Simple theme. Before you start, we recommend you take a backup of your current theme.
⚠️ Note: If your theme has recently been updated, some steps may require adjustment. 💾.
Please note that the booking form are available on the Business plans and above. Please write in to our support team to assist with the implementation.
⚡ Note on Widgets
Widgets are our newest type of booking form. We highly recommend using a widget over a classic booking form.
Our booking forms are available in the app for Business or higher subscriptions. Besides requiring no coding changes and having a more modern look that flows better with the theme, widgets also have more settings and better app performance compared to classic forms.
Since widgets require no coding changes, you can easily have many different types of widgets in your store to handle all types of booking scenarios.
If you have not tried out a widget yet, please see the following:
Widgets Article 🔗
Step 1 – Choose Your Booking Form 🔍
- Login to BookThatApp
- Read our help desk article to determine which booking form is most applicable for your store.
- Write in to our support team for assistance.
- Once you have chosen a booking form, in the app admin, select Developer Guide ->Product Page. Please refer to our article how to choose the booking form if you need help with this step.
Step 2 – Add Booking Form to the Shopify Product Page 🛒
- In Shopify Admin, open your current theme.
- Open the product-template.liquid file under the Sections area of your Theme Editor.
- Paste
{% include 'booking-form' %}below the</select>element on line 101 as shown below.
- Click Save
Step 3 – Update the Cart Page 🛍️
- Continue with the instructions in the Admin -> Developer Guide -> Product Page. There is no need to add line item properties for this theme. However, we recommend disabling the quantity on the cart page as detailed here: Disabling Quantity on the Cart Pag
Step 4 - Updating the Email Templates
- Continue with the instructions in the BTA Admin -> Developer Guide -> Email notifications page.
Step 5 - Additional Code Changes
1. CSS Changes
We recommend adding CSS to the theme.scss.liquid file found in the Assets section. Below you will find an example on modifying it:
.booking-form {margin-bottom:20px}
.booking-form label {width:80px; margin-right: 5px;}
.booking-form input.bta.datepicker, .booking-form select.bta-time, .booking-form select.bta-load-enable {min-width:185px; margin-bottom:10px}2. Ajax Add to Cart
Ajax Add to Cart is not a supported feature and we recommend that you disable it in your theme settings. If you require us to troubleshoot this feature it will not fall under our no-charge support.
- Access the theme.js file in the Assets area of the Theme Editor. Copy the below section of code:
var btaForm = $('form[action="/cart/add"]').data('bta.bookingForm');
if (btaForm && !btaForm.isRequiredValid()) return;
- Paste it on line 563 as shown below:
560. $(".quickAdd").submit(function(e) {
561. e.preventDefault();
562.
563. var btaForm = $('form[action="/cart/add"]').data('bta.bookingForm');
564. if (btaForm && !btaForm.isRequiredValid()) return;
- Paste the same 2 lines of code on line 762 as shown below:
758. // Add to cart animation
759. $(".add-to-cart").click(function(e){
760. var elem = $(this);
761.
762. var btaForm = $('form[action="/cart/add"]').data('bta.bookingForm');
763. if (btaForm && !btaForm.isRequiredValid()) return;
3. Slide Down Cart
Please note that we recommend using the full page cart.
- To display the dates in the slide down cart after a product is added to the cart access the theme.js file. Copy the code shown below:
var lips = '';
for (p in cartItem.properties) {
lips += [p, cartItem.properties[p]].join(': ') + '<br>';
}
- Paste it on line 688 as shown below:
688.var lips = '';
689.for (p in cartItem.properties) {
690. lips += [p, cartItem.properties[p]].join(': ') + '<br>';
691.}
692.
693.drawer += '<div class="row '+first+'"><div class="nine columns description"><img src="'+cartItem.image+'" alt="'+cartItem.title+'"/><div class="info"><h3><a href="'+cartItem.url+'">'+cartItem.title+'</a></h3><h4>'+cartItem.vendor+'</h4><p>'+description+'</p><p>'+lips+'</p><p class="mobile">'+cartItem.quantity+' x '+formatMoney(cartItem.price)+'</p></div></div><div class="two columns price desktop">'+formatMoney(cartItem.price)+'</div><div class="two columns quantity desktop"><input type="text" name="updates[]" id="updates_'+cartItem.id+'" value="'+cartItem.quantity+'"/></div><div class="two columns total desktop">'+formatMoney(cartItem.line_price)+'</div><div class="one column remove desktop"><a href="/cart/change?line='+index+'&quantity=0" class="removeLine" rel="'+cartItem.variant_id+'">' + {{ 'cart.general.remove' | t | json }} + '</a></div></div>';
- To display the dates for existing products in the slide down cart copy the code shown below:
<p>
{% for p in item.properties %}
{% unless p.last == blank %}
{{ p.first }}:
{% if p.last contains '/uploads/' %}
<a class="lightbox" href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
{% else %}
{{ p.last }}
{% endif %}<br>
{% endunless %}
{% endfor %}
</p>
- Paste it on line 102 as shown below:
101. <p>{{ item.product.description | strip_html | truncatewords: 20 }}</p>
102. <p>
103. {% for p in item.properties %}
104. {% unless p.last == blank %}
105. {{ p.first }}:
106. {% if p.last contains '/uploads/' %}
107. <a class="lightbox" href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
108. {% else %}
109. {{ p.last }}
110. {% endif %}<br>
111. {% endunless %}
112. {% endfor %}
113. </p>
The app should now be successfully installed in the Simple theme. If you have any questions or the booking form is not appearing, please create a ticket and we'll be happy to help.
Comments
0 comments
Please sign in to leave a comment.