iparcel_carthandoff - Version 1.6.0

Version Notes

Notes

Download this release

Release Info

Developer Bobby Burden
Extension iparcel_carthandoff
Version 1.6.0
Comparing to
See all releases


Code changes from version 1.5.0 to 1.6.0

app/code/community/Iparcel/All/Helper/Api.php CHANGED
@@ -521,6 +521,12 @@ class Iparcel_All_Helper_Api
521
  $price = $this->_getProductAttribute($product, 'price');
522
  }
523
 
 
 
 
 
 
 
524
  $item['CountryOfOrigin'] = (string)$product->getCountryOfManufacture();
525
  $item['CurrentPrice'] = (float)$price;
526
  $item['Delete'] = $product->getIsDeleted() ? true : false;
@@ -556,6 +562,12 @@ class Iparcel_All_Helper_Api
556
 
557
  // Detect and handle a Simple Product with Custom Options
558
  if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE && $product->getHasOptions()) {
 
 
 
 
 
 
559
  // loop through each of the sorted products with custom options
560
  // and build out custom option and option type based skus
561
  foreach ($this->_findSimpleProductVariants($product) as $customOptionProduct) {
@@ -577,15 +589,24 @@ class Iparcel_All_Helper_Api
577
  $item['ProductName'] = $name . $customOptionName;
578
  $items['SKUs'][] = $item;
579
  }
 
580
  } else {
581
  $items['SKUs'][] = $item;
582
  }
583
-
584
  }
585
 
586
  return $items;
587
  }
588
 
 
 
 
 
 
 
 
 
 
589
  /**
590
  * Performs the work of handling Simple Products with Custom Options
591
  *
@@ -741,6 +762,12 @@ class Iparcel_All_Helper_Api
741
  $result[] = $allOptionals;
742
  }
743
 
 
 
 
 
 
 
744
  return $result;
745
  }
746
 
@@ -835,6 +862,12 @@ class Iparcel_All_Helper_Api
835
  $itemPrice = (float)$this->_getProductAttribute($itemProduct, 'price');
836
  }
837
 
 
 
 
 
 
 
838
  $lineItem = array();
839
  $lineItem['SKU'] = $item->getSku();
840
  $lineItem['ValueUSD'] = $itemPrice;
521
  $price = $this->_getProductAttribute($product, 'price');
522
  }
523
 
524
+ // If all attempts to gather a price based on configuration fail,
525
+ // call getPrice() on the product
526
+ if (!$price) {
527
+ $price = $product->getPrice();
528
+ }
529
+
530
  $item['CountryOfOrigin'] = (string)$product->getCountryOfManufacture();
531
  $item['CurrentPrice'] = (float)$price;
532
  $item['Delete'] = $product->getIsDeleted() ? true : false;
562
 
563
  // Detect and handle a Simple Product with Custom Options
564
  if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE && $product->getHasOptions()) {
565
+ if(get_class($product->getOptionInstance()) == 'MageWorx_CustomOptions_Model_Catalog_Product_Option') {
566
+ if($this->_productHasDropdownOption($product)) {
567
+ $items['SKUs'][] = $item;
568
+ }
569
+ }
570
+
571
  // loop through each of the sorted products with custom options
572
  // and build out custom option and option type based skus
573
  foreach ($this->_findSimpleProductVariants($product) as $customOptionProduct) {
589
  $item['ProductName'] = $name . $customOptionName;
590
  $items['SKUs'][] = $item;
591
  }
592
+
593
  } else {
594
  $items['SKUs'][] = $item;
595
  }
 
596
  }
597
 
598
  return $items;
599
  }
600
 
601
+ protected function _productHasDropdownOption($product) {
602
+ foreach($product->getOptions() as $option) {
603
+ if($option->getType() == 'drop_down') {
604
+ return true;
605
+ }
606
+ }
607
+ return false;
608
+ }
609
+
610
  /**
611
  * Performs the work of handling Simple Products with Custom Options
612
  *
762
  $result[] = $allOptionals;
763
  }
764
 
765
+ // Make sure that the first element of the result array is an empty
766
+ // array. This will cause the "base" SKU to be sent as a catalog item.
767
+ if ($result[0] != array()) {
768
+ array_unshift($result, array());
769
+ }
770
+
771
  return $result;
772
  }
773
 
862
  $itemPrice = (float)$this->_getProductAttribute($itemProduct, 'price');
863
  }
864
 
865
+ // If all attempts to gather a price based on configuration fail,
866
+ // call getPrice() on the product
867
+ if (!$itemPrice) {
868
+ $itemPrice = $itemProduct->getPrice();
869
+ }
870
+
871
  $lineItem = array();
872
  $lineItem['SKU'] = $item->getSku();
873
  $lineItem['ValueUSD'] = $itemPrice;
app/code/community/Iparcel/All/Model/Carrier/Iparcel.php CHANGED
@@ -30,6 +30,15 @@ class Iparcel_All_Model_Carrier_Iparcel extends Iparcel_All_Model_Carrier_Abstra
30
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
31
  {
32
  try {
 
 
 
 
 
 
 
 
 
33
  /** @var boolean $internationalOrder */
34
  $internationalOrder = Mage::helper('iparcel')->getIsInternational($request);
