/ /
  • Choose a date above to see available times.

Line Up

From: $20.00

/ /
  • Choose a date above to see available times.

<script type=”text/javascript”>
jQuery(document).ready(function($) {
$(‘.single_add_to_cart_button’).click(function(e) {
e.preventDefault();

var button = $(this);
var form = button.closest(‘form’); // Find the closest form to the button
var product_id = form.find(‘input[name=”add-to-cart”]’).val(); // Get the product ID from the hidden input
var quantity = form.find(‘input[name=”quantity”]’).val() || 1; // Get the quantity or default to 1

// Determine if the product is a booking product by checking for booking-specific fields
var isBookingProduct = form.find(‘#wc-bookings-form-start-time’).length > 0; // Adjust selector as needed

// Determine if the product is a subscription product
var isSubscriptionProduct = form.find(‘.subscription-details’).length > 0; // Adjust selector for subscription product

// Function to handle successful add to cart and open the cart menu
function openCartMenu() {
// Open the Elementor cart menu
var cartMenu = $(‘.elementor-menu-cart__toggle_button’);
if (cartMenu.length) {
cartMenu.trigger(‘click’); // Trigger click event to open the cart
} else {
alert(‘Cart menu element not found.’);
}
}

// Function to add product to the cart
function addToCart(data) {
$.ajax({
type: ‘POST’,
url: wc_add_to_cart_params.wc_ajax_url.replace(‘%%endpoint%%’, ‘add_to_cart’),
data: data,
beforeSend: function() {
button.prop(‘disabled’, true); // Disable button to prevent multiple clicks
},
success: function(response) {
if (response && response.error) {
alert(response.error);
} else if (response && response.fragments) {
openCartMenu(); // Open cart menu after adding to cart
} else {
alert(‘There was an issue adding the product to the cart.’);
}
},
complete: function() {
button.prop(‘disabled’, false); // Re-enable button
},
error: function() {
alert(‘There was an issue adding the product to the cart.’);
}
});
}

// Handle adding to cart for different product types
if (isBookingProduct || isSubscriptionProduct) {
// Serialize the form data for booking or subscription product
var formData = form.serialize() + ‘&add-to-cart=’ + product_id + ‘&quantity=’ + quantity;
addToCart(formData);
} else {
// For simple products, add directly to the cart using product ID and quantity
var simpleProductData = {
product_id: product_id,
quantity: quantity
};
addToCart(simpleProductData);
}
});
});
</script>

Loading...
0
No products in the cart.

SPIN TO WIN!

  • 1 year free membership
  • 3 months free membership
  • 1 month free trial
Try Your Luck
Never
Remind later
No thanks