This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To show a return date based on duration make the following changes in the booking-form snippet. | |
1. Add data-bta-update-finish-date="true" to the datepicker: | |
<div> | |
{% capture attribute %}booking-start{% endcapture %} | |
<label for="{{ attribute }}-{{ product.handle }}">Rental Date</label> | |
<input id="{{ attribute }}-{{ product.handle }}" type="text" name="properties[Date]" size="12" | |
class="datepicker bta required bta-load-enable bta-dp-start bta-highlight-duration" disabled="disabled" | |
data-handle="{{ product.handle }}" data-variant="{{ product.selected_or_first_available_variant.id }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
BookThatApp auto installed snippet. Changes made to this file will be lost if installed again. | |
{% endcomment %} | |
{% if product.tags contains 'Booking Party' %} | |
<label for="booking-party">Number of Participants</label> | |
<div class="selector-wrapper"> | |
<select id="booking-party" name="properties[booking-party]"> | |
{% for n in (1..30) %} | |
<option>{{ n }}</option> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
BookThatApp auto installed snippet. Changes made to this file will be lost if installed again. | |
{% endcomment %} | |
{% if product.metafields.bookthatapp.config %} | |
{% unless bta_configured %} | |
<div class="booking-form clearfix"> | |
<div class="selector-wrapper"> | |
{% capture attribute %}booking-start{% endcapture %} | |
<label for="{{ attribute }}">From:</label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('form[action*="/cart/add"]').submit(function(e) { | |
var btaForm = $(this).data('bta.bookingForm'); | |
if ((typeof(btaForm) != "undefined") && !btaForm.isValid()) { | |
e.stopImmediatePropagation(); // prevents BTA's default form submit handler which also checks for validity | |
return false; | |
} | |
// regular Ajax submit from here... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="span9"> | |
<h1>Art Class Calendar</h1> | |
<hr /> | |
<em>Sign up for adult classes by clicking the painting on the calendar you would like to come paint.</em> | |
<div id="bta-calendar"></div> | |
</div> | |
<script src="{{ shop.bookthatapp }}/fullcalendar/fullcalendar.js" type="text/javascript"></script> | |
<script src="{{ shop.bookthatapp }}/javascripts/xdate.js" type="text/javascript"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% unless settings.shipping_calculator == 'Disabled' %} | |
<div id="shipping-calculator-container" class="clearfix"> | |
<div id="shipping-calculator" class="fl"> | |
<h3>{{ settings.shipping_calculator_heading }}</h3> | |
<div> | |
<p> | |
<label for="address_country">Country</label> | |
<select id="address_country" name="address[country]" data-default="{% if shop.customer_accounts_enabled and customer %}{{ customer.default_address.country }}{% elsif settings.shipping_calculator_default_country != '' %}{{ settings.shipping_calculator_default_country }}{% endif %}">{{ country_option_tags }}</select> | |
</p> | |
<p id="address_province_container" style="display:none;"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Create a linklist called Deposit and link it to your deposit product | |
{% endcomment %} | |
{% assign deposit_linklist = linklists.deposit.links %} | |
{% if deposit_linklist.size > 0 and deposit_linklist.first.type == 'product_link' %} | |
{% assign deposit_id = deposit_linklist.first.object.variants.first.id %} | |
{% assign deposit_count = 0 %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Events Calendar</h3> | |
{% if products.size > 1 %} | |
<p> | |
<label for="bta-product-select">Product</label> | |
<select id="bta-product-select"> | |
<option value="">All products</option> | |
{% for product in products %} | |
<option value="{{ product.handle }}">{{ product.title }}</option> | |
{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input id="{{ attribute }}-{{ product.handle }}" type="text" name="properties[{{ attribute }}]" size="12" class="datepicker bta required bta-load-enable" data-handle="{{ product.handle }}" data-variant="{{ product.variants.first.id}}" data-bta-product-config="{{ product.metafields.bookthatapp.config }}" data-bta-variant-config="{% for variant in product.variants %}{{ variant.id }}:{{ variant.metafields.bookthatapp.config }}{% unless forloop.last %},{% endunless %}{% endfor %}" disabled="disabled" data-startonly="true" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% capture bta_url %}{{ shop.permanent_domain | split: '.' | first }}.bookthatapp.com{% endcapture %} | |
{% assign product_ids = "" %}{% for product in collections.events.products %}{% capture product_ids %}{{ product_ids }}{% unless forloop.first %},{% endunless %}{{ product.id }}{% endcapture %}{% endfor %} | |
<script src="//{{ bta_url }}/fullcalendar2/lib/moment.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
var today = moment(), | |
btacal = { | |
load: function() { | |
if ($('#events').length == 0) return; | |