35
  if ($internationalOrder && Mage::getStoreConfig('carriers/iparcel/active')) {
@@ -123,4 +132,59 @@ class Iparcel_All_Model_Carrier_Iparcel extends Iparcel_All_Model_Carrier_Abstra
123
  {
124
  return $this->getMethodsNames();
125
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  }
30
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
31
  {
32
  try {
33
+
34
+ // If this is being used with CartHandoff, we don't return methods
35
+ // for orders with Amazon or PayPal payments
36
+ if (Mage::helper('iparcel')->isCartHandoffInstalled()
37
+ && ($this->_isAmazonPayments() || $this->_isPayPalPayment())
38
+ ) {
39
+ return false;
40
+ }
41
+
42
  /** @var boolean $internationalOrder */
43
  $internationalOrder = Mage::helper('iparcel')->getIsInternational($request);
44
  if ($internationalOrder && Mage::getStoreConfig('carriers/iparcel/active')) {
132
  {
133
  return $this->getMethodsNames();
134
  }
135
+
136
+ /**
137
+ * Determines if the checkout session is an Amazon Payments session
138
+ *
139
+ * @return boolean
140
+ */
141
+ private function _isAmazonPayments()
142
+ {
143
+ return $this->_paymentMethodContains('amazon');
144
+ }
145
+
146
+ /**
147
+ * Determines if the checkout session is a PayPal payment
148
+ *
149
+ * @return boolean
150
+ */
151
+ private function _isPayPalPayment()
152
+ {
153
+ return $this->_paymentMethodContains('paypal');
154
+ }
155
+
156
+ /**
157
+ * Check if string exists in payment method name
158
+ *
159
+ * @param string Payment Method name to search for
160
+ * @return boolean
161
+ */
162
+ private function _paymentMethodContains($string)
163
+ {
164
+ $paymentMethod = $this->_getPaymentMethod();
165
+
166
+ if (strpos($paymentMethod, $string) !== false) {
167
+ return true;
168
+ }
169
+
170
+ return false;
171
+ }
172
+
173
+ /**
174
+ * Finds the payment method of the current checkout session
175
+ *
176
+ * @return string
177
+ */
178
+ private function _getPaymentMethod()
179
+ {
180
+ if (is_null($this->_paymentMethod)) {
181
+ $checkoutSession = Mage::getSingleton('checkout/session');
182
+ $this->_paymentMethod = $checkoutSession
183
+ ->getQuote()
184
+ ->getPayment()
185
+ ->getMethod();
186
+ }
187
+
188
+ return $this->_paymentMethod;
189
+ }
190
  }
app/code/community/Iparcel/All/Model/Quote/Address/.DS_Store ADDED
Binary file
app/code/community/Iparcel/All/Model/Quote/Address/Total/Tax.php CHANGED
@@ -25,6 +25,11 @@ class Iparcel_All_Model_Quote_Address_Total_Tax extends Iparcel_All_Model_Quote_
25
  return;
26
  }
27
 
 
 
 
 
 
28
  if ($this->isIparcelShipping($address) &&
29
  (Mage::helper('iparcel')->getDisplayTaxAndDutyCumulatively()
30
  || Mage::helper('iparcel')->getDisplayTaxAndDutySeparately())) {
25
  return;
26
  }
27
 
28
+ // Make sure that we are not working on a quote with no items
29
+ if ($address->getQuote()->hasItems() == false) {
30
+ return;
31
+ }
32
+
33
  if ($this->isIparcelShipping($address) &&
34
  (Mage::helper('iparcel')->getDisplayTaxAndDutyCumulatively()
35
  || Mage::helper('iparcel')->getDisplayTaxAndDutySeparately())) {
app/code/community/Iparcel/All/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Iparcel_All>
5
- <version>1.2.1</version>
6
  </Iparcel_All>
7
  </modules>
8
  <frontend>
@@ -57,6 +57,9 @@
57
  <log>
58
  <table>iparcel_all_log</table>
59
  </log>
 
 
 
60
  </entities>
61
  </iparcel_resource>
62
  <sales>
2
  <config>
3
  <modules>
4
  <Iparcel_All>
5
+ <version>1.3.0</version>
6
  </Iparcel_All>
7
  </modules>
8
  <frontend>
57
  <log>
58
  <table>iparcel_all_log</table>
59
  </log>
60
+ <tracking_number>
61
+ <table>iparcel_all_tracking_number</table>
62
+ </tracking_number>
63
  </entities>
64
  </iparcel_resource>
65
  <sales>
app/code/community/Iparcel/All/sql/iparcel_setup/mysql4-upgrade-1.2.1-1.3.0.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+ // Create a table to store tracking_number -> order relationship
7
+ $installer->run("
8
+ DROP TABLE IF EXISTS {$this->getTable('iparcel/tracking_number')};
9
+ CREATE TABLE {$this->getTable('iparcel/tracking_number')} (
10
+ `id` int(11) unsigned NOT NULL auto_increment,
11
+ `tracking_number` varchar(255) NOT NULL,
12
+ `order_id` int(11) NOT NULL,
13
+ PRIMARY KEY (`id`)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
+ ");
16
+
17
+ $installer->endSetup();
app/code/community/Iparcel/CartHandoff/Helper/Api.php CHANGED
@@ -20,6 +20,9 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
20
  /** @var string URL for CheckItems API Method */
21
  protected $_checkItems = 'https://webservices.i-parcel.com/api/CheckItems';
22
 
 
 
 
23
  /**
24
  * Sets up customer's checkout information in UPS i-parcel
25
  *
@@ -100,6 +103,10 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
100
  $returnUrl = $helper->getReturnUrl();
101
  }
102
 
 
 
 
 
103
  // Set currency from iparcelSession cookie
104
  $iparcelSession = json_decode(
105
  Mage::getModel('core/cookie')->get('ipar_iparcelSession')
@@ -118,7 +125,7 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
118
  'prepaidamount' => 0,
119
  'reference_number' => $quote->getId(),
120
  'return' => $returnUrl,
121
- 'shopping_url' => Mage::getBaseUrl(),
122
  'cancel_return' => $cancelUrl,
123
  'image_url' => Mage::getDesign()->getSkinUrl(
124
  Mage::getStoreConfig('design/header/logo_src')
@@ -168,6 +175,7 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
168
 
169
  if ($parentItem) {
170
  $price = $parentItem->getCalculationPrice();
 
171
  }
172
  if (is_null($price)) {
173
  $price = $item->getProduct()->getPrice();
@@ -207,11 +215,9 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
207
  * Retrieves checkout details from UPS i-parcel API
208
  *
209
  * @param string $transactionId Transaction ID returned by the API
210
- * @param object $session User's Magento session
211
- * @param bool $createOrder Create's Magento order if true (default)
212
- * @return object On success, contains Magento's order; on error, a a status message
213
  */
214
- public function getCheckoutDetails($transactionId, $session, $createOrder = true)
215
  {
216
  // Make request to API
217
  $request = array(
@@ -239,68 +245,18 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
239
  return (object) $return;
240
  }
241
 
242
- if ($createOrder) {
243
- try {
244
- // Make sure the order doesn't exist before attempting
245
- // to build a new order
246
- $order = Mage::helper('ipcarthandoff')
247
- ->loadOrderByTrackingNumber($response->trackingnumber);
248
-
249
- if ($order == false) {
250
- $order = $this->_buildOrder($session->getQuote(), $response);
251
- }
252
- } catch (Exception $e) {
253
- Mage::logException($e);
254
- $return = array (
255
- 'status' => 0,
256
- 'message' => 'An error occurred when processing your order.'
257
- );
258
- return (object) $return;
259
- }
260
-
261
- $return = array(
262
- 'status' => 1,
263
- 'order' => $order
264
- );
265
- } else {
266
- $return = array(
267
- 'status' => 1,
268
- 'GetCheckoutDetails' => $response
269
- );
270
- }
271
-
272
- return (object) $return;
273
  }
274
 
275
  /**
276
- * Cancels payment for the transaction ID
277
  *
278
  * @param string $tx Transaction ID to cancel
279
  * @return bool Returns true on success
280
  */
281
  public function cancelPayment($tx)
282
  {
283
- $request = array(
284
- 'key' => Mage::helper('iparcel')->getGuid(),
285
- 'tx' => $tx
286
- );
287
-
288
- $response = $this->_restJSON($request, $this->_cancelPayment);
289
-
290
- // Log request and response
291
- Mage::getModel('iparcel/log')
292
- ->setController('CancelPayment')
293
- ->setRequest(json_encode($request))
294
- ->setResponse($response)
295
- ->save();
296
-
297
- $response = json_decode($response);
298
-
299
- if ($response->status == 'OK') {
300
- return true;
301
- }
302
-
303
- return false;
304
  }
305
 
306
  /**
@@ -585,12 +541,25 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
585
  * @param object $response API Response
586
  * @param Mage_Sales_Model_Order Created order
587
  */
588
- private function _buildOrder($quote, $response)
589
  {
590
 
591
  Mage::register('iparcel_skip_auto_create_shipment', true);
592
  Mage::register('iparcel_skip_auto_submit', true);
593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  // Clear quote address
595
  $quote->removeAllAddresses()->save();
596
 
@@ -622,6 +591,7 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
622
  ->setCountryId($billingCountry->getId())
623
  ->setRegionId($billingRegion->getId())
624
  ->setTelephone($response->day_phone_b)
 
625
  ->save();
626
 
627
  $responseShipping = $response->AddressInfo->Shipping;
@@ -654,10 +624,16 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
654
  ->setTelephone($response->day_phone_b)
655
  ->setShippingMethod('iparcel_' . $response->servicelevel)
656
  ->setShippingAmount($response->shipping_cost)
 
657
  ->save();
658
 
659
  // Setup payment details
660
- $quote->getPayment()->addData(array('method' => 'iparcel'));
 
 
 
 
 
661
  $quote->save();
662
  $quote->reserveOrderId();
663
 
@@ -691,6 +667,7 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
691
  $convert = Mage::getModel('sales/convert_quote');
692
 
693
  $order = $convert->toOrder($quote);
 
694
  $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
695
  $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
696
  $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
20
  /** @var string URL for CheckItems API Method */
21
  protected $_checkItems = 'https://webservices.i-parcel.com/api/CheckItems';
22
 
23
+ /** @var int Code used when throwing Invalid Quote exception */
24
+ protected $_invalidQuoteCode = 10;
25
+
26
  /**
27
  * Sets up customer's checkout information in UPS i-parcel
28
  *
103
  $returnUrl = $helper->getReturnUrl();
104
  }
105
 
106
+ $shoppingUrl = Mage::getBaseUrl() . Mage::getStoreConfig(
107
+ 'payment/ipcarthandoff/back_to_shopping'
108
+ );
109
+
110
  // Set currency from iparcelSession cookie
111
  $iparcelSession = json_decode(
112
  Mage::getModel('core/cookie')->get('ipar_iparcelSession')
125
  'prepaidamount' => 0,
126
  'reference_number' => $quote->getId(),
127
  'return' => $returnUrl,
128
+ 'shopping_url' => $shoppingUrl,
129
  'cancel_return' => $cancelUrl,
130
  'image_url' => Mage::getDesign()->getSkinUrl(
131
  Mage::getStoreConfig('design/header/logo_src')
175
 
176
  if ($parentItem) {
177
  $price = $parentItem->getCalculationPrice();
178
+ $qty = $parentItem->getTotalQty();
179
  }
180
  if (is_null($price)) {
181
  $price = $item->getProduct()->getPrice();
215
  * Retrieves checkout details from UPS i-parcel API
216
  *
217
  * @param string $transactionId Transaction ID returned by the API
218
+ * @return object On success, contains API response; on error, a a status message
 
 
219
  */
220
+ public function getCheckoutDetails($transactionId)
221
  {
222
  // Make request to API
223
  $request = array(
245
  return (object) $return;
246
  }
247
 
248
+ return (object) $response;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  }
250
 
251
  /**
252
+ * Cancels payment for the transaction ID -- no longer used
253
  *
254
  * @param string $tx Transaction ID to cancel
255
  * @return bool Returns true on success
256
  */
257
  public function cancelPayment($tx)
258
  {
259
+ return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  }
261
 
262
  /**
541
  * @param object $response API Response
542
  * @param Mage_Sales_Model_Order Created order
543
  */
544
+ public function buildOrder($quote, $response)
545
  {
546
 
547
  Mage::register('iparcel_skip_auto_create_shipment', true);
548
  Mage::register('iparcel_skip_auto_submit', true);
549
 
550
+ /**
551
+ * Make sure the quote is active, and is an ipcarthandoff order
552
+ */
553
+ if (!$quote->getIsActive()
554
+ || $quote->getPayment()->getMethod() != Mage::helper('ipcarthandoff')->getPaymentMethodCode()
555
+ ) {
556
+ throw new Exception(
557
+ "Invalid quote for Cart Handoff review.",
558
+ $this->_invalidQuoteCode
559
+ );
560
+ return;
561
+ }
562
+
563
  // Clear quote address
564
  $quote->removeAllAddresses()->save();
565
 
591
  ->setCountryId($billingCountry->getId())
592
  ->setRegionId($billingRegion->getId())
593
  ->setTelephone($response->day_phone_b)
594
+ ->setEmail($responseBilling->email)
595
  ->save();
596
 
597
  $responseShipping = $response->AddressInfo->Shipping;
624
  ->setTelephone($response->day_phone_b)
625
  ->setShippingMethod('iparcel_' . $response->servicelevel)
626
  ->setShippingAmount($response->shipping_cost)
627
+ ->setEmail($responseShipping->shipping_email)
628
  ->save();
629
 
630
  // Setup payment details
631
+ $quote->getPayment()->addData(
632
+ array(
633
+ 'method' => Mage::helper('ipcarthandoff')->getPaymentMethodCode()
634
+ )
635
+ );
636
+
637
  $quote->save();
638
  $quote->reserveOrderId();
639
 
667
  $convert = Mage::getModel('sales/convert_quote');
668
 
669
  $order = $convert->toOrder($quote);
670
+
671
  $order->setPayment($convert->paymentToOrderPayment($quote->getPayment()));
672
  $order->setBillingAddress($convert->addressToOrderAddress($quote->getBillingAddress()));
673
  $order->setShippingAddress($convert->addressToOrderAddress($quote->getShippingAddress()));
app/code/community/Iparcel/CartHandoff/Helper/Data.php CHANGED
@@ -103,4 +103,20 @@ class Iparcel_CartHandoff_Helper_Data extends Mage_Core_Helper_Abstract
103
 
104
  return $status;
105
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
103
 
104
  return $status;
105
  }
106
+
107
+ /**
108
+ * Returns the payment method code for Cart Handoff
109
+ *
110
+ * @return string
111
+ */
112
+ public function getPaymentMethodCode()
113
+ {
114
+ $paymentModel = Mage::getModel('ipcarthandoff/payment_ipcarthandoff');
115
+
116
+ if (is_null($paymentModel)) {
117
+ return "";
118
+ }
119
+
120
+ return $paymentModel->getCode();
121
+ }
122
  }
app/code/community/Iparcel/CartHandoff/Model/Checkout/Type/Onepage.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Overrides Onepage to make sure CartHandoff is used for applicable orders
4
+ *
5
+ * @category Iparcel
6
+ * @package Iparcel_CartHandoff
7
+ * @author Bobby Burden <bburden@i-parcel.com>
8
+ */
9
+ class Iparcel_CartHandoff_Model_Checkout_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
10
+ {
11
+ /**
12
+ * If this is a CartHandoff order, make sure we set our payment method
13
+ *
14
+ * @param array $data
15
+ * @return array
16
+ */
17
+ public function savePayment($data)
18
+ {
19
+ $quote = $this->getQuote();
20
+ $paymentModel = Mage::getModel('ipcarthandoff/payment_ipcarthandoff');
21
+
22
+ if ($paymentModel->canUseCheckout()) {
23
+ $data['method'] = $paymentModel->getCode();
24
+ Mage::register('storecredit_apply_carthandoff', true);
25
+ }
26
+
27
+ return parent::savePayment($data);
28
+ }
29
+ }
app/code/community/Iparcel/CartHandoff/Model/Observer/Storecredit.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Provides support for AheadWorks StoreCredit extension
4
+ *
5
+ * @category Iparcel
6
+ * @package Iparcel_CartHandoff
7
+ * @author Bobby Burden <bburden@i-parcel.com>
8
+ */
9
+ if (@class_exists('AW_Storecredit_Model_Observer_Storecredit')) {
10
+ class Iparcel_CartHandoff_Model_Observer_Storecredit_Parent extends AW_Storecredit_Model_Observer_Storecredit {}
11
+ } else {
12
+ class Iparcel_CartHandoff_Model_Observer_Storecredit_Parent {}
13
+ }
14
+
15
+ class Iparcel_CartHandoff_Model_Observer_Storecredit extends Iparcel_CartHandoff_Model_Observer_Storecredit_Parent
16
+ {
17
+ public function paymentDataImport(Varien_Event_Observer $observer)
18
+ {
19
+ parent::paymentDataImport($observer);
20
+
21
+ $input = $observer->getEvent()->getInput();
22
+ $payment = $observer->getEvent()->getPayment();
23
+
24
+ if (Mage::registry('storecredit_apply_carthandoff') == true) {
25
+ $paymentModel = Mage::getModel('ipcarthandoff/payment_ipcarthandoff');
26
+ $input->setMethod($paymentModel->getCode());
27
+ $payment->setMethod($paymentModel->getCode());
28
+ }
29
+ }
30
+ }
app/code/community/Iparcel/CartHandoff/Model/Payment/Free.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Model to prevent "Zero Subtotal Checkout" on i-parcel orders
4
+ *
5
+ * @category Iparcel
6
+ * @package Iparcel_CartHandoff
7
+ * @author Bobby Burden <bburden@i-parcel.com>
8
+ */
9
+ class Iparcel_CartHandoff_Model_Payment_Free extends Mage_Payment_Model_Method_Free
10
+ {
11
+ /**
12
+ * Add an additional check if this is an i-parcel order
13
+ *
14
+ * @return bool
15
+ */
16
+ public function isAvailable($quote = null)
17
+ {
18
+ $paymentModel = Mage::getModel('ipcarthandoff/payment_ipcarthandoff');
19
+
20
+ if ($quote && $paymentModel->canUseCheckout()) {
21
+ return false;
22
+ }
23
+
24
+ return parent::isAvailable($quote);
25
+ }
26
+ }
app/code/community/Iparcel/CartHandoff/Model/Payment/Ipcarthandoff.php CHANGED
@@ -87,6 +87,11 @@ class Iparcel_CartHandoff_Model_Payment_Ipcarthandoff extends Iparcel_All_Model_
87
  return true;
88
  }
89
 
 
 
 
 
 
90
  /**
91
  * Creates a paid invoice for the Magento order
92
  *
87
  return true;
88
  }
89
 
90
+ public function isAvailable($quote = null)
91
+ {
92
+ return $this->canUseCheckout();
93
+ }
94
+
95
  /**
96
  * Creates a paid invoice for the Magento order
97
  *
app/code/community/Iparcel/CartHandoff/controllers/HandoffController.php CHANGED
@@ -137,15 +137,23 @@ class Iparcel_CartHandoff_HandoffController extends Mage_Core_Controller_Front_A
137
  );
138
 
139
  // Handle error status
140
- if ($checkoutDetailsResponse->status == 0) {
 
 
141
  $this->_session->addError($checkoutDetailsResponse->message);
142
- $this->_cancelPayment($transactionId);
143
  $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
144
  return;
 
 
145
  }
146
 
147
- $this->_prepareSuccessPage($checkoutDetailsResponse);
148
  $this->loadLayout();
 
 
 
 
 
149
  $this->renderLayout();
150
 
151
  return;
@@ -160,34 +168,31 @@ class Iparcel_CartHandoff_HandoffController extends Mage_Core_Controller_Front_A
160
  $transactionId = $this->getRequest()->getParam('tx');
161
  $apiHelper = Mage::helper('ipcarthandoff/api');
162
 
163
- /**
164
- * Make sure the quote is active, the customer matches the quote,
165
- * and the payment method is 'ipcarthandoff'
166
- */
167
- if (!$this->_quote->getIsActive()
168
- || $this->_quote->getPayment()->getMethod() != 'ipcarthandoff'
169
- ) {
170
- $this->_session->addError("Invalid quote for Cart Handoff review.");
171
- $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
172
- return;
173
- }
174
-
175
  $checkoutDetailsResponse = $apiHelper->getCheckoutDetails(
176
  $transactionId,
177
  $this->_session
178
  );
179
 
180
  // Handle error status
181
- if ($checkoutDetailsResponse->status == 0) {
 
 
182
  $this->_session->addError($checkoutDetailsResponse->message);
183
- $this->_cancelPayment($transactionId);
184
  $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
185
  return;
 
 
186
  }
187
 
 
188
  // Show the order review page
189
- $this->_prepareSuccessPage($checkoutDetailsResponse);
190
  $this->loadLayout();
 
 
 
 
 
191
  $this->renderLayout();
192
  }
193
 
@@ -210,17 +215,18 @@ class Iparcel_CartHandoff_HandoffController extends Mage_Core_Controller_Front_A
210
  /**
211
  * Prepares the session to display the success page
212
  *
213
- * @param array $checkoutDetailsResponse
214
  */
215
- private function _prepareSuccessPage($checkoutDetailsResponse)
216
  {
217
- $order = $checkoutDetailsResponse->order;
218
- $order = Mage::getModel('sales/order')->loadByIncrementId($order->getIncrementId());
219
  $this->_session->setQuoteId($order->getQuoteId());
 
220
  $this->_session->setLastSuccessQuoteId($order->getQuoteId());
221
  $this->_session->getQuote()->setIsActive(false)->save();
222
  $this->_session->setOrder($order);
223
  $this->_session->setLastOrderId($order->getId());
 
 
224
  }
225
 
226
  /**
@@ -242,4 +248,105 @@ class Iparcel_CartHandoff_HandoffController extends Mage_Core_Controller_Front_A
242
 
243
  return true;
244
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  }
137
  );
138
 
139
  // Handle error status
140
+ if ($checkoutDetailsResponse->status == 'FAILED'
141
+ || property_exists($checkoutDetailsResponse, 'status') == false
142
+ ) {
143
  $this->_session->addError($checkoutDetailsResponse->message);
 
144
  $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
145
  return;
146
+ } else {
147
+ $order = $this->_buildOrder($checkoutDetailsResponse, $this->_session);
148
  }
149
 
150
+ $this->_prepareSuccessPage($order);
151
  $this->loadLayout();
152
+ Mage::dispatchEvent('checkout_onepage_controller_success_action',
153
+ array(
154
+ 'order_ids' => $this->_orderIds
155
+ )
156
+ );
157
  $this->renderLayout();
158
 
159
  return;
168
  $transactionId = $this->getRequest()->getParam('tx');
169
  $apiHelper = Mage::helper('ipcarthandoff/api');
170
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  $checkoutDetailsResponse = $apiHelper->getCheckoutDetails(
172
  $transactionId,
173
  $this->_session
174
  );
175
 
176
  // Handle error status
177
+ if ($checkoutDetailsResponse->status == 'FAILED'
178
+ || property_exists($checkoutDetailsResponse, 'status') == false
179
+ ) {
180
  $this->_session->addError($checkoutDetailsResponse->message);
 
181
  $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
182
  return;
183
+ } else {
184
+ $order = $this->_buildOrder($checkoutDetailsResponse, $this->_session);
185
  }
186
 
187
+
188
  // Show the order review page
189
+ $this->_prepareSuccessPage($order);
190
  $this->loadLayout();
191
+ Mage::dispatchEvent('checkout_onepage_controller_success_action',
192
+ array(
193
+ 'order_ids' => $this->_orderIds
194
+ )
195
+ );
196
  $this->renderLayout();
197
  }
198
 
215
  /**
216
  * Prepares the session to display the success page
217
  *
218
+ * @param object $order
219
  */
220
+ private function _prepareSuccessPage($order)
221
  {
 
 
222
  $this->_session->setQuoteId($order->getQuoteId());
223
+ $this->_session->setLastQuoteId($order->getQuoteId());
224
  $this->_session->setLastSuccessQuoteId($order->getQuoteId());
225
  $this->_session->getQuote()->setIsActive(false)->save();
226
  $this->_session->setOrder($order);
227
  $this->_session->setLastOrderId($order->getId());
228
+
229
+ $this->_orderIds = array($order->getId());
230
  }
231
 
232
  /**
248
 
249
  return true;
250
  }
251
+
252
+ /**
253
+ * Builds order based on response from GetCheckoutDetails API
254
+ *
255
+ * @param object $response Response from the API
256
+ * @param object $session User's session
257
+ * @return mixed Order is returned on success. Error string on failure
258
+ */
259
+ private function _buildOrder($response, $session)
260
+ {
261
+ // Pull the quote ID from the response. Apply it to the current session
262
+ $quoteId = $response->reference_number;
263
+ $quote = Mage::getModel('sales/quote')->load($quoteId);
264
+ $session = $session->replaceQuote($quote);
265
+
266
+ try {
267
+ // Make sure the order doesn't exist before attempting
268
+ // to build a new order
269
+ $order = Mage::helper('ipcarthandoff')
270
+ ->loadOrderByTrackingNumber($response->trackingnumber);
271
+
272
+ if ($order == false) {
273
+ $order = Mage::helper('ipcarthandoff/api')->buildOrder(
274
+ $session->getQuote(), $response
275
+ );
276
+ }
277
+ } catch (Exception $e) {
278
+ Mage::logException($e);
279
+ // This catches any excpetions thrown during order creation.
280
+
281
+ $order = $this->_loadAndVerify($response, $quote);
282
+
283
+ if ($order == false) {
284
+ /**
285
+ * If the Magento order cannot be created, or was created incorrectly,
286
+ * attempt to load the order and cancel it if it exists.
287
+ */
288
+ $order = Mage::getModel('sales/order');
289
+ $order->loadByAttribute('quote_id', $quote->getId());
290
+
291
+ if ($order->getId() != null) {
292
+ $order->cancel();
293
+ }
294
+
295
+ // Should only hit this point if there is no way to recover from
296
+ // errors during order creation
297
+ return $e->getMessage();
298
+ }
299
+ }
300
+
301
+ return $order;
302
+ }
303
+
304
+ /**
305
+ * Load and Verify an order from GetCheckoutDetails response
306
+ *
307
+ * @param object $response Response from the API
308
+ * @param object $quote Magento quote
309
+ * @return mixed Order object or false
310
+ */
311
+ private function _loadAndVerify($response, $quote)
312
+ {
313
+ // Load the order based on the quote ID
314
+ $quoteId = $quote->getId();
315
+ $order = Mage::getModel('sales/order');
316
+
317
+ // Attempt to load the order based on the quote ID
318
+ try {
319
+ $order->loadByAttribute('quote_id', $quoteId);
320
+ } catch (Exception $e) {
321
+ Mage::logException($e);
322
+ return false;
323
+ }
324
+
325
+ // Find the grand total of the order in the response
326
+ $responseGrandTotal = 0;
327
+ foreach ($response->ItemDetailsList as $item) {
328
+ $responseGrandTotal += $item->amount;
329
+ }
330
+
331
+ $responseGrandTotal = $responseGrandTotal
332
+ + $response->shipping_cost
333
+ + $response->duty
334
+ + $response->tax;
335
+ $responseGrandTotal -= $response->discount_amount_cart;
336
+
337
+ // Verify that the order totals match the information in the response.
338
+ $grandTotalsMatch = $order->getBaseGrandTotal() == $responseGrandTotal;
339
+ $shippingTotalsMatch = $order->getBaseShippingAmount() == $response->shipping_cost;
340
+ $taxTotalsMatch = $order->getBaseTaxAmount() == $response->tax;
341
+
342
+ // Return the order if totals match
343
+ if ($grandTotalsMatch
344
+ && $shippingTotalsMatch
345
+ && $taxTotalsMatch
346
+ ) {
347
+ return $order;
348
+ }
349
+
350
+ return false;
351
+ }
352
  }
app/code/community/Iparcel/CartHandoff/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Iparcel_CartHandoff>
5
- <version>1.5.0</version>
6
  </Iparcel_CartHandoff>
7
  </modules>
8
  <global>
@@ -31,6 +31,21 @@
31
  <layer>Iparcel_CartHandoff_Model_Catalog_Layer</layer>
32
  </rewrite>
33
  </catalog>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </models>
35
  <helpers>
36
  <ipcarthandoff>
2
  <config>
3
  <modules>
4
  <Iparcel_CartHandoff>
5
+ <version>1.6.0</version>
6
  </Iparcel_CartHandoff>
7
  </modules>
8
  <global>
31
  <layer>Iparcel_CartHandoff_Model_Catalog_Layer</layer>
32
  </rewrite>
33
  </catalog>
34
+ <payment>
35
+ <rewrite>
36
+ <method_free>Iparcel_CartHandoff_Model_Payment_Free</method_free>
37
+ </rewrite>
38
+ </payment>
39
+ <checkout>
40
+ <rewrite>
41
+ <type_onepage>Iparcel_CartHandoff_Model_Checkout_Type_Onepage</type_onepage>
42
+ </rewrite>
43
+ </checkout>
44
+ <aw_storecredit>
45
+ <rewrite>
46
+ <observer_storecredit>Iparcel_CartHandoff_Model_Observer_Storecredit</observer_storecredit>
47
+ </rewrite>
48
+ </aw_storecredit>
49
  </models>
50
  <helpers>
51
  <ipcarthandoff>
app/code/community/Iparcel/CartHandoff/etc/system.xml CHANGED
@@ -115,13 +115,22 @@
115
  </order_status>
116
  <sort_order>
117
  <label>Sort Order</label>
118
- <tooltip>Sort Order as a payment method.</tooltip>
119
  <frontend_type>text</frontend_type>
120
  <sort_order>30</sort_order>
121
  <show_in_default>1</show_in_default>
122
  <show_in_website>1</show_in_website>
123
  <show_in_store>1</show_in_store>
124
  </sort_order>
 
 
 
 
 
 
 
 
 
125
  </fields>
126
  </ipcarthandoff>
127
  </groups>
115
  </order_status>
116
  <sort_order>
117
  <label>Sort Order</label>
118
+ <tooltip>Sort Order for the payment method.</tooltip>
119
  <frontend_type>text</frontend_type>
120
  <sort_order>30</sort_order>
121
  <show_in_default>1</show_in_default>
122
  <show_in_website>1</show_in_website>
123
  <show_in_store>1</show_in_store>
124
  </sort_order>
125
+ <back_to_shopping>
126
+ <label>Back To Shopping link</label>
127
+ <tooltip>This string will be appended to the end of the site's BaseURL, and be linked to from the UPS i-parcel payment page. This is blank by default.</tooltip>
128
+ <frontend_type>text</frontend_type>
129
+ <sort_order>31</sort_order>
130
+ <show_in_default>1</show_in_default>
131
+ <show_in_website>1</show_in_website>
132
+ <show_in_store>1</show_in_store>
133
+ </back_to_shopping>
134
  </fields>
135
  </ipcarthandoff>
136
  </groups>
js/iparcel/lib.js CHANGED
@@ -1,45 +1,46 @@
1
  var iparcelMage = {
2
- displayEligibility: function(){
3
- try{
4
- $_ipar.fn.iparcel.ux.displayEligibility();
5
- }catch(exception){}
6
- },
7
- ajax: {
8
- post: function(sku, super_attribute, url) {
9
- var $jip = jQuery.noConflict();
10
- var data = super_attribute+'sku='+sku;
11
- $jip('.iparcelsku').attr('finalsku', 'false');
12
- $jip.ajax({
13
- 'url': url,
14
- 'data': data,
15
- type: 'POST',
16
- async: true,
17
- success: function(data){
18
- if (data){
19
- $jip('.iparcelsku').text(data.sku);
20
- $jip('.iparcelsku').attr('finalsku', 'true');
21
-
22
- iparcelPost.setStock('true');
23
 
24
- var $options = $jip('.iparceloptions');
25
- $options.empty();
26
- $jip.each(data.attributes, function(key, value){
27
- var $block = $jip('<div/>');
28
- $block.attr('id',key);
29
- $block.text(value);
30
- $options.append($block);
31
- });
32
 
33
- $jip('.iparcelstockquantity').text(data.stock);
34
- }
35
- iparcelMage.displayEligibility();
36
- }
 
 
 
37
  });
 
 
 
 
38
  }
39
- },
40
- parseHtmlEntities: function(str){
41
- var textArea = document.createElement('textarea');
42
- textArea.innerHTML = str;
43
- return textArea.value;
44
  }
 
 
 
 
 
 
45
  }
1
  var iparcelMage = {
2
+ displayEligibility: function() {
3
+ try{
4
+ $_ipar.fn.iparcel.ux.displayEligibility();
5
+ } catch(exception) {
6
+ }
7
+ },
8
+ ajax: {
9
+ post: function(sku, super_attribute, url) {
10
+ var $jip = jQuery.noConflict();
11
+ var data = super_attribute+'sku='+sku;
12
+ $jip('.' + iparcelPost.iparcelSkuClass).attr('finalsku', 'false');
13
+ $jip.ajax({
14
+ 'url': url,
15
+ 'data': data,
16
+ type: 'POST',
17
+ async: true,
18
+ success: function(data){
19
+ if (data){
20
+ $jip('.' + iparcelPost.iparcelSkuClass).text(data.sku);
21
+ $jip('.' + iparcelPost.iparcelSkuClass).attr('finalsku', 'true');
 
22
 
23
+ iparcelPost.setStock('true');
 
 
 
 
 
 
 
24
 
25
+ var $options = $jip('.' + iparcelPost.iparcelOptionsClass);
26
+ $options.empty();
27
+ $jip.each(data.attributes, function(key, value){
28
+ var $block = $jip('<div/>');
29
+ $block.attr('id',key);
30
+ $block.text(value);
31
+ $options.append($block);
32
  });
33
+
34
+ $jip('.iparcelstockquantity').text(data.stock);
35
+ }
36
+ iparcelMage.displayEligibility();
37
  }
38
+ });
 
 
 
 
39
  }
40
+ },
41
+ parseHtmlEntities: function(str){
42
+ var textArea = document.createElement('textarea');
43
+ textArea.innerHTML = str;
44
+ return textArea.value;
45
+ }
46
  }
js/iparcel/post.js CHANGED
@@ -4,60 +4,98 @@ var iparcelPost = {
4
  url: null,
5
  sku_list_cache: null,
6
  stock_list_cache: null,
7
- textSelectors: '.product-custom-option[type="text"], textarea.product-custom-option',
8
- clear: function () {
9
- $jip('.iparcelsku,.iparcelstock').remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  },
11
- single: function(sku, url){
12
- this.sku = sku;
 
 
13
  if (url.indexOf(':') == 0) {
14
  url = url.substring(1,url.length);
15
  }
16
- this.url = url+'iparcel/ajax/configurable';
 
 
17
  $jip(document).ready(function(){
18
  var $sku = $jip("<div/>");
19
- $sku.css("display","none");
20
- $sku.attr("class","iparcelsku");
21
  $sku.text(sku);
22
- $jip('form#product_addtocart_form').append($sku);
23
 
24
  var $options = $jip("<div/>");
25
- $options.css("display","none");
26
- $options.attr("class","iparceloptions");
27
- $jip('form#product_addtocart_form').append($options);
28
 
29
- $jip('.super-attribute-select').change(function(){
30
  iparcelPost.updateSelect();
31
  });
32
 
33
  // if there are '.super-attribute-select' elements, find the SKU
34
  // for the default configuration
35
- if ($jip('.super-attribute-select.required-entry').length > 0) {
36
- $jip('.super-attribute-select.required-entry').each(function() {
37
- this.validOptions = [];
38
-
39
- var self = this;
40
- $jip(this).children().each(function(){
41
- if ($jip(this).val() != '') {
42
- self.validOptions.push($jip(this).val());
43
  }
44
  });
45
 
46
- if (this.validOptions.length == 1) {
47
- // Only one valid option for this required select
48
- $jip(this).val(this.validOptions[0]);
49
  }
50
  });
 
51
  iparcelPost.updateSelect();
52
  }
 
53
  // Watch for custom option text fields, areas
54
- $jip(iparcelPost.textSelectors).change(function() {
55
  iparcelPost.updateTextfields();
56
  });
57
 
58
  var $iterator = 0;
 
 
59
  $jip(document).bind('DOMNodeInserted', function(e){
60
- if ($jip(e.target).attr('class') == 'swatch-link'){
61
  $jip(e.target).click(iparcelPost.update);
62
  if ($iterator++ == 0){
63
  var target = e.target;
@@ -70,87 +108,105 @@ var iparcelPost = {
70
  }
71
  });
72
 
73
- $jip('.swatch-link').click(iparcelPost.update);
74
  });
75
  },
 
76
  update: function(){
77
  var $this = $jip(this);
78
  var id = $this.parent().attr('id').split('option')[1];
79
  var val = $this.attr('id').split('swatch')[1];
80
  var super_attribute = '';
81
- $jip('.super-attribute-select').each(function(){
 
82
  var $this = $jip(this);
83
  if ($this.attr('name') != 'super_attribute['+id+']'){
84
- super_attribute+=$this.attr('name')+'='+$this.val()+'&';
85
  }
86
  });
87
- iparcelMage.ajax.post(iparcelPost.sku,super_attribute,iparcelPost.url);
 
88
  },
 
89
  updateSelect: function () {
90
  iparcelPost.setStock('false');
91
  var $this = $jip(this);
92
  var super_attribute = '';
93
- $jip('.super-attribute-select, .product-custom-option').each(function () {
 
94
  var $this = $jip(this);
95
  super_attribute += $this.attr('name') + '=' + $this.val() + '&';
96
  });
 
97
  iparcelMage.ajax.post(iparcelPost.sku, super_attribute, iparcelPost.url);
98
  },
 
99
  updateTextfields: function() {
100
  iparcelPost.setStock('false');
101
  var custom_options = '';
102
- $jip(iparcelPost.textSelectors).each(function() {
 
103
  var $this = $jip(this);
104
  custom_options += $this.attr('name') + '=' + $this.val() + '&';
105
  });
 
106
  iparcelMage.ajax.post(iparcelPost.sku, custom_options, iparcelPost.url);
107
  },
 
108
  stock: function(qty){
109
- $jip(document).ready(function(){
110
  var $stock = $jip("<div/>");
111
- $stock.css("display","none");
112
- $stock.attr("class","iparcelstock");
113
  $stock.text(qty > 0 ? 'true' : 'false');
114
- $jip('form#product_addtocart_form').append($stock);
115
  });
116
  },
 
117
  setStock: function(value){
118
- $jip('.iparcelstock').text(value);
119
  },
 
120
  sku_list: function (sku_list) {
121
- this.sku_list_cache = sku_list;
122
- $jip(document).ready(function(){
 
123
  $jip.each(sku_list, function(sku,name){
124
  name = iparcelMage.parseHtmlEntities(name);
125
  var $sku = $jip("<div/>");
126
- $sku.css("display","none");
127
- $sku.attr("class","iparcelsku");
128
  $sku.text(sku);
129
  iparcelPost.append($sku,name);
130
  });
131
  });
132
- $jip(document).ajaxSuccess(function(data){
 
133
  iparcelPost.sku_list(sku_list);
134
  });
135
  },
 
136
  stock_list: function(stock_list){
137
  this.stock_list_cache = stock_list;
138
- $jip(document).ready(function(){
 
139
  $jip.each(stock_list, function(name,qty){
140
  name = iparcelMage.parseHtmlEntities(name);
141
  var $stock = $jip("<div/>");
142
- $stock.css("display","none");
143
- $stock.attr("class","iparcelstock");
144
  $stock.text(qty > 0 ? 'true' : 'false');
145
  iparcelPost.append($stock,name);
146
  });
147
  });
148
  },
 
149
  append: function(item,name){
150
- var $item = $jip('.item .product-name a').filter(function () {
151
  return $jip(this).text() == name;
152
  });
153
- $item.closest('.item').append(item);
 
154
  }
155
  };
156
 
@@ -158,12 +214,12 @@ Ajax.Responders.register({
158
  onComplete: function(args){
159
  iparcelPost.sku_list(iparcelPost.sku_list_cache);
160
  iparcelPost.stock_list(iparcelPost.stock_list_cache);
161
- if( typeof iparcel.session !== "undefined" ) {
162
- if( typeof iparcel.session.content !== "undefined" ) {
163
- if( typeof iparcel.session.content.locale !== "undefined" && iparcel.session.content.locale == "US" ) {
 
164
  $_ipar(iparcel.settings.productListingPriceElement).css("visibility","visible");
165
- }
166
- else{
167
  iparcel.ux.displayEligibility();
168
  }
169
  }
4
  url: null,
5
  sku_list_cache: null,
6
  stock_list_cache: null,
7
+
8
+ // Class names
9
+ iparcelSkuClass: 'iparcelsku',
10
+ iparcelStockClass: 'iparcelstock',
11
+ iparcelOptionsClass: 'iparcelOptions',
12
+ swatchLinkClass: 'swatch-link',
13
+
14
+ // Selectors
15
+ productAddToCartFormSelector: 'form#product_addtocart_form',
16
+ textSelector: '.product-custom-option[type="text"], textarea.product-custom-option',
17
+ superAttributeSelector: '.super-attribute-select',
18
+ requiredSuperAttributeSelector: '.super-attribute-select.required-entry',
19
+ productCustomOptionSelector: '.super-attribute-select, .product-custom-option',
20
+ productNameAnchorSelector: '.item .product-name a',
21
+ itemSelector: '.item',
22
+
23
+ updateProperties: function(sourceObject) {
24
+ for (var propertyName in iparcelPost) {
25
+ if (propertyName.substr(-5) === 'Class'
26
+ || propertyName.substr(-8) === 'Selector')
27
+ {
28
+ // Check for the propertyName to be set in the sourceObject
29
+ if (sourceObject.hasOwnProperty(propertyName)
30
+ && sourceObject[propertyName] !== null)
31
+ {
32
+ iparcelPost[propertyName] = sourceObject[propertyName];
33
+ }
34
+ }
35
+ }
36
+ },
37
+
38
+ clear: function() {
39
+ $jip('.' + iparcelPost.iparcelSkuClass + ', .' + iparcelPost.iparcelStockClass).remove();
40
  },
41
+
42
+ single: function(sku, url) {
43
+ iparcelPost.sku = sku;
44
+
45
  if (url.indexOf(':') == 0) {
46
  url = url.substring(1,url.length);
47
  }
48
+
49
+ iparcelPost.url = url+'iparcel/ajax/configurable';
50
+
51
  $jip(document).ready(function(){
52
  var $sku = $jip("<div/>");
53
+ $sku.css("display", "none");
54
+ $sku.attr("class", iparcelPost.iparcelSkuClass);
55
  $sku.text(sku);
56
+ $jip(iparcelPost.productAddToCartFormSelector).append($sku);
57
 
58
  var $options = $jip("<div/>");
59
+ $options.css("display", "none");
60
+ $options.attr("class", iparcelPost.iparcelOptionsClass);
61
+ $jip(iparcelPost.productAddToCartFormSelector).append($options);
62
 
63
+ $jip(iparcelPost.superAttributeSelector).change(function(){
64
  iparcelPost.updateSelect();
65
  });
66
 
67
  // if there are '.super-attribute-select' elements, find the SKU
68
  // for the default configuration
69
+ if ($jip(iparcelPost.requiredSuperAttributeSelector).length > 0) {
70
+ $jip(iparcelPost.requiredSuperAttributeSelector).each(function() {
71
+ iparcelPost.validOptions = [];
72
+ var self = iparcelPost;
73
+
74
+ $jip(iparcelPost).children().each(function(){
75
+ if ($jip(iparcelPost).val() != '') {
76
+ self.validOptions.push($jip(iparcelPost).val());
77
  }
78
  });
79
 
80
+ if (iparcelPost.validOptions.length == 1) {
81
+ // Only one valid option for iparcelPost required select
82
+ $jip(iparcelPost).val(iparcelPost.validOptions[0]);
83
  }
84
  });
85
+
86
  iparcelPost.updateSelect();
87
  }
88
+
89
  // Watch for custom option text fields, areas
90
+ $jip(iparcelPost.textSelector).change(function() {
91
  iparcelPost.updateTextfields();
92
  });
93
 
94
  var $iterator = 0;
95
+
96
+ // Handle swatch clicks
97
  $jip(document).bind('DOMNodeInserted', function(e){
98
+ if ($jip(e.target).attr('class') == iparcelPost.swatchLinkClass){
99
  $jip(e.target).click(iparcelPost.update);
100
  if ($iterator++ == 0){
101
  var target = e.target;
108
  }
109
  });
110
 
111
+ $jip('.' + iparcelPost.swatchLinkClass).click(iparcelPost.update);
112
  });
113
  },
114
+
115
  update: function(){
116
  var $this = $jip(this);
117
  var id = $this.parent().attr('id').split('option')[1];
118
  var val = $this.attr('id').split('swatch')[1];
119
  var super_attribute = '';
120
+
121
+ $jip(iparcelPost.superAttributeSelector).each(function(){
122
  var $this = $jip(this);
123
  if ($this.attr('name') != 'super_attribute['+id+']'){
124
+ super_attribute += $this.attr('name') + '=' + $this.val() + '&';
125
  }
126
  });
127
+
128
+ iparcelMage.ajax.post(iparcelPost.sku, super_attribute, iparcelPost.url);
129
  },
130
+
131
  updateSelect: function () {
132
  iparcelPost.setStock('false');
133
  var $this = $jip(this);
134
  var super_attribute = '';
135
+
136
+ $jip(iparcelPost.productCustomOptionSelector).each(function () {
137
  var $this = $jip(this);
138
  super_attribute += $this.attr('name') + '=' + $this.val() + '&';
139
  });
140
+
141
  iparcelMage.ajax.post(iparcelPost.sku, super_attribute, iparcelPost.url);
142
  },
143
+
144
  updateTextfields: function() {
145
  iparcelPost.setStock('false');
146
  var custom_options = '';
147
+
148
+ $jip(iparcelPost.textSelector).each(function() {
149
  var $this = $jip(this);
150
  custom_options += $this.attr('name') + '=' + $this.val() + '&';
151
  });
152
+
153
  iparcelMage.ajax.post(iparcelPost.sku, custom_options, iparcelPost.url);
154
  },
155
+
156
  stock: function(qty){
157
+ $jip(document).ready(function() {
158
  var $stock = $jip("<div/>");
159
+ $stock.css("display", "none");
160
+ $stock.attr("class", iparcelPost.iparcelStockClass);
161
  $stock.text(qty > 0 ? 'true' : 'false');
162
+ $jip(iparcelPost.productAddToCartFormSelector).append($stock);
163
  });
164
  },
165
+
166
  setStock: function(value){
167
+ $jip('.' + iparcelPost.iparcelStockClass).text(value);
168
  },
169
+
170
  sku_list: function (sku_list) {
171
+ iparcelPost.sku_list_cache = sku_list;
172
+
173
+ $jip(document).ready(function() {
174
  $jip.each(sku_list, function(sku,name){
175
  name = iparcelMage.parseHtmlEntities(name);
176
  var $sku = $jip("<div/>");
177
+ $sku.css("display", "none");
178
+ $sku.attr("class", iparcelPost.iparcelSkuClass);
179
  $sku.text(sku);
180
  iparcelPost.append($sku,name);
181
  });
182
  });
183
+
184
+ $jip(document).ajaxSuccess(function(data) {
185
  iparcelPost.sku_list(sku_list);
186
  });
187
  },
188
+
189
  stock_list: function(stock_list){
190
  this.stock_list_cache = stock_list;
191
+
192
+ $jip(document).ready(function() {
193
  $jip.each(stock_list, function(name,qty){
194
  name = iparcelMage.parseHtmlEntities(name);
195
  var $stock = $jip("<div/>");
196
+ $stock.css("display", "none");
197
+ $stock.attr("class", iparcelPost.iparcelStockClass);
198
  $stock.text(qty > 0 ? 'true' : 'false');
199
  iparcelPost.append($stock,name);
200
  });
201
  });
202
  },
203
+
204
  append: function(item,name){
205
+ var $item = $jip(iparcelPost.productNameAnchorSelector).filter(function () {
206
  return $jip(this).text() == name;
207
  });
208
+
209
+ $item.closest(iparcelPost.itemSelector).append(item);
210
  }
211
  };
212
 
214
  onComplete: function(args){
215
  iparcelPost.sku_list(iparcelPost.sku_list_cache);
216
  iparcelPost.stock_list(iparcelPost.stock_list_cache);
217
+ p
218
+ if (typeof iparcel.session !== "undefined") {
219
+ if (typeof iparcel.session.content !== "undefined") {
220
+ if (typeof iparcel.session.content.locale !== "undefined" && iparcel.session.content.locale == "US") {
221
  $_ipar(iparcel.settings.productListingPriceElement).css("visibility","visible");
222
+ } else {
 
223
  iparcel.ux.displayEligibility();
224
  }
225
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>iparcel_carthandoff</name>
4
- <version>1.5.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -16,9 +16,9 @@
16
  <email>bburden@i-parcel.com</email>
17
  </author>
18
  </authors>
19
- <date>2016-08-29</date>
20
- <time>17:46:49</time>
21
- <contents><target name="mageweb"><dir name="app"><dir name="etc"><dir name="modules"><file name="Iparcel_CartHandoff.xml" hash="ffb746b30fb5ff90dd7807211f6a4e9f"/><file name="Iparcel_All.xml" hash="89e4b47a6ac9aa0b82f70b1539d587ea"/></dir></dir><dir name="code"><dir name="community"><dir name="Iparcel"><dir name="CartHandoff"><file name=".DS_Store" hash="dfb9481803d164ba9ec4e857204c243e"/><dir name="Block"><dir name="Adminhtml"><dir name="Checkitems"><file name="Button.php" hash="996c59c0e070bfe0abcfbc75c33d9181"/></dir></dir><file name="Button.php" hash="f0973ed80adca37577c9183d543ffca6"/><file name="Estimate.php" hash="ed76666cb286b1bd36235c7aa23ab098"/><dir name="Form"><file name="Button.php" hash="15c90ba070756ebc2aec36546dd5854b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Ipcarthandoff"><dir name="Checkitems"><file name="CacheController.php" hash="dc682b48cd1d76cbe5431340ad15d10b"/></dir></dir></dir><file name="HandoffController.php" hash="e7d6991c2e76e1f5519b7376ce98e230"/><file name="StatusController.php" hash="511f645fec406059f956aa915c9138b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e4f3a503dfa55aa0540b87d644cf0631"/><file name="config.xml" hash="4d4db1aa64e78ae8c6617fe6b90fbffc"/><file name="system.xml" hash="1100d55b1cff4f7aee9f9ecf31725cd0"/></dir><dir name="Helper"><file name="Api.php" hash="a7b84c5ebf077e460515f09e6695cee2"/><file name="Data.php" hash="b7cca184d2968a2fcc9f7078afc60293"/></dir><dir name="Model"><dir name="Catalog"><file name="Layer.php" hash="b7410cb6b76bcf6282d0de45fcfd4214"/><dir name="Product"><dir name="Type"><dir name="Configurable"><file name="Price.php" hash="9757c4a3a06ab09e20f505b83197a864"/></dir><file name="Price.php" hash="0b5b030df7a614b880a07642d9166888"/></dir></dir></dir><file name="Checkitems.php" hash="b86446862f8eb0b48cda130dc8e4b83a"/><file name="Observer.php" hash="f7ab4f37d2732fdd39fc8c0231b64910"/><dir name="Payment"><file name="Ipcarthandoff.php" hash="80a584da0c50a446c552c1359a14aeab"/></dir><dir name="Resource"><dir name="Checkitems"><file name="Collection.php" hash="9a488c5a6c0b3d16f63817afd691ae80"/></dir><file name="Checkitems.php" hash="03ba687675e6eef24e6fed32c4767e55"/><dir name="Mysql4"><file name="Setup.php" hash="c7609fb203ba82fa7e1a39457f1edb3b"/></dir></dir><dir name="Sales"><file name="Order.php" hash="93008416ea3552d2adc0ed63016dc7b1"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Buttonplacement.php" hash="7f8a7cfd897ef5a12a082251eb397451"/><file name="Shippingaddress.php" hash="12630442dcf038ee8d7b7bf9b203b0eb"/><dir name="Checkitems"><file name="Cache.php" hash="ea4566851a70fee0473a283a7bfa0a2c"/></dir></dir></dir></dir></dir><dir name="sql"><dir name="ipcarthandoff_setup"><file name="mysql4-upgrade-1.2.0-1.3.0.php" hash="178b64c5cd9aded939a8973d4c0ac3e6"/></dir></dir></dir><dir name="All"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Mapping"><file name="Button.php" hash="dfdaf5a2fbf824a10fccc952fdccf567"/></dir></dir><dir name="Iparcel"><file name="Dashboard.php" hash="ec9dddd10368136f1bdfe79fddd4500c"/><file name="Logs.php" hash="5823bbc2a78666972dd02d5fd3e9d05d"/><dir name="Logs"><file name="Grid.php" hash="9c472c78640c8aecb5de4b638372e6f5"/></dir><dir name="Shipment"><dir name="Split"><file name="Form.php" hash="db44693b1eda47cb1d87b8a69ac9a5a0"/></dir><file name="Split.php" hash="4cb66f91987f842c699bd2d6c42f2249"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Method.php" hash="935a3d4adad09d6c049cd6bb4cefb8db"/></dir></dir></dir></dir></dir><dir name="Catalog"><dir name="Product"><file name="List.php" hash="5de6102a56f4a9301f1b81004da39ef8"/></dir><file name="Product.php" hash="71a865c01574fd10ee0ffa7475cee378"/></dir><dir name="Catalogsearch"><dir name="Advanced"><file name="Result.php" hash="ad5a157444b80a284e0f9e7a91187b55"/></dir><file name="Result.php" hash="33e4ab0994bde9ba5dd87ade63869bee"/></dir><dir name="Html"><dir name="Head"><file name="Iparcel.php" hash="dd1737d041e9357269fa35b27dbef0bd"/><file name="Jquery.php" hash="3fd23960111c32d5696cc3de63e41b6e"/><file name="Post.php" hash="793d578cf82fb3ba83e1edc87b79ff95"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Totals"><file name="Abstract.php" hash="71cdfdce9a538b2f78b83b7b5eac8b19"/><file name="Duty.php" hash="2ca06e658c24b74d5e3dfa2a6950b010"/><file name="Tax.php" hash="7b630e60c6ff9340bedefdc84e99cef4"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Iparcel"><file name="LogController.php" hash="94e2095979140ad6d7c149080be30d38"/><file name="ShipmentController.php" hash="a9b8896d816b7612e1dc0638a2f8b740"/><dir name="Shipment"><file name="SplitController.php" hash="6a294947cf9399e42e90c890a6da2caa"/></dir><dir name="Sync"><file name="AjaxController.php" hash="224df904979eb90a3f639a8f5c89787a"/></dir></dir></dir><file name="AjaxController.php" hash="9069724f071742b25c83b2d0cc368871"/><file name="InfoController.php" hash="ab1bdf953dac27d87e9c5c8023ed9380"/><file name="InternationalController.php" hash="5250af3266389ddf0f5ea3a806652328"/></dir><dir name="etc"><file name="adminhtml.xml" hash="50bc0bee93b5612763321eae11cfdc51"/><file name="config.xml" hash="4bd33ca7a2dca415a545f524165ced48"/><file name="system.xml" hash="823d3690c187d8c3db42912d83a6303b"/></dir><dir name="Helper"><file name="Api.php" hash="3d3dc72a52c948964c22e94c47356cfa"/><file name="Data.php" hash="2e4f16bb0a3f1fe1345b5d21df59dbae"/><file name="International.php" hash="7bba0cd23188eaa3f99ed3d32ffccd14"/></dir><dir name="Model"><dir name="Api"><file name="Quote.php" hash="2e938bda13d007e73f8c2238aff76fa1"/></dir><dir name="Carrier"><file name="Abstract.php" hash="87ebc5b402ea74709a00abcf2a8aa856"/><file name="Iparcel.php" hash="add977e3b85ae8c08914874f02a288b3"/></dir><dir name="Catalog"><dir name="Product"><file name="Observer.php" hash="2fd0ce66f180cb7d0dfbe752e5227636"/></dir></dir><dir name="Config"><dir name="Script"><file name="Js.php" hash="f29fc9a7535bc886b3ccf8b2e5b7ebfc"/></dir></dir><file name="Cron.php" hash="670d37cd6cdbe60aa69fad8eb0a0759e"/><file name="Log.php" hash="8c87e5f356f8ca77a186430dda106097"/><file name="Observer.php" hash="9d53f374789eaa0b13349843d3e2c7fd"/><dir name="Order"><dir name="Creditmemo"><dir name="Total"><file name="Duty.php" hash="33b91a5b8fa32293bfe0eab4460b04f9"/><file name="Tax.php" hash="7cd4046231eb8cb9031ae160720390da"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="Duty.php" hash="5a4010994ea502afe88632ddd2699c63"/><file name="Tax.php" hash="c4c95aaaae9662860dd635238150aa46"/></dir></dir></dir><dir name="Payment"><file name="Iparcel.php" hash="d7881d795edbbd7279888e3a86fff2c8"/></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Abstract.php" hash="c5f5a251d5cf9f6ddb5a6d92efad157b"/><file name="Collector.php" hash="f805c3fc373f931d912b92cf38a15154"/><file name="Duty.php" hash="41adb9e60a5a22e1e552eb12aa83f858"/><file name="Tax.php" hash="67bce5ef6a1ec130cebaaa3526b97112"/></dir></dir></dir><dir name="Resource"><dir name="Api"><file name="Quote.php" hash="84d032b89c5df67ef24a112ad7846302"/></dir><dir name="Log"><file name="Collection.php" hash="7cb78be07207a599eff71c1e18ba0b7a"/></dir><file name="Log.php" hash="d14c2eb8314456a18adadbb52856e0b5"/><dir name="Mysql4"><file name="Setup.php" hash="9f9cf4b5934b70bd00b394beacb245f7"/></dir></dir><dir name="System"><dir name="Config"><dir name="Catalog"><file name="Mapping.php" hash="3d44f4b4ee157333556f588d7d8cd25b"/></dir><dir name="Data"><dir name="Date"><file name="Monthday.php" hash="baec5b8a27c5b037529ba935aae0370a"/><file name="Weekday.php" hash="173edc075325d932f8dad6d4674b8153"/></dir><dir name="Time"><file name="Hour.php" hash="ddad98b85290d9b13ec9f65fbe8a10b3"/><file name="Minute.php" hash="4a76af0057d60e8ff0ff7fedc1d50575"/></dir></dir><file name="Guid.php" hash="311c7f8072f02a6be9e25b6411298c5c"/><dir name="Script"><file name="Js.php" hash="3e3f23b38ecdc361bf6ff6cee1871e92"/></dir><dir name="Source"><dir name="Catalog"><dir name="Mapping"><dir name="Configurable"><file name="Price.php" hash="f9116fd446914467e7fb31bed5a6dd0b"/></dir><file name="Mode.php" hash="36140a050ea65ff23d45264fa67e1a2b"/></dir><dir name="Product"><dir name="Attribute"><file name="Boolean.php" hash="ca1883122659f1b48890ecd46a1590ee"/></dir><file name="Attribute.php" hash="8ca9c929cda497400865751ffba991e6"/></dir></dir><dir name="Date"><file name="Weekday.php" hash="143c26f9661e5dc995ff064e333a2018"/></dir><dir name="Sales"><dir name="Order"><file name="Status.php" hash="f1e414c08c43ebb2fcc6ccf5b41a2ff2"/></dir></dir><dir name="Tax"><file name="Mode.php" hash="fb09f17b54ef8ffa22580741cc66ac14"/></dir></dir></dir></dir><dir name="Tax"><dir name="Quote"><file name="Shipping.php" hash="e4b0f82aaef3666be520bc2da28af098"/><file name="Subtotal.php" hash="6824b6e6e86dc423fd493a31b15aa28d"/><file name="Tax.php" hash="7ee0528db7b7f9e89cd00a0b0c74dda9"/></dir></dir></dir><dir name="sql"><dir name="iparcel_setup"><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="4df6e3a3f2adf96eeb6ccdac213e3f1e"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="358045d3bf4a53a477e52b573289fe4c"/><file name="mysql4-upgrade-1.1.1-1.2.0.php" hash="1f04c5c71a6a79aaf74810e87670d998"/><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="de1c9caa713dd194595aa2dd15a829ac"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ipcarthandoff.xml" hash="ed7faf180d54254f9bd4bfde21cdec1d"/><file name="iparcel.xml" hash="55aec816cb242fe44aab3a2e0d9de0ba"/><file name="iparcel.xml" hash="55aec816cb242fe44aab3a2e0d9de0ba"/></dir><dir name="template"><dir name="iparcel"><dir name="carthandoff"><file name="button.phtml" hash="4724ea247d4fb514373bd25290f8ee96"/><file name="estimate.phtml" hash="4613986760ea91bbfe607336008da870"/><dir name="form"><file name="button.phtml" hash="603683fdeb5153c8ce4649f72967180a"/></dir></dir><dir name="html"><dir name="head"><file name="iparcel.phtml" hash="07091c9914189cfef06af8cc6e41855c"/><file name="jquery.phtml" hash="c287cb0aa4ddd1f04f27cb5df605a27d"/><file name="post.phtml" hash="1a53e744668b250175ba275b4260050b"/><file name="iparcel.phtml" hash="07091c9914189cfef06af8cc6e41855c"/><file name="jquery.phtml" hash="c287cb0aa4ddd1f04f27cb5df605a27d"/><file name="post.phtml" hash="1a53e744668b250175ba275b4260050b"/></dir></dir><dir name="post"><file name="list.phtml" hash="20e5d7d7f82e1f8d951a1509921eb3bf"/><file name="list.phtml" hash="20e5d7d7f82e1f8d951a1509921eb3bf"/></dir><file name="post.phtml" hash="3827cab2dba981556aeb8ec915ab03cc"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iparcel.xml" hash="b6e4778db9cebc970e1dc58cae12eb85"/></dir><dir name="template"><dir name="iparcel"><dir name="order"><dir name="totals"><file name="duty.phtml" hash="7af41c6d47dafeb890a520d8e6e39910"/><file name="tax.phtml" hash="25bffd2b58554cf28e5f4abe4b4e1e7c"/></dir></dir><dir name="sync"><dir name="ajax"><file name="catalog.phtml" hash="54ad431bc5f9b6d8dc50a1160e6d6ab5"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="locale"><dir name="en_US"><file name="iparcel.csv" hash="cbcb75a490376ca0b63c8c66622c1656"/></dir></dir></dir><dir name="js"><dir name="iparcel"><file name="cart-buttons.js" hash="98e45ffd14e94c6c33184fea62fce296"/><file name="jQuery.js" hash="8ec1680e4d815ff93f661214efa06276"/><file name="lib.js" hash="42c556650eb62797de469f1770bde3f0"/><file name="post.js" hash="c710697e3d4905a6a707222728485047"/><file name="jQuery.js" hash="8ec1680e4d815ff93f661214efa06276"/><file name="lib.js" hash="42c556650eb62797de469f1770bde3f0"/><file name="post.js" hash="c710697e3d4905a6a707222728485047"/><file name="jQuery.js" hash="8ec1680e4d815ff93f661214efa06276"/><file name="lib.js" hash="42c556650eb62797de469f1770bde3f0"/><file name="post.js" hash="c710697e3d4905a6a707222728485047"/><dir name="adminhtml"><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="iparcel"><file name="ajaxSync.css" hash="c622b9e4b77589bc0f3c0555124d2751"/></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies>
24
  <required>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>iparcel_carthandoff</name>
4
+ <version>1.6.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
16
  <email>bburden@i-parcel.com</email>
17
  </author>
18
  </authors>
19
+ <date>2016-11-16</date>
20
+ <time>19:56:45</time>
21
+ <contents><target name="mageweb"><dir name="app"><dir name="etc"><dir name="modules"><file name="Iparcel_CartHandoff.xml" hash="ffb746b30fb5ff90dd7807211f6a4e9f"/><file name="Iparcel_All.xml" hash="89e4b47a6ac9aa0b82f70b1539d587ea"/></dir></dir><dir name="code"><dir name="community"><dir name="Iparcel"><dir name="CartHandoff"><file name=".DS_Store" hash="dfb9481803d164ba9ec4e857204c243e"/><dir name="Block"><dir name="Adminhtml"><dir name="Checkitems"><file name="Button.php" hash="996c59c0e070bfe0abcfbc75c33d9181"/></dir></dir><file name="Button.php" hash="f0973ed80adca37577c9183d543ffca6"/><file name="Estimate.php" hash="ed76666cb286b1bd36235c7aa23ab098"/><dir name="Form"><file name="Button.php" hash="15c90ba070756ebc2aec36546dd5854b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Ipcarthandoff"><dir name="Checkitems"><file name="CacheController.php" hash="dc682b48cd1d76cbe5431340ad15d10b"/></dir></dir></dir><file name="HandoffController.php" hash="b2bd0440b4fc8e143791fda85f511efb"/><file name="StatusController.php" hash="511f645fec406059f956aa915c9138b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e4f3a503dfa55aa0540b87d644cf0631"/><file name="config.xml" hash="19416642acf422722290dc336fef30d9"/><file name="system.xml" hash="84519b9fbfd73d4ca12df63303ae519a"/></dir><dir name="Helper"><file name="Api.php" hash="98fc6905d589e661a5c65a9e6d74fcdb"/><file name="Data.php" hash="784eea529c5eae7652cd2741cc5b9214"/></dir><dir name="Model"><dir name="Catalog"><file name="Layer.php" hash="b7410cb6b76bcf6282d0de45fcfd4214"/><dir name="Product"><dir name="Type"><dir name="Configurable"><file name="Price.php" hash="9757c4a3a06ab09e20f505b83197a864"/></dir><file name="Price.php" hash="0b5b030df7a614b880a07642d9166888"/></dir></dir></dir><file name="Checkitems.php" hash="b86446862f8eb0b48cda130dc8e4b83a"/><file name="Observer.php" hash="f7ab4f37d2732fdd39fc8c0231b64910"/><dir name="Checkout"><dir name="Type"><file name="Onepage.php" hash="cb728cbf897b44cb411cc44ae5be6a3e"/></dir></dir><dir name="Observer"><file name="Storecredit.php" hash="f147548263151fa76944c1aeba53723f"/></dir><dir name="Payment"><file name="Free.php" hash="810c0e8e3a208a88bfbcb447997674ee"/><file name="Ipcarthandoff.php" hash="da308f2dd70aac12912b923441e117c8"/></dir><dir name="Resource"><dir name="Checkitems"><file name="Collection.php" hash="9a488c5a6c0b3d16f63817afd691ae80"/></dir><file name="Checkitems.php" hash="03ba687675e6eef24e6fed32c4767e55"/><dir name="Mysql4"><file name="Setup.php" hash="c7609fb203ba82fa7e1a39457f1edb3b"/></dir></dir><dir name="Sales"><file name="Order.php" hash="93008416ea3552d2adc0ed63016dc7b1"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Buttonplacement.php" hash="7f8a7cfd897ef5a12a082251eb397451"/><file name="Shippingaddress.php" hash="12630442dcf038ee8d7b7bf9b203b0eb"/><dir name="Checkitems"><file name="Cache.php" hash="ea4566851a70fee0473a283a7bfa0a2c"/></dir></dir></dir></dir></dir><dir name="sql"><dir name="ipcarthandoff_setup"><file name="mysql4-upgrade-1.2.0-1.3.0.php" hash="178b64c5cd9aded939a8973d4c0ac3e6"/></dir></dir></dir><dir name="All"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Mapping"><file name="Button.php" hash="dfdaf5a2fbf824a10fccc952fdccf567"/></dir></dir><dir name="Iparcel"><file name="Dashboard.php" hash="ec9dddd10368136f1bdfe79fddd4500c"/><file name="Logs.php" hash="5823bbc2a78666972dd02d5fd3e9d05d"/><dir name="Logs"><file name="Grid.php" hash="9c472c78640c8aecb5de4b638372e6f5"/></dir><dir name="Shipment"><dir name="Split"><file name="Form.php" hash="db44693b1eda47cb1d87b8a69ac9a5a0"/></dir><file name="Split.php" hash="4cb66f91987f842c699bd2d6c42f2249"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Method.php" hash="935a3d4adad09d6c049cd6bb4cefb8db"/></dir></dir></dir></dir></dir><dir name="Catalog"><dir name="Product"><file name="List.php" hash="5de6102a56f4a9301f1b81004da39ef8"/></dir><file name="Product.php" hash="71a865c01574fd10ee0ffa7475cee378"/></dir><dir name="Catalogsearch"><dir name="Advanced"><file name="Result.php" hash="ad5a157444b80a284e0f9e7a91187b55"/></dir><file name="Result.php" hash="33e4ab0994bde9ba5dd87ade63869bee"/></dir><dir name="Html"><dir name="Head"><file name="Iparcel.php" hash="dd1737d041e9357269fa35b27dbef0bd"/><file name="Jquery.php" hash="3fd23960111c32d5696cc3de63e41b6e"/><file name="Post.php" hash="793d578cf82fb3ba83e1edc87b79ff95"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Totals"><file name="Abstract.php" hash="71cdfdce9a538b2f78b83b7b5eac8b19"/><file name="Duty.php" hash="2ca06e658c24b74d5e3dfa2a6950b010"/><file name="Tax.php" hash="7b630e60c6ff9340bedefdc84e99cef4"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Iparcel"><file name="LogController.php" hash="94e2095979140ad6d7c149080be30d38"/><file name="ShipmentController.php" hash="a9b8896d816b7612e1dc0638a2f8b740"/><dir name="Shipment"><file name="SplitController.php" hash="6a294947cf9399e42e90c890a6da2caa"/></dir><dir name="Sync"><file name="AjaxController.php" hash="224df904979eb90a3f639a8f5c89787a"/></dir></dir></dir><file name="AjaxController.php" hash="9069724f071742b25c83b2d0cc368871"/><file name="InfoController.php" hash="ab1bdf953dac27d87e9c5c8023ed9380"/><file name="InternationalController.php" hash="5250af3266389ddf0f5ea3a806652328"/></dir><dir name="etc"><file name="adminhtml.xml" hash="50bc0bee93b5612763321eae11cfdc51"/><file name="config.xml" hash="3fc0f987d470f83ccb10bd04de9d6abb"/><file name="system.xml" hash="823d3690c187d8c3db42912d83a6303b"/></dir><dir name="Helper"><file name="Api.php" hash="738aef7c3db1b3f17f902849017b39c0"/><file name="Data.php" hash="2e4f16bb0a3f1fe1345b5d21df59dbae"/><file name="International.php" hash="7bba0cd23188eaa3f99ed3d32ffccd14"/></dir><dir name="Model"><dir name="Api"><file name="Quote.php" hash="2e938bda13d007e73f8c2238aff76fa1"/></dir><dir name="Carrier"><file name="Abstract.php" hash="87ebc5b402ea74709a00abcf2a8aa856"/><file name="Iparcel.php" hash="00949d17dbc1ee27d6fd804c8e7778fd"/></dir><dir name="Catalog"><dir name="Product"><file name="Observer.php" hash="2fd0ce66f180cb7d0dfbe752e5227636"/></dir></dir><dir name="Config"><dir name="Script"><file name="Js.php" hash="f29fc9a7535bc886b3ccf8b2e5b7ebfc"/></dir></dir><file name="Cron.php" hash="670d37cd6cdbe60aa69fad8eb0a0759e"/><file name="Log.php" hash="8c87e5f356f8ca77a186430dda106097"/><file name="Observer.php" hash="9d53f374789eaa0b13349843d3e2c7fd"/><dir name="Order"><dir name="Creditmemo"><dir name="Total"><file name="Duty.php" hash="33b91a5b8fa32293bfe0eab4460b04f9"/><file name="Tax.php" hash="7cd4046231eb8cb9031ae160720390da"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="Duty.php" hash="5a4010994ea502afe88632ddd2699c63"/><file name="Tax.php" hash="c4c95aaaae9662860dd635238150aa46"/></dir></dir></dir><dir name="Payment"><file name="Iparcel.php" hash="d7881d795edbbd7279888e3a86fff2c8"/></dir><dir name="Quote"><dir name="Address"><file name=".DS_Store" hash="fa72329856eac901102db0ec0b537843"/><dir name="Total"><file name="Abstract.php" hash="c5f5a251d5cf9f6ddb5a6d92efad157b"/><file name="Collector.php" hash="f805c3fc373f931d912b92cf38a15154"/><file name="Duty.php" hash="41adb9e60a5a22e1e552eb12aa83f858"/><file name="Tax.php" hash="262c99bceac487a5849058d6ed88011e"/></dir></dir></dir><dir name="Resource"><dir name="Api"><file name="Quote.php" hash="84d032b89c5df67ef24a112ad7846302"/></dir><dir name="Log"><file name="Collection.php" hash="7cb78be07207a599eff71c1e18ba0b7a"/></dir><file name="Log.php" hash="d14c2eb8314456a18adadbb52856e0b5"/><dir name="Mysql4"><file name="Setup.php" hash="9f9cf4b5934b70bd00b394beacb245f7"/></dir></dir><dir name="System"><dir name="Config"><dir name="Catalog"><file name="Mapping.php" hash="3d44f4b4ee157333556f588d7d8cd25b"/></dir><dir name="Data"><dir name="Date"><file name="Monthday.php" hash="baec5b8a27c5b037529ba935aae0370a"/><file name="Weekday.php" hash="173edc075325d932f8dad6d4674b8153"/></dir><dir name="Time"><file name="Hour.php" hash="ddad98b85290d9b13ec9f65fbe8a10b3"/><file name="Minute.php" hash="4a76af0057d60e8ff0ff7fedc1d50575"/></dir></dir><file name="Guid.php" hash="311c7f8072f02a6be9e25b6411298c5c"/><dir name="Script"><file name="Js.php" hash="3e3f23b38ecdc361bf6ff6cee1871e92"/></dir><dir name="Source"><dir name="Catalog"><dir name="Mapping"><dir name="Configurable"><file name="Price.php" hash="f9116fd446914467e7fb31bed5a6dd0b"/></dir><file name="Mode.php" hash="36140a050ea65ff23d45264fa67e1a2b"/></dir><dir name="Product"><dir name="Attribute"><file name="Boolean.php" hash="ca1883122659f1b48890ecd46a1590ee"/></dir><file name="Attribute.php" hash="8ca9c929cda497400865751ffba991e6"/></dir></dir><dir name="Date"><file name="Weekday.php" hash="143c26f9661e5dc995ff064e333a2018"/></dir><dir name="Sales"><dir name="Order"><file name="Status.php" hash="f1e414c08c43ebb2fcc6ccf5b41a2ff2"/></dir></dir><dir name="Tax"><file name="Mode.php" hash="fb09f17b54ef8ffa22580741cc66ac14"/></dir></dir></dir></dir><dir name="Tax"><dir name="Quote"><file name="Shipping.php" hash="e4b0f82aaef3666be520bc2da28af098"/><file name="Subtotal.php" hash="6824b6e6e86dc423fd493a31b15aa28d"/><file name="Tax.php" hash="7ee0528db7b7f9e89cd00a0b0c74dda9"/></dir></dir></dir><dir name="sql"><dir name="iparcel_setup"><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="4df6e3a3f2adf96eeb6ccdac213e3f1e"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="358045d3bf4a53a477e52b573289fe4c"/><file name="mysql4-upgrade-1.1.1-1.2.0.php" hash="1f04c5c71a6a79aaf74810e87670d998"/><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="de1c9caa713dd194595aa2dd15a829ac"/><file name="mysql4-upgrade-1.2.1-1.3.0.php" hash="f7a5567470b6a3c98530600b48993889"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ipcarthandoff.xml" hash="ed7faf180d54254f9bd4bfde21cdec1d"/><file name="iparcel.xml" hash="55aec816cb242fe44aab3a2e0d9de0ba"/><file name="iparcel.xml" hash="55aec816cb242fe44aab3a2e0d9de0ba"/></dir><dir name="template"><dir name="iparcel"><dir name="carthandoff"><file name="button.phtml" hash="4724ea247d4fb514373bd25290f8ee96"/><file name="estimate.phtml" hash="4613986760ea91bbfe607336008da870"/><dir name="form"><file name="button.phtml" hash="603683fdeb5153c8ce4649f72967180a"/></dir></dir><dir name="html"><dir name="head"><file name="iparcel.phtml" hash="07091c9914189cfef06af8cc6e41855c"/><file name="jquery.phtml" hash="c287cb0aa4ddd1f04f27cb5df605a27d"/><file name="post.phtml" hash="1a53e744668b250175ba275b4260050b"/><file name="iparcel.phtml" hash="07091c9914189cfef06af8cc6e41855c"/><file name="jquery.phtml" hash="c287cb0aa4ddd1f04f27cb5df605a27d"/><file name="post.phtml" hash="1a53e744668b250175ba275b4260050b"/></dir></dir><dir name="post"><file name="list.phtml" hash="20e5d7d7f82e1f8d951a1509921eb3bf"/><file name="list.phtml" hash="20e5d7d7f82e1f8d951a1509921eb3bf"/></dir><file name="post.phtml" hash="3827cab2dba981556aeb8ec915ab03cc"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iparcel.xml" hash="b6e4778db9cebc970e1dc58cae12eb85"/></dir><dir name="template"><dir name="iparcel"><dir name="order"><dir name="totals"><file name="duty.phtml" hash="7af41c6d47dafeb890a520d8e6e39910"/><file name="tax.phtml" hash="25bffd2b58554cf28e5f4abe4b4e1e7c"/></dir></dir><dir name="sync"><dir name="ajax"><file name="catalog.phtml" hash="54ad431bc5f9b6d8dc50a1160e6d6ab5"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="locale"><dir name="en_US"><file name="iparcel.csv" hash="cbcb75a490376ca0b63c8c66622c1656"/></dir></dir></dir><dir name="js"><dir name="iparcel"><file name="cart-buttons.js" hash="98e45ffd14e94c6c33184fea62fce296"/><file name="jQuery.js" hash="8ec1680e4d815ff93f661214efa06276"/><file name="lib.js" hash="ea2e78b3fa40dd2be5e1f8559742ee86"/><file name="post.js" hash="55a14e510b988d893e95860e83e3f16b"/><file name="jQuery.js" hash="8ec1680e4d815ff93f661214efa06276"/><file name="lib.js" hash="ea2e78b3fa40dd2be5e1f8559742ee86"/><file name="post.js" hash="55a14e510b988d893e95860e83e3f16b"/><file name="jQuery.js" hash="8ec1680e4d815ff93f661214efa06276"/><file name="lib.js" hash="ea2e78b3fa40dd2be5e1f8559742ee86"/><file name="post.js" hash="55a14e510b988d893e95860e83e3f16b"/><dir name="adminhtml"><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f755af215fb6121c766644bd9a0f399d"/></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="iparcel"><file name="ajaxSync.css" hash="c622b9e4b77589bc0f3c0555124d2751"/></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies>
24
  <required>