Subversion Repositories SmartDukaan

Rev

Rev 7376 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7376 Rev 7456
Line 78... Line 78...
78
	$('#store-address-header-text').html("&nbsp;Select a pickup point (<b>" + count + "</b> available)");
78
	$('#store-address-header-text').html("&nbsp;Select a pickup point (<b>" + count + "</b> available)");
79
};
79
};
80
 
80
 
81
$("#zone-selector").change(showSpecificStores);
81
$("#zone-selector").change(showSpecificStores);
82
 
82
 
83
changePickupType = function(pickupTypeContainer){
83
$(".unselected-tab").live('click', function() {
84
	$('div.deliveryopts > div').css("font-weight","normal");
-
 
85
	pickupTypeContainer.parent().css("font-weight","bold"); 
-
 
86
	var value = pickupTypeContainer.val();
84
	var tabToBeSelected = $(this).attr('id');
87
	var deliveryType = "In-Store Pickup";
85
	var deliveryType = "In-Store Pickup";
88
	if(value == 'myLocation') {
86
	if(tabToBeSelected == 'tab-left') {
89
		$('#inStoreLocationMsg').addClass('invisibleDiv');
87
		$('#inStoreLocationMsg').addClass('invisibleDiv');
-
 
88
		$("#tabSelector").val("myLocation");
90
		$('#tabSelectorForAddAddressForm').val('myLocation');
89
		$('#tabSelectorForAddAddressForm').val('myLocation');
91
		$('#newAddressFormHeading').text("Enter the address where you want the items to be delivered");
90
		$('#newAddressFormHeading').text("Enter the address where you want the items to be delivered");
92
		deliveryType = "Deliver to Address";
91
		deliveryType = "Deliver to Address";
93
	} else {
92
	} else {
94
		$('#inStoreLocationMsg').removeClass('invisibleDiv');
93
		$('#inStoreLocationMsg').removeClass('invisibleDiv');
-
 
94
		$("#tabSelector").val("HotSpot");
95
		$('#tabSelectorForAddAddressForm').val('HotSpot');
95
		$('#tabSelectorForAddAddressForm').val('HotSpot');
96
		$('#newAddressFormHeading').text("Enter the address which you want printed on the bill");
96
		$('#newAddressFormHeading').text("Enter the address which you want printed on the bill");
97
	}
97
	}
98
	var hiddenPane = $('#main-right-container').find('.hidden-div');
-
 
99
	$('#main-right-container').find('.not-hidden-div').addClass('hidden-div').removeClass('not-hidden-div');
-
 
100
	$(hiddenPane).removeClass('hidden-div').addClass('not-hidden-div');
-
 
101
	trackEventWithGA('DeliveryType', deliveryType);
98
	trackEventWithGA('DeliveryType', deliveryType);
102
};
-
 
103
 
-
 
104
$('div.deliveryopts > div').find('input').change(function(e){
99
	$(this).removeClass('unselected-tab').addClass('selected-tab');
105
	changePickupType($(this).parent());
-
 
106
});
-
 
107
 
-
 
108
$('div.deliveryopts > div').live('click', function() {
100
	$(this).siblings().removeClass('selected-tab').addClass('unselected-tab');
109
	var inputSelected = $(this).find('input');
101
	var hiddenPane = $(this).parent().siblings('.hidden-div');
110
	if(!inputSelected.is(":checked")){
102
	$(this).parent().siblings().addClass('hidden-div');
111
		inputSelected.attr("checked", true);
103
	$(hiddenPane).removeClass('hidden-div');
112
		changePickupType(inputSelected);
-
 
113
	}
-
 
114
});
104
});
115
 
105
 
116
$('.shipping-page-addresses .button-address-select').click(function(){
106
$('.shipping-page-addresses .button-address-select').click(function(){
117
	var addressId = $(this).attr('id').split('_')[1];
107
	var addressId = $(this).attr('id').split('_')[1];
118
	$('#formChangeAddressTo_' + addressId).submit();
108
	$('#formChangeAddressTo_' + addressId).submit();