ro_multicol_product.p408884265 = {"id":408884265,"title":"Maxwell House Dark Roast Coffee","handle":"maxwell-house-dark-roast-coffee","description":"\u003cmeta charset=\"utf-8\"\u003e\r\n\u003cp\u003eTry it out! Select the \"Subscribe\" option below and use the following fake credit card info when you check out. \u003c\/p\u003e\r\n\u003cp\u003e\u003cstrong\u003e4242 4242 4242 4242 \u003c\/strong\u003e\u003cbr\u003e\u003cstrong\u003e11\/2017\u003c\/strong\u003e\u003cbr\u003e\u003cstrong\u003e123\u003c\/strong\u003e\u003c\/p\u003e\r\n\u003cp\u003eAfter you place the order check out the \"\u003ca href=\"https:\/\/recurring-order-live-demo.myshopify.com\/tools\/checkout\/front_end\/login\"\u003e\u003cstrong\u003eManage Subscriptions\u003c\/strong\u003e\u003c\/a\u003e\" to see how customers can manage their own subscriptions. You'll need to be signed in. To create an account \u003cstrong\u003e\u003ca href=\"http:\/\/recurring-order-live-demo.myshopify.com\/account\/register\"\u003eclick here.\u003c\/a\u003e\u003c\/strong\u003e\u003c\/p\u003e","published_at":"2015-02-05T11:44:00-05:00","created_at":"2015-02-05T11:44:04-05:00","vendor":"Maxwell House","type":"Coffee","tags":[],"price":1999,"price_min":1999,"price_max":1999,"available":true,"price_varies":false,"compare_at_price":null,"compare_at_price_min":0,"compare_at_price_max":0,"compare_at_price_varies":false,"variants":[{"id":1068242041,"title":"1lb Bag","option1":"1lb Bag","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Maxwell House Dark Roast Coffee - 1lb Bag","public_title":"1lb Bag","options":["1lb Bag"],"price":1999,"weight":0,"compare_at_price":null,"inventory_quantity":39,"inventory_management":"shopify","inventory_policy":"deny","barcode":"","requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/recurring-order-live-demo.myshopify.com\/cdn\/shop\/products\/Maxwell-House-Bag_d3307161-9382-4918-8ae0-7c7149dd3b6b.jpg?v=1423154645"],"featured_image":"\/\/recurring-order-live-demo.myshopify.com\/cdn\/shop\/products\/Maxwell-House-Bag_d3307161-9382-4918-8ae0-7c7149dd3b6b.jpg?v=1423154645","options":["Title"],"media":[{"alt":null,"id":17940643923,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"\/\/recurring-order-live-demo.myshopify.com\/cdn\/shop\/products\/Maxwell-House-Bag_d3307161-9382-4918-8ae0-7c7149dd3b6b.jpg?v=1423154645"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"\/\/recurring-order-live-demo.myshopify.com\/cdn\/shop\/products\/Maxwell-House-Bag_d3307161-9382-4918-8ae0-7c7149dd3b6b.jpg?v=1423154645","width":1500}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cmeta charset=\"utf-8\"\u003e\r\n\u003cp\u003eTry it out! Select the \"Subscribe\" option below and use the following fake credit card info when you check out. \u003c\/p\u003e\r\n\u003cp\u003e\u003cstrong\u003e4242 4242 4242 4242 \u003c\/strong\u003e\u003cbr\u003e\u003cstrong\u003e11\/2017\u003c\/strong\u003e\u003cbr\u003e\u003cstrong\u003e123\u003c\/strong\u003e\u003c\/p\u003e\r\n\u003cp\u003eAfter you place the order check out the \"\u003ca href=\"https:\/\/recurring-order-live-demo.myshopify.com\/tools\/checkout\/front_end\/login\"\u003e\u003cstrong\u003eManage Subscriptions\u003c\/strong\u003e\u003c\/a\u003e\" to see how customers can manage their own subscriptions. You'll need to be signed in. To create an account \u003cstrong\u003e\u003ca href=\"http:\/\/recurring-order-live-demo.myshopify.com\/account\/register\"\u003eclick here.\u003c\/a\u003e\u003c\/strong\u003e\u003c\/p\u003e"};
//variant update on swatch change
$('.single-option-selector').change(function(){
var $swatch_container = $(this).closest('.ro__swatches');
var $form = $(this).closest('form');
var option_values = [];
var checks_out = false;
var variant = null;
var product_id = $form.data('product-id');
//gather selected options
$swatch_container.find('.ro__radio-container').each(function(){
option_values.push($(this).find('[name=' + $(this).data('name') + ']:checked').val());
});
//find the matching variant
for(var x = 0; x < ro_multicol_product['p' + product_id].variants.length; x++){
checks_out = true;
for(var y = 0; y < option_values.length; y++){
if(option_values[y] != ro_multicol_product['p' + product_id].variants[x].options[y]){
checks_out = false;
break;
}
}
if(checks_out){
variant = ro_multicol_product['p' + product_id].variants[x];
break;
}
}
if(variant != null){
$form.find('[name=id], .variant_id').val(variant.id);
}
});
$('.single-option-selector').trigger('change');