Version Notes
Notes
Download this release
Release Info
| Developer | Bobby Burden |
| Extension | iparcel_carthandoff |
| Version | 1.4.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.4.1 to 1.4.2
- app/code/community/Iparcel/All/Block/Sales/Order/Totals/Duty.php +1 -1
- app/code/community/Iparcel/All/Block/Sales/Order/Totals/Tax.php +1 -1
- app/code/community/Iparcel/All/Helper/Api.php +174 -150
- app/code/community/Iparcel/All/Helper/Data.php +27 -0
- app/code/community/Iparcel/All/Model/Carrier/Abstract.php +47 -0
- app/code/community/Iparcel/All/Model/Carrier/Iparcel.php +1 -38
- app/code/community/Iparcel/All/Model/Config/Script/Js.php +0 -5
- app/code/community/Iparcel/All/Model/Observer.php +70 -47
- app/code/community/Iparcel/All/Model/Payment/Iparcel.php +13 -0
- app/code/community/Iparcel/All/Model/Quote/Address/Total/Abstract.php +2 -1
- app/code/community/Iparcel/All/Model/Quote/Address/Total/Collector.php +3 -3
- app/code/community/Iparcel/All/Model/Quote/Address/Total/Duty.php +1 -1
- app/code/community/Iparcel/All/Model/Quote/Address/Total/Tax.php +1 -1
- app/code/community/Iparcel/All/Model/System/Config/Catalog/Mapping.php +2 -0
- app/code/community/Iparcel/All/Model/Tax/Quote/Shipping.php +1 -1
- app/code/community/Iparcel/All/Model/Tax/Quote/Subtotal.php +1 -1
- app/code/community/Iparcel/All/Model/Tax/Quote/Tax.php +1 -1
- app/code/community/Iparcel/All/controllers/Adminhtml/Iparcel/Sync/AjaxController.php +36 -34
- app/code/community/Iparcel/All/controllers/InfoController.php +1 -27
- app/code/community/Iparcel/All/controllers/InternationalController.php +4 -4
- app/code/community/Iparcel/CartHandoff/Helper/Api.php +20 -17
- app/code/community/Iparcel/CartHandoff/Helper/Data.php +4 -1
- app/code/community/Iparcel/CartHandoff/Model/Checkitems.php +21 -5
- app/code/community/Iparcel/CartHandoff/etc/config.xml +2 -1
- app/code/community/Iparcel/CartHandoff/etc/system.xml +22 -1
- app/code/community/Iparcel/CartHandoff/sql/ipcarthandoff_setup/mysql4-upgrade-1.2.0-1.3.0.php +2 -2
- app/design/adminhtml/default/default/template/iparcel/sync/ajax/catalog.phtml +1 -1
- app/design/adminhtml/default/default/template/iparcel/sync/ajax/checkitems.phtml +1 -1
- app/design/frontend/base/default/template/iparcel/carthandoff/button.phtml +2 -0
- js/iparcel/cart-buttons.js +20 -0
- package.xml +4 -4
app/code/community/Iparcel/All/Block/Sales/Order/Totals/Duty.php
CHANGED
|
@@ -20,7 +20,7 @@ class Iparcel_All_Block_Sales_Order_Totals_Duty extends Iparcel_All_Block_Sales_
|
|
| 20 |
$value = $source->getIparcelDutyAmount();
|
| 21 |
|
| 22 |
$this->getParentBlock()->addTotal(new Varien_Object(array(
|
| 23 |
-
'code' => '
|
| 24 |
'strong' => false,
|
| 25 |
'label' => Mage::helper('iparcel')->getDutyLabel(),
|
| 26 |
'value' => $value
|
| 20 |
$value = $source->getIparcelDutyAmount();
|
| 21 |
|
| 22 |
$this->getParentBlock()->addTotal(new Varien_Object(array(
|
| 23 |
+
'code' => Mage::getModel('iparcel/payment_iparcel')->getDutyCode(),
|
| 24 |
'strong' => false,
|
| 25 |
'label' => Mage::helper('iparcel')->getDutyLabel(),
|
| 26 |
'value' => $value
|
app/code/community/Iparcel/All/Block/Sales/Order/Totals/Tax.php
CHANGED
|
@@ -20,7 +20,7 @@ class Iparcel_All_Block_Sales_Order_Totals_Tax extends Iparcel_All_Block_Sales_O
|
|
| 20 |
$value = $source->getIparcelTaxAmount();
|
| 21 |
|
| 22 |
$this->getParentBlock()->addTotal(new Varien_Object(array(
|
| 23 |
-
'code' => '
|
| 24 |
'strong' => false,
|
| 25 |
'label' => Mage::helper('iparcel')->getTaxLabel(),
|
| 26 |
'value' => $value
|
| 20 |
$value = $source->getIparcelTaxAmount();
|
| 21 |
|
| 22 |
$this->getParentBlock()->addTotal(new Varien_Object(array(
|
| 23 |
+
'code' => Mage::getModel('iparcel/payment_iparcel')->getTaxCode(),
|
| 24 |
'strong' => false,
|
| 25 |
'label' => Mage::helper('iparcel')->getTaxLabel(),
|
| 26 |
'value' => $value
|
app/code/community/Iparcel/All/Helper/Api.php
CHANGED
|
@@ -54,20 +54,6 @@ class Iparcel_All_Helper_Api
|
|
| 54 |
return $response;
|
| 55 |
}
|
| 56 |
|
| 57 |
-
/**
|
| 58 |
-
* Send REST XML requests
|
| 59 |
-
*
|
| 60 |
-
* Wrapper for _rest() that sends a SimpleXMLElement object to the API.
|
| 61 |
-
*
|
| 62 |
-
* @param SimpleXMLElement $xml XML to send
|
| 63 |
-
* @param string $url REST API URL to send POST data to
|
| 64 |
-
* @return string Response from the POST request
|
| 65 |
-
*/
|
| 66 |
-
protected function _restXML($xml, $url)
|
| 67 |
-
{
|
| 68 |
-
return $this->_rest($xml->asXml, $url, array('Content-Type: text/xml'));
|
| 69 |
-
}
|
| 70 |
-
|
| 71 |
/**
|
| 72 |
* Send REST JSON requests
|
| 73 |
*
|
|
@@ -86,7 +72,15 @@ class Iparcel_All_Helper_Api
|
|
| 86 |
);
|
| 87 |
}
|
| 88 |
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
$attribute = Mage::getModel('eav/entity_attribute')
|
| 91 |
->load(Mage::getStoreConfig('catalog_mapping/attributes/' . $code));
|
| 92 |
if ($attribute->getData()) {
|
|
@@ -175,81 +169,41 @@ class Iparcel_All_Helper_Api
|
|
| 175 |
*/
|
| 176 |
public function quote(Mage_Shipping_Model_Rate_Request $request)
|
| 177 |
{
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
$log = Mage::getModel('iparcel/log');
|
| 180 |
-
|
|
|
|
| 181 |
$log->setController('Quote');
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
$json = array();
|
| 189 |
-
$addressInfo = array();
|
| 190 |
-
$billingStreet = $billingAddress->getStreet();
|
| 191 |
-
$billing = array();
|
| 192 |
-
$billing['City'] = $billingAddress->getCity();
|
| 193 |
-
$billing['CountryCode'] = $billingAddress->getCountryId();
|
| 194 |
-
$billing['Email'] = $quote->getCustomerEmail();
|
| 195 |
-
$billing['FirstName'] = $billingAddress->getFirstname();
|
| 196 |
-
$billing['LastName'] = $billingAddress->getLastname();
|
| 197 |
-
$billing['Phone'] = $billingAddress->getTelephone();
|
| 198 |
-
$billing['PostCode'] = $billingAddress->getPostcode();
|
| 199 |
-
$billing['Region'] = $billingAddress->getRegion();
|
| 200 |
-
for ($i=0; $i<count($billingStreet); $i++) {
|
| 201 |
-
$billing['Street'.($i+1)] = $billingStreet[$i];
|
| 202 |
-
}
|
| 203 |
-
$addressInfo['Billing'] = $billing;
|
| 204 |
-
$shippingStreet = explode("\n", $request->getDestStreet());
|
| 205 |
-
$shipping = array();
|
| 206 |
-
$shipping['City'] = $request->getDestCity();
|
| 207 |
-
$shipping['CountryCode'] = $request->getDestCountryId();
|
| 208 |
-
$shipping['Email'] = $quote->getCustomerEmail();
|
| 209 |
-
$shipping['FirstName'] = $shippingAddress->getFirstname();
|
| 210 |
-
$shipping['LastName'] = $shippingAddress->getLastname();
|
| 211 |
-
$shipping['Phone'] = $shippingAddress->getTelephone();
|
| 212 |
-
$shipping['PostCode'] = $request->getDestPostcode();
|
| 213 |
-
$shipping['Region'] = $request->getDestRegionCode();
|
| 214 |
-
foreach($shippingStreet as $key => $value) {
|
| 215 |
-
$shipping['Street' . ($key + 1)] = $value;
|
| 216 |
-
}
|
| 217 |
-
$addressInfo['Shipping'] = $shipping;
|
| 218 |
-
$addressInfo['ControlNumber'] = $quote->getCpf();
|
| 219 |
$json['AddressInfo'] = $addressInfo;
|
| 220 |
$json['CurrencyCode'] = $request->getPackageCurrency()->getCurrencyCode();
|
| 221 |
$json['DDP'] = true;
|
|
|
|
| 222 |
$itemsList = array();
|
| 223 |
foreach ($request->getAllItems() as $item) {
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
//get item price
|
| 228 |
-
$itemPrice = (float)$this->_getProductAttribute($item->getProduct(), 'final_price') ?: (float)$this->_getProductAttribute($item->getProduct(), 'price');
|
| 229 |
-
// if not price and item has parent (is configurable)
|
| 230 |
-
if (!$itemPrice && ($parent=$item->getParentItem())) {
|
| 231 |
-
// get parent price
|
| 232 |
-
$itemPrice = (float)$this->_getProductAttribute($parent->getProduct(), 'final_price') ?: (float)$this->_getProductAttribute($parent->getProduct(), 'price');
|
| 233 |
-
}
|
| 234 |
-
// if still not price
|
| 235 |
-
if (!$itemPrice) {
|
| 236 |
-
// get product price
|
| 237 |
-
$itemPrice = (float)$this->_getProductAttribute($item->getProduct(), 'price');
|
| 238 |
}
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
$
|
| 247 |
-
$
|
| 248 |
-
$lineItem['CustWeightLbs'] = (float)$this->_getProductAttribute($item->getProduct(), 'weight');
|
| 249 |
-
$lineItem['Quantity'] = $item->getTotalQty();
|
| 250 |
-
$lineItem['ValueShopperCurrency'] = $itemPrice;
|
| 251 |
-
$lineItem['ShopperCurrency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 252 |
-
$itemsList[] = $lineItem;
|
| 253 |
}
|
| 254 |
}
|
| 255 |
$json['ItemDetailsList'] = $itemsList;
|
|
@@ -325,57 +279,34 @@ class Iparcel_All_Helper_Api
|
|
| 325 |
*/
|
| 326 |
public function submitParcel(Mage_Sales_Model_Order_Shipment $shipment)
|
| 327 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 328 |
$order = $shipment->getOrder();
|
| 329 |
-
// init log
|
| 330 |
$log = Mage::getModel('iparcel/log');
|
| 331 |
-
|
|
|
|
| 332 |
$log->setController('Submit Parcel');
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
|
|
|
|
|
|
| 337 |
$json = array();
|
| 338 |
-
$addressInfo = array();
|
| 339 |
-
$billingStreet = $billingAddress->getStreet();
|
| 340 |
-
$billing = array();
|
| 341 |
-
$billing['City'] = $billingAddress->getCity();
|
| 342 |
-
$billing['CountryCode'] = $billingAddress->getCountryId();
|
| 343 |
-
$billing['Email'] = $order->getCustomerEmail();
|
| 344 |
-
$billing['FirstName'] = $billingAddress->getFirstname();
|
| 345 |
-
$billing['LastName'] = $billingAddress->getLastname();
|
| 346 |
-
$billing['Phone'] = $billingAddress->getTelephone();
|
| 347 |
-
$billing['PostCode'] = $billingAddress->getPostcode();
|
| 348 |
-
$billing['Region'] = $billingAddress->getRegion();
|
| 349 |
-
$billing['Street1'] = $billingStreet[0];
|
| 350 |
-
if (array_key_exists(1, $billingStreet)) {
|
| 351 |
-
$billing['Street2'] = $billingStreet[1];
|
| 352 |
-
}
|
| 353 |
-
$addressInfo['Billing'] = $billing;
|
| 354 |
-
$shippingStreet = $shippingAddress->getStreet();
|
| 355 |
-
$shipping = array();
|
| 356 |
-
$shipping['City'] = $shippingAddress->getCity();
|
| 357 |
-
$shipping['CountryCode'] = $shippingAddress->getCountryId();
|
| 358 |
-
$shipping['Email'] = $order->getCustomerEmail();
|
| 359 |
-
$shipping['FirstName'] = $shippingAddress->getFirstname();
|
| 360 |
-
$shipping['LastName'] = $shippingAddress->getLastname();
|
| 361 |
-
$shipping['Phone'] = $shippingAddress->getTelephone();
|
| 362 |
-
$shipping['PostCode'] = $shippingAddress->getPostcode();
|
| 363 |
-
$shipping['Region'] = $shippingAddress->getRegion();
|
| 364 |
-
$shipping['Street1'] = $shippingStreet[0];
|
| 365 |
-
if (array_key_exists(1, $shippingStreet)) {
|
| 366 |
-
$shipping['Street2'] = $shippingStreet[1];
|
| 367 |
-
}
|
| 368 |
-
$addressInfo['Shipping'] = $shipping;
|
| 369 |
-
$addressInfo['ControlNumber'] = $order->getCpf();
|
| 370 |
$json['AddressInfo'] = $addressInfo;
|
| 371 |
$json['CurrencyCode'] = $order->getOrderCurrencyCode();
|
| 372 |
$json['DDP'] = true;
|
|
|
|
| 373 |
$shipmentItems = $shipment->getAllItems();
|
| 374 |
$itemsList = array();
|
| 375 |
foreach ($shipmentItems as $item) {
|
| 376 |
-
/**
|
| 377 |
-
|
| 378 |
-
|
|
|
|
|
|
|
| 379 |
$orderItem = $item->getOrderItem();
|
| 380 |
if ($orderItem->getProductType() == "configurable") {
|
| 381 |
$itemProduct = $orderItem->getChildrenItems();
|
|
@@ -383,33 +314,10 @@ class Iparcel_All_Helper_Api
|
|
| 383 |
} else {
|
| 384 |
$itemProduct = Mage::getModel('catalog/product')->load($item->getOrderItem()->getProductId());
|
| 385 |
}
|
| 386 |
-
//get item price
|
| 387 |
-
$itemPrice = (float)$item->getFinalPrice() ?: (float)$item->getPrice();
|
| 388 |
-
// if not price and item has parent (is configurable)
|
| 389 |
-
if (!$itemPrice && ($parent=$item->getParentItem())) {
|
| 390 |
-
// get parent price
|
| 391 |
-
$itemPrice = (float)$parent->getFinalPrice() ?: (float)$parent->getPrice();
|
| 392 |
-
}
|
| 393 |
-
// if still not price
|
| 394 |
-
if (!$itemPrice) {
|
| 395 |
-
// get product price
|
| 396 |
-
$itemPrice = (float)$this->_getProductAttribute($item->getProduct(), 'price');
|
| 397 |
-
}
|
| 398 |
-
|
| 399 |
// if product isn't virtual and is configurable or downloadable
|
| 400 |
if ($item["is_virtual"] == false && !in_array($itemProduct->getTypeId(), array('configurable','downloadable'))) {
|
| 401 |
-
|
| 402 |
-
$
|
| 403 |
-
$lineItem['SKU'] = $item->getSku();
|
| 404 |
-
$lineItem['ValueUSD'] = $itemPrice;
|
| 405 |
-
$lineItem['CustWeightLbs'] = (float)$item->getWeight();
|
| 406 |
-
$lineItem['CustLengthInches'] = (float)$item->getLength();
|
| 407 |
-
$lineItem['CustWidthInches'] = (float)$item->getWidth();
|
| 408 |
-
$lineItem['CustHeightInches'] = (float)$item->getHeight();
|
| 409 |
-
$lineItem['Quantity'] = (float)$item->getQty();
|
| 410 |
-
$lineItem['ValueShopperCurrency'] = $itemPrice;
|
| 411 |
-
$lineItem['ShopperCurrency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 412 |
-
$itemsList[] = $lineItem;
|
| 413 |
}
|
| 414 |
}
|
| 415 |
$json['ItemDetailsList'] = $itemsList;
|
|
@@ -627,7 +535,18 @@ class Iparcel_All_Helper_Api
|
|
| 627 |
$item['Length'] = (float)$this->_getProductAttribute($product, 'length');
|
| 628 |
$item['Height'] = (float)$this->_getProductAttribute($product, 'height');
|
| 629 |
$item['Width'] = (float)$this->_getProductAttribute($product, 'width');
|
| 630 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 631 |
|
| 632 |
$item['ProductURL'] = $product->getUrlPath();
|
| 633 |
$item['SKN'] = '';
|
|
@@ -673,7 +592,7 @@ class Iparcel_All_Helper_Api
|
|
| 673 |
* @param Mage_Catalog_Model_Product $product Product with Options
|
| 674 |
* @return array Options array with all product variations
|
| 675 |
*/
|
| 676 |
-
|
| 677 |
{
|
| 678 |
// get product options collection object
|
| 679 |
$options = Mage::getModel('catalog/product_option')
|
|
@@ -765,7 +684,7 @@ class Iparcel_All_Helper_Api
|
|
| 765 |
* @param array $options Array of option arrays (sku, price, title, sort_order, required)
|
| 766 |
* @return array Array of arrays, representing the possible option variations
|
| 767 |
*/
|
| 768 |
-
|
| 769 |
{
|
| 770 |
// filter out empty values
|
| 771 |
$options = array_filter($options);
|
|
@@ -825,6 +744,111 @@ class Iparcel_All_Helper_Api
|
|
| 825 |
return $result;
|
| 826 |
}
|
| 827 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 828 |
/**
|
| 829 |
* Set the URLs for API Calls.
|
| 830 |
*
|
| 54 |
return $response;
|
| 55 |
}
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
/**
|
| 58 |
* Send REST JSON requests
|
| 59 |
*
|
| 72 |
);
|
| 73 |
}
|
| 74 |
|
| 75 |
+
/**
|
| 76 |
+
* Finds the value of attribute matching the extension's configuration
|
| 77 |
+
*
|
| 78 |
+
* @param Mage_Catalog_Model_Product $product
|
| 79 |
+
* @param string $code Attribute code
|
| 80 |
+
* @return string
|
| 81 |
+
*/
|
| 82 |
+
protected function _getProductAttribute(Mage_Catalog_Model_Product $product, $code)
|
| 83 |
+
{
|
| 84 |
$attribute = Mage::getModel('eav/entity_attribute')
|
| 85 |
->load(Mage::getStoreConfig('catalog_mapping/attributes/' . $code));
|
| 86 |
if ($attribute->getData()) {
|
| 169 |
*/
|
| 170 |
public function quote(Mage_Shipping_Model_Rate_Request $request)
|
| 171 |
{
|
| 172 |
+
/**
|
| 173 |
+
* @var Mage_Sales_Model_Quote $quote
|
| 174 |
+
* @var Iparcel_All_Model_Api_Log $log
|
| 175 |
+
*/
|
| 176 |
+
$quote = Mage::getModel('checkout/cart')->getQuote();
|
| 177 |
$log = Mage::getModel('iparcel/log');
|
| 178 |
+
|
| 179 |
+
// init log
|
| 180 |
$log->setController('Quote');
|
| 181 |
+
|
| 182 |
+
/**
|
| 183 |
+
* @var array $addressInfo AddressInfo segment of API call
|
| 184 |
+
* @var array $json Array to be sent to the API
|
| 185 |
+
*/
|
| 186 |
+
$addressInfo = $this->_prepareAddress($quote, $request);
|
| 187 |
$json = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
$json['AddressInfo'] = $addressInfo;
|
| 189 |
$json['CurrencyCode'] = $request->getPackageCurrency()->getCurrencyCode();
|
| 190 |
$json['DDP'] = true;
|
| 191 |
+
|
| 192 |
$itemsList = array();
|
| 193 |
foreach ($request->getAllItems() as $item) {
|
| 194 |
+
// Skip products that belong to a configurable -- we send the configurable product
|
| 195 |
+
if ($item->getParentItemId() !== null) {
|
| 196 |
+
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
}
|
| 198 |
+
|
| 199 |
+
/**
|
| 200 |
+
* @var Mage_Sales_Model_Quote_Item $item
|
| 201 |
+
* @var Mage_Catalog_Model_Product $itemProduct
|
| 202 |
+
*/
|
| 203 |
+
$itemProduct = Mage::getModel('catalog/product')->load($item->getProductId());
|
| 204 |
+
if ($item["is_virtual"] == false && $itemProduct->getTypeId() != 'downloadable') {
|
| 205 |
+
$itemDetails = $this->_getItemDetails($item);
|
| 206 |
+
$itemsList[] = $itemDetails;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
}
|
| 208 |
}
|
| 209 |
$json['ItemDetailsList'] = $itemsList;
|
| 279 |
*/
|
| 280 |
public function submitParcel(Mage_Sales_Model_Order_Shipment $shipment)
|
| 281 |
{
|
| 282 |
+
/**
|
| 283 |
+
* @var Mage_Sales_Model_Order $order
|
| 284 |
+
* @var Iparcel_All_Model_Api_Log $log
|
| 285 |
+
*/
|
| 286 |
$order = $shipment->getOrder();
|
|
|
|
| 287 |
$log = Mage::getModel('iparcel/log');
|
| 288 |
+
|
| 289 |
+
// init log
|
| 290 |
$log->setController('Submit Parcel');
|
| 291 |
+
|
| 292 |
+
/**
|
| 293 |
+
* @var array $addressInfo AddressInfo segment of API call
|
| 294 |
+
* @var array $json Array to be sent to the API
|
| 295 |
+
*/
|
| 296 |
+
$addressInfo = $this->_prepareAddress($order);
|
| 297 |
$json = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
$json['AddressInfo'] = $addressInfo;
|
| 299 |
$json['CurrencyCode'] = $order->getOrderCurrencyCode();
|
| 300 |
$json['DDP'] = true;
|
| 301 |
+
|
| 302 |
$shipmentItems = $shipment->getAllItems();
|
| 303 |
$itemsList = array();
|
| 304 |
foreach ($shipmentItems as $item) {
|
| 305 |
+
/**
|
| 306 |
+
* Check for a configurable product -- the simple should be loaded
|
| 307 |
+
* @var Mage_Sales_Model_Order_Shipment_Item $item
|
| 308 |
+
* @var Mage_Catalog_Model_Product $itemProduct
|
| 309 |
+
*/
|
| 310 |
$orderItem = $item->getOrderItem();
|
| 311 |
if ($orderItem->getProductType() == "configurable") {
|
| 312 |
$itemProduct = $orderItem->getChildrenItems();
|
| 314 |
} else {
|
| 315 |
$itemProduct = Mage::getModel('catalog/product')->load($item->getOrderItem()->getProductId());
|
| 316 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
// if product isn't virtual and is configurable or downloadable
|
| 318 |
if ($item["is_virtual"] == false && !in_array($itemProduct->getTypeId(), array('configurable','downloadable'))) {
|
| 319 |
+
$itemDetails = $this->_getItemDetails($item);
|
| 320 |
+
$itemsList[] = $itemDetails;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
}
|
| 322 |
}
|
| 323 |
$json['ItemDetailsList'] = $itemsList;
|
| 535 |
$item['Length'] = (float)$this->_getProductAttribute($product, 'length');
|
| 536 |
$item['Height'] = (float)$this->_getProductAttribute($product, 'height');
|
| 537 |
$item['Width'] = (float)$this->_getProductAttribute($product, 'width');
|
| 538 |
+
|
| 539 |
+
/**
|
| 540 |
+
* On configurable products, send the weight if one is available,
|
| 541 |
+
* otherwise, send '0.1'. This allows for classification while the
|
| 542 |
+
* simple product is the one actually added to cart and sold.
|
| 543 |
+
*/
|
| 544 |
+
$productWeight = (float)$this->_getProductAttribute($product, 'weight');
|
| 545 |
+
if ($product->getTypeId() == Mage_Catalog_Model_Product_TYPE::TYPE_CONFIGURABLE
|
| 546 |
+
&& $productWeight < 0.1) {
|
| 547 |
+
$productWeight = 0.1;
|
| 548 |
+
}
|
| 549 |
+
$item['Weight'] = $productWeight;
|
| 550 |
|
| 551 |
$item['ProductURL'] = $product->getUrlPath();
|
| 552 |
$item['SKN'] = '';
|
| 592 |
* @param Mage_Catalog_Model_Product $product Product with Options
|
| 593 |
* @return array Options array with all product variations
|
| 594 |
*/
|
| 595 |
+
protected function _findSimpleProductVariants($product)
|
| 596 |
{
|
| 597 |
// get product options collection object
|
| 598 |
$options = Mage::getModel('catalog/product_option')
|
| 684 |
* @param array $options Array of option arrays (sku, price, title, sort_order, required)
|
| 685 |
* @return array Array of arrays, representing the possible option variations
|
| 686 |
*/
|
| 687 |
+
protected function _findVariations($options)
|
| 688 |
{
|
| 689 |
// filter out empty values
|
| 690 |
$options = array_filter($options);
|
| 744 |
return $result;
|
| 745 |
}
|
| 746 |
|
| 747 |
+
/**
|
| 748 |
+
* Accepts a Magento quote or order, then returns an address formatted for
|
| 749 |
+
* the API
|
| 750 |
+
*
|
| 751 |
+
* @param object $object Object to extract address information from
|
| 752 |
+
* @param bool $request If provided, this shipping rate request is used
|
| 753 |
+
* @return array Address information formatted for API requests
|
| 754 |
+
*/
|
| 755 |
+
protected function _prepareAddress($object, $request = false)
|
| 756 |
+
{
|
| 757 |
+
/**
|
| 758 |
+
* @var Mage_Sales_Model_Quote_Address $shippingAddress
|
| 759 |
+
* @var Mage_Sales_Model_Quote_Address $billingAddress
|
| 760 |
+
* @var array $formattedAddress
|
| 761 |
+
*/
|
| 762 |
+
$shippingAddress = $object->getShippingAddress();
|
| 763 |
+
$billingAddress = $object->getBillingAddress();
|
| 764 |
+
$formattedAddress = array();
|
| 765 |
+
|
| 766 |
+
$formattedAddress['Billing'] = $this->_getAddressArray(
|
| 767 |
+
$billingAddress,
|
| 768 |
+
$object->getCustomerEmail()
|
| 769 |
+
);
|
| 770 |
+
|
| 771 |
+
$formattedAddress['Shipping'] = $this->_getAddressArray(
|
| 772 |
+
$shippingAddress,
|
| 773 |
+
$object->getCustomerEmail(),
|
| 774 |
+
$request
|
| 775 |
+
);
|
| 776 |
+
|
| 777 |
+
$formattedAddress['ControlNumber'] = $object->getCpf();
|
| 778 |
+
|
| 779 |
+
return $formattedAddress;
|
| 780 |
+
}
|
| 781 |
+
|
| 782 |
+
/**
|
| 783 |
+
* Used by _prepareAddress() to generate an array of Address information
|
| 784 |
+
*
|
| 785 |
+
* @param object $address Address to act on
|
| 786 |
+
* @param string $emailAddress Email address of the user
|
| 787 |
+
* @param object|bool $request If provided, this shipping rate request is used
|
| 788 |
+
* @return array Formatted address array
|
| 789 |
+
*/
|
| 790 |
+
protected function _getAddressArray($address, $emailAddress, $request = false)
|
| 791 |
+
{
|
| 792 |
+
$formattedAddress = array();
|
| 793 |
+
$formattedAddress['City'] = $request ? $request->getDestCity() : $address->getCity();
|
| 794 |
+
$formattedAddress['CountryCode'] = $request ? $request->getDestCountryId() : $address->getCountryId();
|
| 795 |
+
$formattedAddress['Email'] = $emailAddress;
|
| 796 |
+
$formattedAddress['FirstName'] = $address->getFirstname();
|
| 797 |
+
$formattedAddress['LastName'] = $address->getLastname();
|
| 798 |
+
$formattedAddress['Phone'] = $address->getTelephone();
|
| 799 |
+
$formattedAddress['PostCode'] = $request ? $request->getDestPostcode() : $address->getPostcode();
|
| 800 |
+
$formattedAddress['Region'] = $request ? $request->getDestRegionCode() : $address->getRegion();
|
| 801 |
+
|
| 802 |
+
$street = $request ? explode('\n', $request->getDestStreet()) : $address->getStreet();
|
| 803 |
+
for ($i=0; $i<count($street); $i++) {
|
| 804 |
+
$formattedAddress['Street'.($i+1)] = $street[$i];
|
| 805 |
+
}
|
| 806 |
+
|
| 807 |
+
return $formattedAddress;
|
| 808 |
+
}
|
| 809 |
+
|
| 810 |
+
/**
|
| 811 |
+
* Prepares an item for API requests
|
| 812 |
+
*
|
| 813 |
+
* @param $item
|
| 814 |
+
* @return array
|
| 815 |
+
*/
|
| 816 |
+
private function _getItemDetails($item)
|
| 817 |
+
{
|
| 818 |
+
// Find the corresponding product for the item
|
| 819 |
+
$itemProduct = $item->getProduct();
|
| 820 |
+
if (!$itemProduct) {
|
| 821 |
+
$itemProduct = Mage::getModel('catalog/product')
|
| 822 |
+
->loadByAttribute('sku', $item->getSku());
|
| 823 |
+
}
|
| 824 |
+
|
| 825 |
+
// Find the price of the product
|
| 826 |
+
$itemPrice = (float) $item->getCalculationPrice();
|
| 827 |
+
// if no price and item has parent (is configurable)
|
| 828 |
+
if (!$itemPrice && ($parent = $item->getParentItem())) {
|
| 829 |
+
// get parent price
|
| 830 |
+
$itemPrice = (float)$this->_getProductAttribute($parent->getProduct(), 'final_price') ?: (float)$this->_getProductAttribute($parent->getProduct(), 'price');
|
| 831 |
+
}
|
| 832 |
+
// if still no price
|
| 833 |
+
if (!$itemPrice) {
|
| 834 |
+
// get product price
|
| 835 |
+
$itemPrice = (float)$this->_getProductAttribute($itemProduct, 'price');
|
| 836 |
+
}
|
| 837 |
+
|
| 838 |
+
$lineItem = array();
|
| 839 |
+
$lineItem['SKU'] = $item->getSku();
|
| 840 |
+
$lineItem['ValueUSD'] = $itemPrice;
|
| 841 |
+
$lineItem['CustLengthInches'] = (float)$this->_getProductAttribute($itemProduct, 'length');
|
| 842 |
+
$lineItem['CustHeightInches'] = (float)$this->_getProductAttribute($itemProduct, 'height');
|
| 843 |
+
$lineItem['CustWidthInches'] = (float)$this->_getProductAttribute($itemProduct, 'width');
|
| 844 |
+
$lineItem['CustWeightLbs'] = (float)$this->_getProductAttribute($itemProduct, 'weight');
|
| 845 |
+
$lineItem['Quantity'] = $item->getTotalQty() ?: $item->getQty();
|
| 846 |
+
$lineItem['ValueShopperCurrency'] = $itemPrice;
|
| 847 |
+
$lineItem['ShopperCurrency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 848 |
+
|
| 849 |
+
return $lineItem;
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
/**
|
| 853 |
* Set the URLs for API Calls.
|
| 854 |
*
|
app/code/community/Iparcel/All/Helper/Data.php
CHANGED
|
@@ -295,4 +295,31 @@ class Iparcel_All_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 295 |
$allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();
|
| 296 |
return array_key_exists($name, $allExtensions);
|
| 297 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
}
|
| 295 |
$allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();
|
| 296 |
return array_key_exists($name, $allExtensions);
|
| 297 |
}
|
| 298 |
+
|
| 299 |
+
/**
|
| 300 |
+
* Gathers extension versions for any installed i-parcel extensions
|
| 301 |
+
*
|
| 302 |
+
* @return array
|
| 303 |
+
*/
|
| 304 |
+
public function gatherExtensionVersions()
|
| 305 |
+
{
|
| 306 |
+
$extensions = array(
|
| 307 |
+
'Iparcel_All' => 0,
|
| 308 |
+
'Iparcel_CartHandoff' => 0,
|
| 309 |
+
'Iparcel_GlobaleCommerce' => 0,
|
| 310 |
+
'Iparcel_Logistics' => 0
|
| 311 |
+
);
|
| 312 |
+
|
| 313 |
+
$allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();
|
| 314 |
+
|
| 315 |
+
foreach ($extensions as $key => &$version) {
|
| 316 |
+
if (array_key_exists($key, $allExtensions)) {
|
| 317 |
+
$version = $allExtensions[$key]['version'];
|
| 318 |
+
} else {
|
| 319 |
+
unset($extensions[$key]);
|
| 320 |
+
}
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
return $extensions;
|
| 324 |
+
}
|
| 325 |
}
|
app/code/community/Iparcel/All/Model/Carrier/Abstract.php
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* i-parcel shipping method model
|
| 4 |
+
*
|
| 5 |
+
* @category Iparcel
|
| 6 |
+
* @package Iparcel_All
|
| 7 |
+
* @author Bobby Burden <bburden@i-parcel.com>
|
| 8 |
+
*/
|
| 9 |
+
abstract class Iparcel_All_Model_Carrier_Abstract extends Mage_Shipping_Model_Carrier_Abstract
|
| 10 |
+
{
|
| 11 |
+
protected $_trackingUrl = 'https://tracking.i-parcel.com/secure/track.aspx?track=';
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* Check if carrier has shipping label option available
|
| 15 |
+
*
|
| 16 |
+
* @return bool
|
| 17 |
+
*/
|
| 18 |
+
public function isShippingLabelsAvailable()
|
| 19 |
+
{
|
| 20 |
+
return true;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Check if carrier has shipping tracking option available
|
| 25 |
+
*
|
| 26 |
+
* @return bool
|
| 27 |
+
*/
|
| 28 |
+
public function isTrackingAvailable()
|
| 29 |
+
{
|
| 30 |
+
return true;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Get info for track order page
|
| 35 |
+
*
|
| 36 |
+
* @param string $number Tracking Number
|
| 37 |
+
* @return Varien_Object
|
| 38 |
+
*/
|
| 39 |
+
public function getTrackingInfo($number)
|
| 40 |
+
{
|
| 41 |
+
return new Varien_Object(array(
|
| 42 |
+
'tracking' => $number,
|
| 43 |
+
'carrier_title' => $this->getConfigData('title'),
|
| 44 |
+
'url' => $this->_trackingUrl.$number
|
| 45 |
+
));
|
| 46 |
+
}
|
| 47 |
+
}
|
app/code/community/Iparcel/All/Model/Carrier/Iparcel.php
CHANGED
|
@@ -6,47 +6,10 @@
|
|
| 6 |
* @package Iparcel_All
|
| 7 |
* @author Bobby Burden <bburden@i-parcel.com>
|
| 8 |
*/
|
| 9 |
-
class Iparcel_All_Model_Carrier_Iparcel extends
|
| 10 |
{
|
| 11 |
protected $_code = 'iparcel';
|
| 12 |
|
| 13 |
-
protected $_trackingUrl = 'https://tracking.i-parcel.com/secure/track.aspx?track=';
|
| 14 |
-
|
| 15 |
-
/**
|
| 16 |
-
* Check if carrier has shipping label option available
|
| 17 |
-
*
|
| 18 |
-
* @return bool
|
| 19 |
-
*/
|
| 20 |
-
public function isShippingLabelsAvailable()
|
| 21 |
-
{
|
| 22 |
-
return true;
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
/**
|
| 26 |
-
* Check if carrier has shipping tracking option available
|
| 27 |
-
*
|
| 28 |
-
* @return bool
|
| 29 |
-
*/
|
| 30 |
-
public function isTrackingAvailable()
|
| 31 |
-
{
|
| 32 |
-
return true;
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
/**
|
| 36 |
-
* Get info for track order page
|
| 37 |
-
*
|
| 38 |
-
* @param string $number Tracking Number
|
| 39 |
-
* @return Varien_Object
|
| 40 |
-
*/
|
| 41 |
-
public function getTrackingInfo($number)
|
| 42 |
-
{
|
| 43 |
-
return new Varien_Object(array(
|
| 44 |
-
'tracking' => $number,
|
| 45 |
-
'carrier_title' => $this->getConfigData('title'),
|
| 46 |
-
'url' => $this->_trackingUrl.$number
|
| 47 |
-
));
|
| 48 |
-
}
|
| 49 |
-
|
| 50 |
/**
|
| 51 |
* Return container types of carrier
|
| 52 |
*
|
| 6 |
* @package Iparcel_All
|
| 7 |
* @author Bobby Burden <bburden@i-parcel.com>
|
| 8 |
*/
|
| 9 |
+
class Iparcel_All_Model_Carrier_Iparcel extends Iparcel_All_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
|
| 10 |
{
|
| 11 |
protected $_code = 'iparcel';
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
/**
|
| 14 |
* Return container types of carrier
|
| 15 |
*
|
app/code/community/Iparcel/All/Model/Config/Script/Js.php
CHANGED
|
@@ -21,11 +21,6 @@ class Iparcel_All_Model_Config_Script_Js extends Mage_Adminhtml_Model_System_Con
|
|
| 21 |
|
| 22 |
$file = $uploadDir.'/'.$this->getValue();
|
| 23 |
|
| 24 |
-
// if it's delete action and file exists
|
| 25 |
-
if ($delete && file_exists($file)) {
|
| 26 |
-
unlink($file);
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
// if it's set new action and old file exists
|
| 30 |
$file = $uploadDir.'/'. $_FILES['groups']['name'][$this->getGroupId()]['fields'][$this->getField()]['value'];
|
| 31 |
if (file_exists($file)) {
|
| 21 |
|
| 22 |
$file = $uploadDir.'/'.$this->getValue();
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
// if it's set new action and old file exists
|
| 25 |
$file = $uploadDir.'/'. $_FILES['groups']['name'][$this->getGroupId()]['fields'][$this->getField()]['value'];
|
| 26 |
if (file_exists($file)) {
|
app/code/community/Iparcel/All/Model/Observer.php
CHANGED
|
@@ -8,6 +8,32 @@
|
|
| 8 |
*/
|
| 9 |
class Iparcel_All_Model_Observer
|
| 10 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
/**
|
| 12 |
* Handles triggering the submitParcel call for the shipment.
|
| 13 |
*
|
|
@@ -33,28 +59,47 @@ class Iparcel_All_Model_Observer
|
|
| 33 |
return;
|
| 34 |
}
|
| 35 |
|
|
|
|
|
|
|
| 36 |
$order = $observer->getShipment()->getOrder();
|
| 37 |
-
if ($order->getShippingCarrier() && $order->getShippingCarrier()->getCarrierCode() ==
|
| 38 |
-
$
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
$serviceLevels = Mage::helper('iparcel')->getServiceLevels();
|
| 43 |
-
$responseServiceLevelId = $response->ServiceLevels[0][0]->ServiceLevelID;
|
| 44 |
-
$serviceLevelTitle = 'I-Parcel';
|
| 45 |
-
if (array_key_exists($responseServiceLevelId, $serviceLevels)) {
|
| 46 |
-
$serviceLevelTitle = $serviceLevels[$responseServiceLevelId];
|
| 47 |
-
}
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
}
|
| 59 |
|
| 60 |
/**
|
|
@@ -74,41 +119,18 @@ class Iparcel_All_Model_Observer
|
|
| 74 |
if (!$order->getQuote()) {
|
| 75 |
return;
|
| 76 |
}
|
|
|
|
|
|
|
|
|
|
| 77 |
// if it's i-parcel shipping method
|
| 78 |
-
if ($order->getShippingCarrier() && $order->getShippingCarrier()->getCarrierCode() !=
|
| 79 |
return;
|
| 80 |
}
|
| 81 |
|
| 82 |
// if autoship is enabled and order can be shipped
|
| 83 |
if (Mage::getStoreConfigFlag('carriers/iparcel/autoship')) {
|
| 84 |
if ($order->canShip()) {
|
| 85 |
-
$
|
| 86 |
-
/* var $converter Mage_Sales_Model_Convert_Order */
|
| 87 |
-
$shipment = $converter->toShipment($order);
|
| 88 |
-
/* var $shipment Mage_Sales_Model_Order_Shipment */
|
| 89 |
-
foreach ($order->getAllItems() as $orderItem) {
|
| 90 |
-
/* var $orderItem Mage_Sales_Model_Order_Item */
|
| 91 |
-
// continue if it is virtual or there is no quantity to ship
|
| 92 |
-
if (!$orderItem->getQtyToShip()) {
|
| 93 |
-
continue;
|
| 94 |
-
}
|
| 95 |
-
if ($order->getIsVirtual()) {
|
| 96 |
-
continue;
|
| 97 |
-
}
|
| 98 |
-
$item = $converter->itemToShipmentItem($orderItem);
|
| 99 |
-
/* var $item Mage_Sales_Model_Order_Shipment_Item */
|
| 100 |
-
$item->setQty($orderItem->getQtyToShip());
|
| 101 |
-
$shipment->addItem($item);
|
| 102 |
-
}
|
| 103 |
-
$shipment->register();
|
| 104 |
-
$shipment->getOrder()->setIsInProcess(true);
|
| 105 |
-
$transactionSave = Mage::getModel('core/resource_transaction')
|
| 106 |
-
->addObject($shipment)
|
| 107 |
-
->addObject($order);
|
| 108 |
-
/* var $transactionSave Mage_Core_Model_Resource_Transaction */
|
| 109 |
-
$transactionSave->save();
|
| 110 |
-
$shipment->save();
|
| 111 |
-
$shipment->sendEmail();
|
| 112 |
}
|
| 113 |
}
|
| 114 |
}
|
|
@@ -189,8 +211,9 @@ class Iparcel_All_Model_Observer
|
|
| 189 |
$iparcelDuty = $shippingAddress->getIparcelDutyAmount();
|
| 190 |
} else {
|
| 191 |
$carrier = $cart->getSalesEntity()->getShippingCarrier();
|
|
|
|
| 192 |
|
| 193 |
-
if (is_object($carrier) && $carrier->getCarrierCode() ==
|
| 194 |
$iparcelTax = $cart->getSalesEntity()->getIparcelTaxAmount();
|
| 195 |
$iparcelDuty = $cart->getSalesEntity()->getIparcelDutyAmount();
|
| 196 |
}
|
| 8 |
*/
|
| 9 |
class Iparcel_All_Model_Observer
|
| 10 |
{
|
| 11 |
+
/**
|
| 12 |
+
* @param $shipment
|
| 13 |
+
* @param $order
|
| 14 |
+
*/
|
| 15 |
+
protected function _submitParcel($shipment, $order)
|
| 16 |
+
{
|
| 17 |
+
$api = Mage::helper('iparcel/api');
|
| 18 |
+
$response = $api->submitParcel($shipment);
|
| 19 |
+
|
| 20 |
+
// Find the name of the Service Level as defined in the Admin
|
| 21 |
+
$serviceLevels = Mage::helper('iparcel')->getServiceLevels();
|
| 22 |
+
$responseServiceLevelId = $response->ServiceLevels[0][0]->ServiceLevelID;
|
| 23 |
+
$serviceLevelTitle = 'I-Parcel';
|
| 24 |
+
if (array_key_exists($responseServiceLevelId, $serviceLevels)) {
|
| 25 |
+
$serviceLevelTitle = $serviceLevels[$responseServiceLevelId];
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
// Add tracking number from submitParcel response
|
| 29 |
+
Mage::getModel('sales/order_shipment_api')->addTrack(
|
| 30 |
+
$shipment->getIncrementId(),
|
| 31 |
+
$order->getShippingCarrier()->getCarrierCode(),
|
| 32 |
+
$serviceLevelTitle,
|
| 33 |
+
$response->CarrierTrackingNumber
|
| 34 |
+
);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
/**
|
| 38 |
* Handles triggering the submitParcel call for the shipment.
|
| 39 |
*
|
| 59 |
return;
|
| 60 |
}
|
| 61 |
|
| 62 |
+
$iparcelCarrierCode = Mage::getModel('iparcel/payment_iparcel')->getCode();
|
| 63 |
+
|
| 64 |
$order = $observer->getShipment()->getOrder();
|
| 65 |
+
if ($order->getShippingCarrier() && $order->getShippingCarrier()->getCarrierCode() == $iparcelCarrierCode) {
|
| 66 |
+
$this->_submitParcel($shipment, $order);
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
/**
|
| 72 |
+
* @param $order
|
| 73 |
+
*/
|
| 74 |
+
protected function _createShipment($order)
|
| 75 |
+
{
|
| 76 |
+
$converter = Mage::getModel('sales/convert_order');
|
| 77 |
+
/* var $converter Mage_Sales_Model_Convert_Order */
|
| 78 |
+
$shipment = $converter->toShipment($order);
|
| 79 |
+
/* var $shipment Mage_Sales_Model_Order_Shipment */
|
| 80 |
+
foreach ($order->getAllItems() as $orderItem) {
|
| 81 |
+
/* var $orderItem Mage_Sales_Model_Order_Item */
|
| 82 |
+
// continue if it is virtual or there is no quantity to ship
|
| 83 |
+
if (!$orderItem->getQtyToShip()) {
|
| 84 |
+
continue;
|
| 85 |
+
}
|
| 86 |
+
if ($order->getIsVirtual()) {
|
| 87 |
+
continue;
|
| 88 |
}
|
| 89 |
+
$item = $converter->itemToShipmentItem($orderItem);
|
| 90 |
+
/* var $item Mage_Sales_Model_Order_Shipment_Item */
|
| 91 |
+
$item->setQty($orderItem->getQtyToShip());
|
| 92 |
+
$shipment->addItem($item);
|
| 93 |
}
|
| 94 |
+
$shipment->register();
|
| 95 |
+
$shipment->getOrder()->setIsInProcess(true);
|
| 96 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
| 97 |
+
->addObject($shipment)
|
| 98 |
+
->addObject($order);
|
| 99 |
+
/* var $transactionSave Mage_Core_Model_Resource_Transaction */
|
| 100 |
+
$transactionSave->save();
|
| 101 |
+
$shipment->save();
|
| 102 |
+
$shipment->sendEmail();
|
| 103 |
}
|
| 104 |
|
| 105 |
/**
|
| 119 |
if (!$order->getQuote()) {
|
| 120 |
return;
|
| 121 |
}
|
| 122 |
+
|
| 123 |
+
$iparcelCarrierCode = Mage::getModel('iparcel/payment_iparcel')->getCode();
|
| 124 |
+
|
| 125 |
// if it's i-parcel shipping method
|
| 126 |
+
if ($order->getShippingCarrier() && $order->getShippingCarrier()->getCarrierCode() != $iparcelCarrierCode) {
|
| 127 |
return;
|
| 128 |
}
|
| 129 |
|
| 130 |
// if autoship is enabled and order can be shipped
|
| 131 |
if (Mage::getStoreConfigFlag('carriers/iparcel/autoship')) {
|
| 132 |
if ($order->canShip()) {
|
| 133 |
+
$this->_createShipment($order);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
}
|
| 135 |
}
|
| 136 |
}
|
| 211 |
$iparcelDuty = $shippingAddress->getIparcelDutyAmount();
|
| 212 |
} else {
|
| 213 |
$carrier = $cart->getSalesEntity()->getShippingCarrier();
|
| 214 |
+
$iparcelCarrierCode = Mage::getModel('iparcel/payment_iparcel')->getCode();
|
| 215 |
|
| 216 |
+
if (is_object($carrier) && $carrier->getCarrierCode() == $iparcelCarrierCode) {
|
| 217 |
$iparcelTax = $cart->getSalesEntity()->getIparcelTaxAmount();
|
| 218 |
$iparcelDuty = $cart->getSalesEntity()->getIparcelDutyAmount();
|
| 219 |
}
|
app/code/community/Iparcel/All/Model/Payment/Iparcel.php
CHANGED
|
@@ -13,4 +13,17 @@ class Iparcel_All_Model_Payment_Iparcel extends Mage_Payment_Model_Method_Abstra
|
|
| 13 |
protected $_canUseForMultishipping = false;
|
| 14 |
protected $_canUseInternal = false;
|
| 15 |
protected $_canCapture = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 13 |
protected $_canUseForMultishipping = false;
|
| 14 |
protected $_canUseInternal = false;
|
| 15 |
protected $_canCapture = true;
|
| 16 |
+
|
| 17 |
+
protected $_taxCode = 'iparcel_tax';
|
| 18 |
+
protected $_dutyCode = 'iparcel_duty';
|
| 19 |
+
|
| 20 |
+
public function getTaxCode()
|
| 21 |
+
{
|
| 22 |
+
return $this->_taxCode;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function getDutyCode()
|
| 26 |
+
{
|
| 27 |
+
return $this->_dutyCode;
|
| 28 |
+
}
|
| 29 |
}
|
app/code/community/Iparcel/All/Model/Quote/Address/Total/Abstract.php
CHANGED
|
@@ -16,9 +16,10 @@ class Iparcel_All_Model_Quote_Address_Total_Abstract extends Mage_Sales_Model_Qu
|
|
| 16 |
*/
|
| 17 |
public function isIparcelShipping($address)
|
| 18 |
{
|
|
|
|
| 19 |
$shippingMethod = $address->getShippingMethod();
|
| 20 |
$shippingMethod = explode('_', $shippingMethod);
|
| 21 |
-
if ($shippingMethod[0] ==
|
| 22 |
return true;
|
| 23 |
}
|
| 24 |
return false;
|
| 16 |
*/
|
| 17 |
public function isIparcelShipping($address)
|
| 18 |
{
|
| 19 |
+
$iparcelCarrierCode = Mage::getModel('iparcel/payment_iparcel')->getCode();
|
| 20 |
$shippingMethod = $address->getShippingMethod();
|
| 21 |
$shippingMethod = explode('_', $shippingMethod);
|
| 22 |
+
if ($shippingMethod[0] == $iparcelCarrierCode) {
|
| 23 |
return true;
|
| 24 |
}
|
| 25 |
return false;
|
app/code/community/Iparcel/All/Model/Quote/Address/Total/Collector.php
CHANGED
|
@@ -17,8 +17,8 @@ class Iparcel_All_Model_Quote_Address_Total_Collector extends Mage_Sales_Model_Q
|
|
| 17 |
$collectors = parent::getCollectors();
|
| 18 |
|
| 19 |
$totals = array(
|
| 20 |
-
'
|
| 21 |
-
'
|
| 22 |
'grand_total',
|
| 23 |
'reward',
|
| 24 |
'giftcardaccount',
|
|
@@ -39,7 +39,7 @@ class Iparcel_All_Model_Quote_Address_Total_Collector extends Mage_Sales_Model_Q
|
|
| 39 |
* @param array $array
|
| 40 |
* @return array
|
| 41 |
*/
|
| 42 |
-
|
| 43 |
{
|
| 44 |
if (isset($array[$index])) {
|
| 45 |
$temp = $array[$index];
|
| 17 |
$collectors = parent::getCollectors();
|
| 18 |
|
| 19 |
$totals = array(
|
| 20 |
+
Mage::getModel('iparcel/payment_iparcel')->getTaxCode(),
|
| 21 |
+
Mage::getModel('iparcel/payment_iparcel')->getDutyCode(),
|
| 22 |
'grand_total',
|
| 23 |
'reward',
|
| 24 |
'giftcardaccount',
|
| 39 |
* @param array $array
|
| 40 |
* @return array
|
| 41 |
*/
|
| 42 |
+
protected function _moveIndexToEnd($index, $array)
|
| 43 |
{
|
| 44 |
if (isset($array[$index])) {
|
| 45 |
$temp = $array[$index];
|
app/code/community/Iparcel/All/Model/Quote/Address/Total/Duty.php
CHANGED
|
@@ -10,7 +10,7 @@ class Iparcel_All_Model_Quote_Address_Total_Duty extends Iparcel_All_Model_Quote
|
|
| 10 |
{
|
| 11 |
public function __construct()
|
| 12 |
{
|
| 13 |
-
$this->setCode('
|
| 14 |
}
|
| 15 |
|
| 16 |
/**
|
| 10 |
{
|
| 11 |
public function __construct()
|
| 12 |
{
|
| 13 |
+
$this->setCode(Mage::getModel('iparcel/payment_iparcel')->getDutyCode());
|
| 14 |
}
|
| 15 |
|
| 16 |
/**
|
app/code/community/Iparcel/All/Model/Quote/Address/Total/Tax.php
CHANGED
|
@@ -10,7 +10,7 @@ class Iparcel_All_Model_Quote_Address_Total_Tax extends Iparcel_All_Model_Quote_
|
|
| 10 |
{
|
| 11 |
public function __construct()
|
| 12 |
{
|
| 13 |
-
$this->setCode('
|
| 14 |
}
|
| 15 |
|
| 16 |
/**
|
| 10 |
{
|
| 11 |
public function __construct()
|
| 12 |
{
|
| 13 |
+
$this->setCode(Mage::getModel('iparcel/payment_iparcel')->getTaxCode());
|
| 14 |
}
|
| 15 |
|
| 16 |
/**
|
app/code/community/Iparcel/All/Model/System/Config/Catalog/Mapping.php
CHANGED
|
@@ -66,5 +66,7 @@ class Iparcel_All_Model_System_Config_Catalog_Mapping extends Mage_Core_Model_Co
|
|
| 66 |
throw new Exception(Mage::helper('cron')->__('Unable to remove the cron expression'));
|
| 67 |
}
|
| 68 |
}
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
}
|
| 66 |
throw new Exception(Mage::helper('cron')->__('Unable to remove the cron expression'));
|
| 67 |
}
|
| 68 |
}
|
| 69 |
+
|
| 70 |
+
return parent::_afterSave();
|
| 71 |
}
|
| 72 |
}
|
app/code/community/Iparcel/All/Model/Tax/Quote/Shipping.php
CHANGED
|
@@ -13,7 +13,7 @@ class Iparcel_All_Model_Tax_Quote_Shipping extends Mage_Tax_Model_Sales_Total_Qu
|
|
| 13 |
*
|
| 14 |
* @return Iparcel_All_Model_Quote_Address_Total_Abstract
|
| 15 |
*/
|
| 16 |
-
|
| 17 |
{
|
| 18 |
$model = new Iparcel_All_Model_Quote_Address_Total_Abstract;
|
| 19 |
return $model;
|
| 13 |
*
|
| 14 |
* @return Iparcel_All_Model_Quote_Address_Total_Abstract
|
| 15 |
*/
|
| 16 |
+
protected function _getAbstract()
|
| 17 |
{
|
| 18 |
$model = new Iparcel_All_Model_Quote_Address_Total_Abstract;
|
| 19 |
return $model;
|
app/code/community/Iparcel/All/Model/Tax/Quote/Subtotal.php
CHANGED
|
@@ -13,7 +13,7 @@ class Iparcel_All_Model_Tax_Quote_Subtotal extends Mage_Tax_Model_Sales_Total_Qu
|
|
| 13 |
*
|
| 14 |
* @return Iparcel_All_Model_Quote_Address_Total_Abstract
|
| 15 |
*/
|
| 16 |
-
|
| 17 |
{
|
| 18 |
$model = new Iparcel_All_Model_Quote_Address_Total_Abstract;
|
| 19 |
return $model;
|
| 13 |
*
|
| 14 |
* @return Iparcel_All_Model_Quote_Address_Total_Abstract
|
| 15 |
*/
|
| 16 |
+
protected function _getAbstract()
|
| 17 |
{
|
| 18 |
$model = new Iparcel_All_Model_Quote_Address_Total_Abstract;
|
| 19 |
return $model;
|
app/code/community/Iparcel/All/Model/Tax/Quote/Tax.php
CHANGED
|
@@ -13,7 +13,7 @@ class Iparcel_All_Model_Tax_Quote_Tax extends Mage_Tax_Model_Sales_Total_Quote_T
|
|
| 13 |
*
|
| 14 |
* @return Iparcel_All_Model_Quote_Address_Total_Abstract
|
| 15 |
*/
|
| 16 |
-
|
| 17 |
{
|
| 18 |
$model = new Iparcel_All_Model_Quote_Address_Total_Abstract;
|
| 19 |
return $model;
|
| 13 |
*
|
| 14 |
* @return Iparcel_All_Model_Quote_Address_Total_Abstract
|
| 15 |
*/
|
| 16 |
+
protected function _getAbstract()
|
| 17 |
{
|
| 18 |
$model = new Iparcel_All_Model_Quote_Address_Total_Abstract;
|
| 19 |
return $model;
|
app/code/community/Iparcel/All/controllers/Adminhtml/Iparcel/Sync/AjaxController.php
CHANGED
|
@@ -108,51 +108,53 @@ class Iparcel_All_Adminhtml_Iparcel_Sync_AjaxController extends Mage_Adminhtml_C
|
|
| 108 |
}
|
| 109 |
}
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
/**
|
| 112 |
* Submit Catalog request action
|
| 113 |
*/
|
| 114 |
public function catalogAction()
|
| 115 |
{
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
// proceed it
|
| 119 |
-
$params = $this->getRequest()->getParams();
|
| 120 |
-
$params['type'] = '_'.$params['type'].'CatalogResponse';
|
| 121 |
-
if (method_exists($this, $params['type'])) {
|
| 122 |
-
$_response = $this->$params['type']($params);
|
| 123 |
-
$this->getResponse()
|
| 124 |
-
->setHeader('Content-type', 'application/json', true)
|
| 125 |
-
->setBody(json_encode($_response));
|
| 126 |
-
return;
|
| 127 |
-
}
|
| 128 |
-
} else {
|
| 129 |
-
// show layout if not
|
| 130 |
-
$this->loadLayout();
|
| 131 |
-
$this->renderLayout();
|
| 132 |
-
}
|
| 133 |
}
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
/**
|
| 136 |
* Check Items request action
|
| 137 |
*/
|
| 138 |
public function checkitemsAction()
|
| 139 |
{
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
// proceed it
|
| 143 |
-
$params = $this->getRequest()->getParams();
|
| 144 |
-
$params['type'] = '_'.$params['type'].'CheckItemsResponse';
|
| 145 |
-
if (method_exists($this, $params['type'])) {
|
| 146 |
-
$_response = $this->$params['type']($params);
|
| 147 |
-
$this->getResponse()
|
| 148 |
-
->setHeader('Content-type', 'application/json', true)
|
| 149 |
-
->setBody(json_encode($_response));
|
| 150 |
-
return;
|
| 151 |
-
}
|
| 152 |
-
} else {
|
| 153 |
-
// show layout if not
|
| 154 |
-
$this->loadLayout();
|
| 155 |
-
$this->renderLayout();
|
| 156 |
-
}
|
| 157 |
}
|
| 158 |
}
|
| 108 |
}
|
| 109 |
}
|
| 110 |
|
| 111 |
+
/**
|
| 112 |
+
* Submit Catalog request json action
|
| 113 |
+
*/
|
| 114 |
+
public function catalogJsonAction()
|
| 115 |
+
{
|
| 116 |
+
$params = $this->getRequest()->getParams();
|
| 117 |
+
$params['type'] = '_'.$params['type'].'CatalogResponse';
|
| 118 |
+
if (method_exists($this, $params['type'])) {
|
| 119 |
+
$_response = $this->$params['type']($params);
|
| 120 |
+
$this->getResponse()
|
| 121 |
+
->setHeader('Content-type', 'application/json', true)
|
| 122 |
+
->setBody(json_encode($_response));
|
| 123 |
+
return;
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
/**
|
| 128 |
* Submit Catalog request action
|
| 129 |
*/
|
| 130 |
public function catalogAction()
|
| 131 |
{
|
| 132 |
+
$this->loadLayout();
|
| 133 |
+
$this->renderLayout();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
}
|
| 135 |
|
| 136 |
+
/**
|
| 137 |
+
* Check Items request json action
|
| 138 |
+
*/
|
| 139 |
+
public function checkitemsJsonAction()
|
| 140 |
+
{
|
| 141 |
+
$params = $this->getRequest()->getParams();
|
| 142 |
+
$params['type'] = '_'.$params['type'].'CheckItemsResponse';
|
| 143 |
+
if (method_exists($this, $params['type'])) {
|
| 144 |
+
$_response = $this->$params['type']($params);
|
| 145 |
+
$this->getResponse()
|
| 146 |
+
->setHeader('Content-type', 'application/json', true)
|
| 147 |
+
->setBody(json_encode($_response));
|
| 148 |
+
return;
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
/**
|
| 153 |
* Check Items request action
|
| 154 |
*/
|
| 155 |
public function checkitemsAction()
|
| 156 |
{
|
| 157 |
+
$this->loadLayout();
|
| 158 |
+
$this->renderLayout();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
}
|
| 160 |
}
|
app/code/community/Iparcel/All/controllers/InfoController.php
CHANGED
|
@@ -13,36 +13,10 @@ class Iparcel_All_InfoController extends Mage_Core_Controller_Front_Action
|
|
| 13 |
*/
|
| 14 |
public function indexAction()
|
| 15 |
{
|
| 16 |
-
$versions =
|
| 17 |
|
| 18 |
foreach ($versions as $key => $version) {
|
| 19 |
print "<b>$key</b>: $version<br />";
|
| 20 |
}
|
| 21 |
}
|
| 22 |
-
|
| 23 |
-
/**
|
| 24 |
-
* Gathers extension versions for any installed i-parcel extensions
|
| 25 |
-
*
|
| 26 |
-
* @return array
|
| 27 |
-
*/
|
| 28 |
-
private function _gatherExtensionVersions()
|
| 29 |
-
{
|
| 30 |
-
$extensions = array(
|
| 31 |
-
'Iparcel_All' => 0,
|
| 32 |
-
'Iparcel_GlobaleCommerce' => 0,
|
| 33 |
-
'Iparcel_Logistics' => 0
|
| 34 |
-
);
|
| 35 |
-
|
| 36 |
-
$allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();
|
| 37 |
-
|
| 38 |
-
foreach ($extensions as $key => &$version) {
|
| 39 |
-
if (array_key_exists($key, $allExtensions)) {
|
| 40 |
-
$version = $allExtensions[$key]['version'];
|
| 41 |
-
} else {
|
| 42 |
-
unset($extensions[$key]);
|
| 43 |
-
}
|
| 44 |
-
}
|
| 45 |
-
|
| 46 |
-
return $extensions;
|
| 47 |
-
}
|
| 48 |
}
|
| 13 |
*/
|
| 14 |
public function indexAction()
|
| 15 |
{
|
| 16 |
+
$versions = Mage::helper('iparcel')->gatherExtensionVersions();
|
| 17 |
|
| 18 |
foreach ($versions as $key => $version) {
|
| 19 |
print "<b>$key</b>: $version<br />";
|
| 20 |
}
|
| 21 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
app/code/community/Iparcel/All/controllers/InternationalController.php
CHANGED
|
@@ -26,10 +26,10 @@ class Iparcel_All_InternationalController extends Mage_Core_Controller_Front_Act
|
|
| 26 |
$this->_prepareHeaders();
|
| 27 |
$current = Mage::helper('iparcel/international')->getInternational();
|
| 28 |
if ($current) {
|
| 29 |
-
|
| 30 |
} else {
|
| 31 |
Mage::helper('iparcel/international')->setInternational(true);
|
| 32 |
-
|
| 33 |
}
|
| 34 |
}
|
| 35 |
|
|
@@ -42,9 +42,9 @@ class Iparcel_All_InternationalController extends Mage_Core_Controller_Front_Act
|
|
| 42 |
$current = Mage::helper('iparcel/international')->getInternational();
|
| 43 |
if ($current) {
|
| 44 |
Mage::helper('iparcel/international')->setInternational(false);
|
| 45 |
-
|
| 46 |
} else {
|
| 47 |
-
|
| 48 |
}
|
| 49 |
}
|
| 50 |
}
|
| 26 |
$this->_prepareHeaders();
|
| 27 |
$current = Mage::helper('iparcel/international')->getInternational();
|
| 28 |
if ($current) {
|
| 29 |
+
$this->getResponse()->setBody('false');
|
| 30 |
} else {
|
| 31 |
Mage::helper('iparcel/international')->setInternational(true);
|
| 32 |
+
$this->getResponse()->setBody('true');
|
| 33 |
}
|
| 34 |
}
|
| 35 |
|
| 42 |
$current = Mage::helper('iparcel/international')->getInternational();
|
| 43 |
if ($current) {
|
| 44 |
Mage::helper('iparcel/international')->setInternational(false);
|
| 45 |
+
$this->getResponse()->setBody('true');
|
| 46 |
} else {
|
| 47 |
+
$this->getResponse()->setBody('false');
|
| 48 |
}
|
| 49 |
}
|
| 50 |
}
|
app/code/community/Iparcel/CartHandoff/Helper/Api.php
CHANGED
|
@@ -41,19 +41,6 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
|
|
| 41 |
|
| 42 |
// If one or both of these are not set, use the defaults from the
|
| 43 |
// customer.
|
| 44 |
-
if ($quoteShippingAddress->getEmail() == null) {
|
| 45 |
-
// Pull the default shipping address from the customer
|
| 46 |
-
$customerDefaultShipping = $helper->getDefaultAddress($customer, true);
|
| 47 |
-
if (is_null($customerDefaultShipping)) {
|
| 48 |
-
$shippingAddress = null;
|
| 49 |
-
} else {
|
| 50 |
-
$shippingAddress = $this->_buildAddress($customerDefaultShipping, true, $customer->getEmail());
|
| 51 |
-
}
|
| 52 |
-
} else {
|
| 53 |
-
// Set the address information from the quote shipping address
|
| 54 |
-
$shippingAddress = $this->_buildAddress($quoteShippingAddress, true);
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
if ($quoteBillingAddress->getEmail() == null) {
|
| 58 |
// Pull the default billing address from the customer
|
| 59 |
$customerDefaultBilling = $helper->getDefaultAddress($customer, false);
|
|
@@ -70,6 +57,19 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
|
|
| 70 |
$phoneNumber = $quoteBillingAddress->getTelephone();
|
| 71 |
}
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
if ($cancelUrl == false) {
|
| 74 |
$cancelUrl = Mage::getUrl('checkout/cart');
|
| 75 |
}
|
|
@@ -122,7 +122,7 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
|
|
| 122 |
foreach($quoteItems as $item) {
|
| 123 |
if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
|
| 124 |
// If no price is attached to this item, load it from the parent item
|
| 125 |
-
$price = $item->
|
| 126 |
$qty = $item->getTotalQty();
|
| 127 |
if ($price == '0' || is_null($price)) {
|
| 128 |
$parentItem = $item->getParentItem();
|
|
@@ -208,7 +208,7 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
|
|
| 208 |
Mage::logException($e);
|
| 209 |
$return = array (
|
| 210 |
'status' => 0,
|
| 211 |
-
'message' => 'An error
|
| 212 |
);
|
| 213 |
return (object) $return;
|
| 214 |
}
|
|
@@ -340,8 +340,10 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
|
|
| 340 |
}
|
| 341 |
} else {
|
| 342 |
// Build the $eligibleSKUs array from the cache
|
| 343 |
-
foreach ($cache as $sku => $
|
| 344 |
-
$
|
|
|
|
|
|
|
| 345 |
}
|
| 346 |
}
|
| 347 |
|
|
@@ -602,6 +604,7 @@ class Iparcel_CartHandoff_Helper_Api extends Iparcel_All_Helper_Api
|
|
| 602 |
|
| 603 |
// Create shipment with tracking number
|
| 604 |
$order = Mage::getModel('sales/order')->loadByIncrementId($order->getIncrementId());
|
|
|
|
| 605 |
$itemsToShip = array();
|
| 606 |
foreach ($order->getAllItems() as $item) {
|
| 607 |
$itemsToShip[$item->getItemId()] = $item->getQtyOrdered();
|
| 41 |
|
| 42 |
// If one or both of these are not set, use the defaults from the
|
| 43 |
// customer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
if ($quoteBillingAddress->getEmail() == null) {
|
| 45 |
// Pull the default billing address from the customer
|
| 46 |
$customerDefaultBilling = $helper->getDefaultAddress($customer, false);
|
| 57 |
$phoneNumber = $quoteBillingAddress->getTelephone();
|
| 58 |
}
|
| 59 |
|
| 60 |
+
if ($quoteShippingAddress->getAddressId() == null) {
|
| 61 |
+
// Pull the default shipping address from the customer
|
| 62 |
+
$customerDefaultShipping = $helper->getDefaultAddress($customer, true);
|
| 63 |
+
if (is_null($customerDefaultShipping)) {
|
| 64 |
+
$shippingAddress = null;
|
| 65 |
+
} else {
|
| 66 |
+
$shippingAddress = $this->_buildAddress($customerDefaultShipping, true, $billingAddress['email']);
|
| 67 |
+
}
|
| 68 |
+
} else {
|
| 69 |
+
// Set the address information from the quote shipping address
|
| 70 |
+
$shippingAddress = $this->_buildAddress($quoteShippingAddress, true, $billingAddress['email']);
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
if ($cancelUrl == false) {
|
| 74 |
$cancelUrl = Mage::getUrl('checkout/cart');
|
| 75 |
}
|
| 122 |
foreach($quoteItems as $item) {
|
| 123 |
if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
|
| 124 |
// If no price is attached to this item, load it from the parent item
|
| 125 |
+
$price = $item->getPrice();
|
| 126 |
$qty = $item->getTotalQty();
|
| 127 |
if ($price == '0' || is_null($price)) {
|
| 128 |
$parentItem = $item->getParentItem();
|
| 208 |
Mage::logException($e);
|
| 209 |
$return = array (
|
| 210 |
'status' => 0,
|
| 211 |
+
'message' => 'An error occurred when processing your order.'
|
| 212 |
);
|
| 213 |
return (object) $return;
|
| 214 |
}
|
| 340 |
}
|
| 341 |
} else {
|
| 342 |
// Build the $eligibleSKUs array from the cache
|
| 343 |
+
foreach ($cache as $sku => $data) {
|
| 344 |
+
if ($data['eligible']) {
|
| 345 |
+
$eligibleSKUs[$sku] = $data['price'];
|
| 346 |
+
}
|
| 347 |
}
|
| 348 |
}
|
| 349 |
|
| 604 |
|
| 605 |
// Create shipment with tracking number
|
| 606 |
$order = Mage::getModel('sales/order')->loadByIncrementId($order->getIncrementId());
|
| 607 |
+
$order->sendNewOrderEmail();
|
| 608 |
$itemsToShip = array();
|
| 609 |
foreach ($order->getAllItems() as $item) {
|
| 610 |
$itemsToShip[$item->getItemId()] = $item->getQtyOrdered();
|
app/code/community/Iparcel/CartHandoff/Helper/Data.php
CHANGED
|
@@ -49,7 +49,10 @@ class Iparcel_CartHandoff_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 49 |
*/
|
| 50 |
public function getCheckoutUrl($transactionId)
|
| 51 |
{
|
| 52 |
-
$key = Mage::getStoreConfig('iparcel/config/
|
|
|
|
|
|
|
|
|
|
| 53 |
return $this->_cartUrl . '?key=' . $key . '&tx=' . $transactionId;
|
| 54 |
}
|
| 55 |
|
| 49 |
*/
|
| 50 |
public function getCheckoutUrl($transactionId)
|
| 51 |
{
|
| 52 |
+
$key = Mage::getStoreConfig('iparcel/config/publickey');
|
| 53 |
+
if (is_null($key) || $key == '') {
|
| 54 |
+
$key = Mage::getStoreConfig('iparcel/config/userid');
|
| 55 |
+
}
|
| 56 |
return $this->_cartUrl . '?key=' . $key . '&tx=' . $transactionId;
|
| 57 |
}
|
| 58 |
|
app/code/community/Iparcel/CartHandoff/Model/Checkitems.php
CHANGED
|
@@ -52,10 +52,14 @@ class Iparcel_CartHandoff_Model_Checkitems extends Mage_Core_Model_Abstract
|
|
| 52 |
|
| 53 |
$checkItems->setSku($product->getSku());
|
| 54 |
$checkItems->setCountry($country);
|
| 55 |
-
$checkItems->setUpdatedAt(0);
|
| 56 |
$checkItems->setStoreId($storeId);
|
| 57 |
$checkItems->setPrice($price);
|
| 58 |
$checkItems->setEligible($eligibile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
$checkItems->save();
|
| 60 |
|
| 61 |
unset($checkItems);
|
|
@@ -97,10 +101,10 @@ class Iparcel_CartHandoff_Model_Checkitems extends Mage_Core_Model_Abstract
|
|
| 97 |
));
|
| 98 |
|
| 99 |
foreach ($cache as $item) {
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
}
|
| 105 |
|
| 106 |
return $results;
|
|
@@ -146,4 +150,16 @@ class Iparcel_CartHandoff_Model_Checkitems extends Mage_Core_Model_Abstract
|
|
| 146 |
return Mage::getModel('core/date')
|
| 147 |
->date('Y-m-d H:i:s ', strtotime('-1 ' . $value));
|
| 148 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
}
|
| 52 |
|
| 53 |
$checkItems->setSku($product->getSku());
|
| 54 |
$checkItems->setCountry($country);
|
|
|
|
| 55 |
$checkItems->setStoreId($storeId);
|
| 56 |
$checkItems->setPrice($price);
|
| 57 |
$checkItems->setEligible($eligibile);
|
| 58 |
+
$checkItems->setUpdatedAt(
|
| 59 |
+
Mage::getModel('core/date')
|
| 60 |
+
->date('Y-m-d H:i:s', strtotime('now')
|
| 61 |
+
)
|
| 62 |
+
);
|
| 63 |
$checkItems->save();
|
| 64 |
|
| 65 |
unset($checkItems);
|
| 101 |
));
|
| 102 |
|
| 103 |
foreach ($cache as $item) {
|
| 104 |
+
$results[$item->getSku()] = array(
|
| 105 |
+
'price' => $item->getPrice(),
|
| 106 |
+
'eligible' => $item->getEligible()
|
| 107 |
+
);
|
| 108 |
}
|
| 109 |
|
| 110 |
return $results;
|
| 150 |
return Mage::getModel('core/date')
|
| 151 |
->date('Y-m-d H:i:s ', strtotime('-1 ' . $value));
|
| 152 |
}
|
| 153 |
+
|
| 154 |
+
public function save()
|
| 155 |
+
{
|
| 156 |
+
$currentTime = Mage::getModel('core/date')
|
| 157 |
+
->date('Y-m-d H:i:s', strtotime('now'));
|
| 158 |
+
if ((!$this->getId() || $this->isObjectNew()) && !$this->getCreatedAt()) {
|
| 159 |
+
$this->setCreatedAt($currentTime);
|
| 160 |
+
$this->setUpdatedAt($currentTime);
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
return parent::save();
|
| 164 |
+
}
|
| 165 |
}
|
app/code/community/Iparcel/CartHandoff/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Iparcel_CartHandoff>
|
| 5 |
-
<version>1.4.
|
| 6 |
</Iparcel_CartHandoff>
|
| 7 |
</modules>
|
| 8 |
<global>
|
|
@@ -105,6 +105,7 @@
|
|
| 105 |
<payment_method_message>You will be redirected to UPS i-parcel to complete checkout.</payment_method_message>
|
| 106 |
<cart_placement>2</cart_placement>
|
| 107 |
<hide_proceed_to_checkout>0</hide_proceed_to_checkout>
|
|
|
|
| 108 |
<send_new_order_emails>1</send_new_order_emails>
|
| 109 |
</ipcarthandoff>
|
| 110 |
</payment>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Iparcel_CartHandoff>
|
| 5 |
+
<version>1.4.2</version>
|
| 6 |
</Iparcel_CartHandoff>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 105 |
<payment_method_message>You will be redirected to UPS i-parcel to complete checkout.</payment_method_message>
|
| 106 |
<cart_placement>2</cart_placement>
|
| 107 |
<hide_proceed_to_checkout>0</hide_proceed_to_checkout>
|
| 108 |
+
<hide_other_checkout_methods>0</hide_other_checkout_methods>
|
| 109 |
<send_new_order_emails>1</send_new_order_emails>
|
| 110 |
</ipcarthandoff>
|
| 111 |
</payment>
|
app/code/community/Iparcel/CartHandoff/etc/system.xml
CHANGED
|
@@ -48,7 +48,7 @@
|
|
| 48 |
<show_in_store>1</show_in_store>
|
| 49 |
</cart_placement>
|
| 50 |
<hide_proceed_to_checkout>
|
| 51 |
-
<label>Hide the "Proceed to Checkout" button in the cart for
|
| 52 |
<frontend_type>select</frontend_type>
|
| 53 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 54 |
<sort_order>17</sort_order>
|
|
@@ -56,6 +56,15 @@
|
|
| 56 |
<show_in_website>1</show_in_website>
|
| 57 |
<show_in_store>1</show_in_store>
|
| 58 |
</hide_proceed_to_checkout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
<active>
|
| 60 |
<label>Display as Payment Method?</label>
|
| 61 |
<tooltip>Adds the button to the "Payment Method" checkout step.</tooltip>
|
|
@@ -119,6 +128,18 @@
|
|
| 119 |
</payment>
|
| 120 |
<iparcel>
|
| 121 |
<groups>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
<tax>
|
| 123 |
<show_in_default>1</show_in_default>
|
| 124 |
<show_in_website>1</show_in_website>
|
| 48 |
<show_in_store>1</show_in_store>
|
| 49 |
</cart_placement>
|
| 50 |
<hide_proceed_to_checkout>
|
| 51 |
+
<label>Hide the "Proceed to Checkout" button in the cart for International Customers.</label>
|
| 52 |
<frontend_type>select</frontend_type>
|
| 53 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 54 |
<sort_order>17</sort_order>
|
| 56 |
<show_in_website>1</show_in_website>
|
| 57 |
<show_in_store>1</show_in_store>
|
| 58 |
</hide_proceed_to_checkout>
|
| 59 |
+
<hide_other_checkout_methods>
|
| 60 |
+
<label>Hide other payment methods in the cart (PayPal, Amazon, etc) for International Customers</label>
|
| 61 |
+
<frontend_type>select</frontend_type>
|
| 62 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 63 |
+
<sort_order>18</sort_order>
|
| 64 |
+
<show_in_default>1</show_in_default>
|
| 65 |
+
<show_in_website>1</show_in_website>
|
| 66 |
+
<show_in_store>1</show_in_store>
|
| 67 |
+
</hide_other_checkout_methods>
|
| 68 |
<active>
|
| 69 |
<label>Display as Payment Method?</label>
|
| 70 |
<tooltip>Adds the button to the "Payment Method" checkout step.</tooltip>
|
| 128 |
</payment>
|
| 129 |
<iparcel>
|
| 130 |
<groups>
|
| 131 |
+
<config>
|
| 132 |
+
<fields>
|
| 133 |
+
<publickey translate="label">
|
| 134 |
+
<label>Public API Key</label>
|
| 135 |
+
<frontend_type>text</frontend_type>
|
| 136 |
+
<sort_order>10</sort_order>
|
| 137 |
+
<show_in_default>1</show_in_default>
|
| 138 |
+
<show_in_website>1</show_in_website>
|
| 139 |
+
<show_in_store>0</show_in_store>
|
| 140 |
+
</publickey>
|
| 141 |
+
</fields>
|
| 142 |
+
</config>
|
| 143 |
<tax>
|
| 144 |
<show_in_default>1</show_in_default>
|
| 145 |
<show_in_website>1</show_in_website>
|
app/code/community/Iparcel/CartHandoff/sql/ipcarthandoff_setup/mysql4-upgrade-1.2.0-1.3.0.php
CHANGED
|
@@ -8,8 +8,8 @@ $installer->run("
|
|
| 8 |
DROP TABLE IF EXISTS {$this->getTable('ipcarthandoff/checkitems')};
|
| 9 |
CREATE TABLE {$this->getTable('ipcarthandoff/checkitems')} (
|
| 10 |
`id` int(11) unsigned NOT NULL auto_increment,
|
| 11 |
-
`created_at`
|
| 12 |
-
`updated_at`
|
| 13 |
`sku` varchar(255) NOT NULL,
|
| 14 |
`country` varchar(3) NOT NULL,
|
| 15 |
`store_id` int(11) unsigned NOT NULL,
|
| 8 |
DROP TABLE IF EXISTS {$this->getTable('ipcarthandoff/checkitems')};
|
| 9 |
CREATE TABLE {$this->getTable('ipcarthandoff/checkitems')} (
|
| 10 |
`id` int(11) unsigned NOT NULL auto_increment,
|
| 11 |
+
`created_at` datetime default NULL,
|
| 12 |
+
`updated_at` datetime default NULL,
|
| 13 |
`sku` varchar(255) NOT NULL,
|
| 14 |
`country` varchar(3) NOT NULL,
|
| 15 |
`store_id` int(11) unsigned NOT NULL,
|
app/design/adminhtml/default/default/template/iparcel/sync/ajax/catalog.phtml
CHANGED
|
@@ -18,6 +18,6 @@
|
|
| 18 |
</div>
|
| 19 |
<script type="text/javascript">
|
| 20 |
jQuery(document).ready(function() {
|
| 21 |
-
var sync = new iparcelSync.sync('<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/iparcel_sync_ajax/
|
| 22 |
})
|
| 23 |
</script>
|
| 18 |
</div>
|
| 19 |
<script type="text/javascript">
|
| 20 |
jQuery(document).ready(function() {
|
| 21 |
+
var sync = new iparcelSync.sync('<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/iparcel_sync_ajax/catalogJson') ?>', <?php echo Mage::getStoreConfig('catalog_mapping/upload/step'); ?>);
|
| 22 |
})
|
| 23 |
</script>
|
app/design/adminhtml/default/default/template/iparcel/sync/ajax/checkitems.phtml
CHANGED
|
@@ -17,5 +17,5 @@
|
|
| 17 |
<p>There was <span>0</span> errors when checking items</p>
|
| 18 |
</div>
|
| 19 |
<script type="text/javascript">
|
| 20 |
-
var sync = new iparcelSync.sync('<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/iparcel_sync_ajax/
|
| 21 |
</script>
|
| 17 |
<p>There was <span>0</span> errors when checking items</p>
|
| 18 |
</div>
|
| 19 |
<script type="text/javascript">
|
| 20 |
+
var sync = new iparcelSync.sync('<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/iparcel_sync_ajax/checkitemsJson') ?>', 1);
|
| 21 |
</script>
|
app/design/frontend/base/default/template/iparcel/carthandoff/button.phtml
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
*/
|
| 7 |
|
| 8 |
$cartHandoff_hideCheckout = Mage::getStoreConfig('payment/ipcarthandoff/hide_proceed_to_checkout') ? 'true' : 'false';
|
|
|
|
| 9 |
?>
|
| 10 |
<?php if ($this->shouldDisplay()): ?>
|
| 11 |
<p class="ipcarthandoff-button" style="<?php echo $this->getStyle() ?>">
|
|
@@ -16,4 +17,5 @@ $cartHandoff_hideCheckout = Mage::getStoreConfig('payment/ipcarthandoff/hide_pro
|
|
| 16 |
<?php endif; ?>
|
| 17 |
<script type="text/javascript">
|
| 18 |
cartHandoff_hideCheckout = <?php echo (string) $cartHandoff_hideCheckout; ?>;
|
|
|
|
| 19 |
</script>
|
| 6 |
*/
|
| 7 |
|
| 8 |
$cartHandoff_hideCheckout = Mage::getStoreConfig('payment/ipcarthandoff/hide_proceed_to_checkout') ? 'true' : 'false';
|
| 9 |
+
$cartHandoff_hideOtherMethods = Mage::getStoreConfig('payment/ipcarthandoff/hide_other_checkout_methods') ? 'true' : 'false';
|
| 10 |
?>
|
| 11 |
<?php if ($this->shouldDisplay()): ?>
|
| 12 |
<p class="ipcarthandoff-button" style="<?php echo $this->getStyle() ?>">
|
| 17 |
<?php endif; ?>
|
| 18 |
<script type="text/javascript">
|
| 19 |
cartHandoff_hideCheckout = <?php echo (string) $cartHandoff_hideCheckout; ?>;
|
| 20 |
+
cartHandoff_hideOtherMethods = <?php echo (string) $cartHandoff_hideOtherMethods; ?>;
|
| 21 |
</script>
|
js/iparcel/cart-buttons.js
CHANGED
|
@@ -2,6 +2,7 @@ document.observe("dom:loaded", function(){
|
|
| 2 |
if (ipar_Session.locale != 'US') {
|
| 3 |
setButtonVisibility('ipcarthandoff-button', 'block');
|
| 4 |
setButtonVisibility('btn-proceed-checkout', 'none');
|
|
|
|
| 5 |
}
|
| 6 |
|
| 7 |
if ($('country')) {
|
|
@@ -9,9 +10,11 @@ document.observe("dom:loaded", function(){
|
|
| 9 |
if (this.value == 'US') {
|
| 10 |
setButtonVisibility('ipcarthandoff-button', 'none');
|
| 11 |
setButtonVisibility('btn-proceed-checkout', 'block');
|
|
|
|
| 12 |
} else {
|
| 13 |
setButtonVisibility('ipcarthandoff-button', 'block');
|
| 14 |
setButtonVisibility('btn-proceed-checkout', 'none');
|
|
|
|
| 15 |
}
|
| 16 |
});
|
| 17 |
}
|
|
@@ -26,3 +29,20 @@ function setButtonVisibility(buttonClass, displayValue)
|
|
| 26 |
$(div).style.display = displayValue;
|
| 27 |
});
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
if (ipar_Session.locale != 'US') {
|
| 3 |
setButtonVisibility('ipcarthandoff-button', 'block');
|
| 4 |
setButtonVisibility('btn-proceed-checkout', 'none');
|
| 5 |
+
setCheckoutMethodVisibility(false);
|
| 6 |
}
|
| 7 |
|
| 8 |
if ($('country')) {
|
| 10 |
if (this.value == 'US') {
|
| 11 |
setButtonVisibility('ipcarthandoff-button', 'none');
|
| 12 |
setButtonVisibility('btn-proceed-checkout', 'block');
|
| 13 |
+
setCheckoutMethodVisibility(true);
|
| 14 |
} else {
|
| 15 |
setButtonVisibility('ipcarthandoff-button', 'block');
|
| 16 |
setButtonVisibility('btn-proceed-checkout', 'none');
|
| 17 |
+
setCheckoutMethodVisibility(false);
|
| 18 |
}
|
| 19 |
});
|
| 20 |
}
|
| 29 |
$(div).style.display = displayValue;
|
| 30 |
});
|
| 31 |
}
|
| 32 |
+
|
| 33 |
+
function setCheckoutMethodVisibility(visibility)
|
| 34 |
+
{
|
| 35 |
+
// Give up if hideOtherMethods is disabled
|
| 36 |
+
if (cartHandoff_hideOtherMethods == false) {
|
| 37 |
+
return true;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
$$('.checkout-types li').each(function(li){
|
| 41 |
+
var keep = $(li).select('.btn-proceed-checkout, .ipcarthandoff-button').length;
|
| 42 |
+
if (visibility == false && keep == 0) {
|
| 43 |
+
$(li).style.display = 'none';
|
| 44 |
+
} else {
|
| 45 |
+
$(li).style.display = '';
|
| 46 |
+
}
|
| 47 |
+
});
|
| 48 |
+
}
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>iparcel_carthandoff</name>
|
| 4 |
-
<version>1.4.
|
| 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-07-
|
| 20 |
-
<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"><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="8d73c7c25b536538d4e5a1d603f34f12"/></dir></dir></dir><file name="HandoffController.php" hash="f4537926416afe1d689926475b83cce3"/><file name="StatusController.php" hash="511f645fec406059f956aa915c9138b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e4f3a503dfa55aa0540b87d644cf0631"/><file name="config.xml" hash="c569447b236a50cc607ecaa027d107ac"/><file name="system.xml" hash="a1dee5e055c351328b7e192ee9b5f3ec"/></dir><dir name="Helper"><file name="Api.php" hash="2504fcf62b295618c66d1bcd5c5d0f93"/><file name="Data.php" hash="172cafa812fe216d233f7f7e832ad622"/></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="4cd85d69b947817ad4d806b6fff4083b"/><file name="Observer.php" hash="a9e5f4e690008acee3adbef357d1d60f"/><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="7ca0cb70401d337c7462d0f72108613b"/></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="f8ae79b70c6b5ba41c7acac9be5d84c0"/><file name="Tax.php" hash="1cfee0fccb1feede23f3cdc22f57c903"/></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"/><file name="SyncController.php" hash="9378f5db27d059bbb36ff1e71bd38d32"/><dir name="Shipment"><file name="SplitController.php" hash="6a294947cf9399e42e90c890a6da2caa"/></dir><dir name="Sync"><file name="AjaxController.php" hash="ceaffb0c652954b95e83426c763a2d0d"/></dir></dir></dir><file name="AjaxController.php" hash="f6b0573eefbb21d7ac863fd029783b3c"/><file name="InfoController.php" hash="6543b1e9803489e507d2470f8e3e408b"/><file name="InternationalController.php" hash="75fc93febe96e328d5927665c33d40d1"/></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="bc0872952d20a9a4c7b2a91a644a0017"/><file name="Data.php" hash="0c32ec392ffb3857571f272c21d84faa"/><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="Iparcel.php" hash="ad65fdc9f7f2264e9704b0f17d89dd34"/></dir><dir name="Catalog"><dir name="Product"><file name="Observer.php" hash="d16d89cea8eea6352a7d9b1193cd9512"/></dir></dir><dir name="Config"><dir name="Script"><file name="Js.php" hash="100822286c5326c82cbc5d4ff3cf4c39"/></dir></dir><file name="Cron.php" hash="670d37cd6cdbe60aa69fad8eb0a0759e"/><file name="Log.php" hash="8c87e5f356f8ca77a186430dda106097"/><file name="Observer.php" hash="ad3c34320671927263e673e18c798a34"/><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="30ad607409d5ed225e233638ecbff39c"/></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Abstract.php" hash="a3af320e934f50651e09bfd15b86ffea"/><file name="Collector.php" hash="f99413fe415c342d5c0d582caa767ad1"/><file name="Duty.php" hash="6ef16c8b2038d5c90b4b9c7d00825da2"/><file name="Tax.php" hash="62c9e255562643a967b8c49b9914524d"/></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="8895678aa59e49226509d2b4709c5f43"/></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="5d76b072c657035cf3d7713fa6672f1f"/><file name="Subtotal.php" hash="cbd2e41f3bdc74134590a675d93d4bfb"/><file name="Tax.php" hash="ffc8d78a8d0442690c49b60f909c8e48"/></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="cfb9fbc137e7e551dfaece00ac6bb2f4"/><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="2af5a49d42e702e723bc083c8af661e1"/><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="c6be54da5875c9356bba8988fa8c264c"/></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="64da446db5c1bfe892951c9b3c7f1e7d"/><file name="checkitems.phtml" hash="c19b0e4fd0feddedbc2cef3b2f4ce79b"/></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="a52eb58ce49540c4d206f5e7bbd98ab8"/><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="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/></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.4.2</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-07-29</date>
|
| 20 |
+
<time>20:16:18</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"><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="8d73c7c25b536538d4e5a1d603f34f12"/></dir></dir></dir><file name="HandoffController.php" hash="f4537926416afe1d689926475b83cce3"/><file name="StatusController.php" hash="511f645fec406059f956aa915c9138b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e4f3a503dfa55aa0540b87d644cf0631"/><file name="config.xml" hash="6ca4bd354b7b40d51a0a513a06bef203"/><file name="system.xml" hash="460d426c8b8007051b50e3b9aaa1c3ff"/></dir><dir name="Helper"><file name="Api.php" hash="72679e7cbb51d23e47bc2cf007a71c40"/><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="a9e5f4e690008acee3adbef357d1d60f"/><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"/><file name="SyncController.php" hash="9378f5db27d059bbb36ff1e71bd38d32"/><dir name="Shipment"><file name="SplitController.php" hash="6a294947cf9399e42e90c890a6da2caa"/></dir><dir name="Sync"><file name="AjaxController.php" hash="4ded0f9d50382ca0137d4778176d7c88"/></dir></dir></dir><file name="AjaxController.php" hash="f6b0573eefbb21d7ac863fd029783b3c"/><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="4ab64cc17f7817268517f69486def609"/><file name="Data.php" hash="cababe5f5ba754a09df2aed6405643e7"/><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="f0ea2e007c04f56befed34bc6676de80"/></dir><dir name="Catalog"><dir name="Product"><file name="Observer.php" hash="d16d89cea8eea6352a7d9b1193cd9512"/></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="f6d8d758ed1772ab3c8fd782f2c95183"/><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="cfb9fbc137e7e551dfaece00ac6bb2f4"/><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="c6be54da5875c9356bba8988fa8c264c"/></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="ee1ecd2cf9e8e175e5ca5ceddb197376"/><file name="checkitems.phtml" hash="b47b923ef7f433e41a9bc0d118401659"/></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="ee7d7c02f98b9cd4803d3934d987123a"/><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="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/><file name="shipping-methods.js" hash="eca91e8a5cf152fce7af0eb5bf2991bb"/><file name="sync.js" hash="f4525e5c6bce01f9a5cea562f23618e7"/></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>
|
