type:
snippet
category:
shipping
name:
Adding handling fees for each shipment with multiship.
reference:
http://forum.foxycart.com/comments.php?DiscussionID=4111&page=2
tags:
snippets, shipping, advance
date:
2011-05-27

Adding handling fees for each shipment with multiship.

function check_for_messages() {
	jQuery('.sendmessage').each(function() {
 
		//figure out the multiship from the name attribute of input.sendmessage
		$multiship_array = jQuery(this).attr("name").split("_");
 
		//assign that value to $multiship_name
		$multiship_name = $multiship_array[2];
 
		if (jQuery(this).attr('checked')) {
 
			//change handling fee for proper multishipHandlingFees[]
			FC.checkout.config.multishipHandlingFees[$multiship_name] = (parseInt(FC.checkout.config.multishipHandlingFees[$multiship_name]) + .48);
		} else {
			FC.checkout.config.multishipHandlingFees[$multiship_name] = 0;
		}
	});
 
	//update the shipping
	for (var i=0; i<FC.checkout.config.multishipDetails.length; i++) {
		FC.checkout.updateShipping(i);
	}
}

Site Tools