Shopify Theme: Weekend

Widget Update: We are very excited to have recently upgraded our subscription widget to v3. However, this may not work for your store. If you're having difficulty following this guide, please contact us with details.

The weekend theme uses AJAX to add to cart. By default, it doesn't read the line item properties.

Go to init.js.liquid starting from line 115

    $('.add').on('click', function(e) {
		e.preventDefault();
		var quantity = $(this).closest('form').find('input.quantity').val(), 
      		productID = $(this).closest('form').find('*[name=id]').val();
        /* BEGIN RECHARGE MODIFICATIONS */
        data = {
          "quantity": $(this).closest('form').find('input.quantity').val(),
          "id": $(this).closest('form').find('*[name=id]').val(),
        }      
      if($(this).closest('form').find("[name='properties[subscription_id]']").val() != undefined){
       	data['properties[subscription_id]'] =  $(this).closest('form').find("[name='properties[subscription_id]']").val();
      }
      if($(this).closest('form').find("[name='properties[shipping_interval_frequency]']").val() != undefined){
       	data['properties[shipping_interval_frequency]'] =  $(this).closest('form').find("[name='properties[shipping_interval_frequency]']").val();
      }      
		addItem(data);
      	/* END RECHARGE MODIFICATIONS */
	});
    $('.quantity').on('keyup', function(){
      if($(this).val()<0){
        alert('Value must be greater than 0');
        $(this).val('0');
      }
    });
    // When Add to Cart is clicked
    var addItem = function(data) {
      $.ajax({
        type: 'POST',
        url: '/cart/add.js',
        dataType: 'json',
        data: data,
        success: addToCartOkay,
        error: addToCartFail
      });
    }

Still stuck? How can we help? Still stuck? How can we help?