# makecommerce/2.6.2/scripts/parcelmachine.js

MakeCommerce for WooCommerce, version 2.6.2. 21 lines.

- Page: https://pluginprobe.com/plugins/makecommerce/2.6.2/code/scripts/parcelmachine.js
- Raw: https://pluginprobe.com/plugins/makecommerce/2.6.2/raw/scripts/parcelmachine.js
- Modified: 2016-11-25T08:14:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/makecommerce/2.6.2/code/scripts/parcelmachine.js#L10-L20`.

```javascript
jQuery(function(){
	jQuery(document).on('updated_checkout', function(){
		jQuery(".parcel_machine_checkout").css('display', 'none');
		jQuery('.shipping_method:checked, .shipping_method[type=hidden]').each(function(){
			var method = jQuery(this).val(), display;
			if (method.indexOf(':') > -1) {
				var tmp = method.split(':');
				method = tmp[0];
			}
			jQuery(".parcel_machine_checkout_"+method).not(':first').remove();
			jQuery(".parcel_machine_checkout_"+method).css('display', 'table-row');
		});
		jQuery('.select-postmachine select').select2({
			formatResult: function(item) { 
				var texts = item.text.split(' - ', 2);
				return '<strong>'+texts[0]+'</strong>' + (texts[1] ? '<br/><small>'+texts[1]+'</small>' : '');
			}
		});
	});
});

```
