<?xml version="1.0" encoding="utf-8" ?>
<modification>
    
	<name>Hidden Shipping Adjustments</name>
    <code>hidden_shipping_adjustments</code>
	<version>v303.1</version>
	<author>Clear Thinking, LLC</author>
	<link>http://www.getclearthinking.com/contact?inquiry=Question regarding Hidden Shipping Adjustments: </link>
	
	<file path="catalog/*/{*,extension/*}/*.php">
		<operation error="skip">
			<search trim="true"><![CDATA[
				$quote = $this->{
			]]></search>
			<add position="before" trim="true"><![CDATA[
				// Clear Thinking: Hidden Shipping Adjustments
				$prefix = (version_compare(VERSION, '3.0', '<')) ? '' : 'module_';
				if ($this->config->get($prefix . 'hidden_shipping_adjustments_status')) {
					$this->session->data['hidden_shipping_adjustments'] = $result['code'];
				}
				// end
			]]></add>
		</operation>
		<operation error="skip">
			<search trim="true"><![CDATA[
				$quote = $this->{
			]]></search>
			<add position="after" trim="true"><![CDATA[
				// Clear Thinking: Hidden Shipping Adjustments
				$prefix = (version_compare(VERSION, '3.0', '<')) ? '' : 'module_';
				if ($this->config->get($prefix . 'hidden_shipping_adjustments_status')) {
					$this->load->model('extension/module/hidden_shipping_adjustments');
					if (!empty($quote['quote'])) {
						foreach ($quote['quote'] as $i => $q) {
							$quote['quote'][$i] = $this->model_extension_module_hidden_shipping_adjustments->adjust($q);
						}
					}
				}
				// end
			]]></add>
		</operation>
	</file>
	
	<file path="system/library/{cart,cart/cart}.php">
		<operation error="skip">
			<search trim="true"><![CDATA[
				public function __construct($registry) {
			]]></search>
			<add position="after" trim="true"><![CDATA[
				// Clear Thinking: Hidden Shipping Adjustments
				$this->registry = $registry;
				// end
			]]></add>
		</operation>
		<operation error="skip">
			<search trim="true"><![CDATA[
				return $weight;
			]]></search>
			<add position="before" trim="true"><![CDATA[
				// Clear Thinking: Hidden Shipping Adjustments
				$prefix = (version_compare(VERSION, '3.0', '<')) ? '' : 'module_';
				if ($this->config->get($prefix . 'hidden_shipping_adjustments_status')) {
					if (!class_exists('ModelExtensionModuleHiddenShippingAdjustments')) {
						include_once(DIR_APPLICATION . 'model/extension/module/hidden_shipping_adjustments.php');
					}
					$hidden_shipping_adjustments = new \ModelExtensionModuleHiddenShippingAdjustments($this->registry);
					$weight = $hidden_shipping_adjustments->adjust($weight);
				}
				// end
			]]></add>
		</operation>
	</file>
	
</modification>