Version Notes
Fixed issue with inside delivery and limited delivery not being able to be deselected
Download this release
Release Info
Developer | Karen Baker |
Extension | shipperhq_shipperhq |
Version | 2.151.0 |
Comparing to | |
See all releases |
Code changes from version 2.52.0 to 2.151.0
- app/code/community/Shipperhq/Frontend/Block/Checkout/AbstractBlock.php +7 -0
- app/code/community/Shipperhq/Frontend/Block/Checkout/Helper.php +107 -27
- app/code/community/Shipperhq/Frontend/Block/Checkout/Onepage/Shipping/Method/Available.php +19 -7
- app/code/community/Shipperhq/{Pbint/Model/Inboundparcel.php → Frontend/Block/Checkout/Onepage/Shipping/Method/Comments.php} +42 -40
- app/code/community/Shipperhq/Paypalexpress/Model/Express/Checkout.php +0 -126
- app/code/community/Shipperhq/Paypalexpress/etc/config.xml +0 -47
- app/code/community/Shipperhq/Pbint/Block/Adminhtml/System/Upload.php +0 -73
- app/code/community/Shipperhq/Pbint/Helper/Data.php +0 -64
- app/code/community/Shipperhq/Pbint/Model/Catalog/Category.php +0 -180
- app/code/community/Shipperhq/Pbint/Model/Catalog/Cron.php +0 -151
- app/code/community/Shipperhq/Pbint/Model/Catalog/File.php +0 -862
- app/code/community/Shipperhq/Pbint/Model/Catalog/Product.php +0 -244
- app/code/community/Shipperhq/Pbint/Model/Credentials.php +0 -78
- app/code/community/Shipperhq/Pbint/Model/Creditmemo/Duty.php +0 -75
- app/code/community/Shipperhq/Pbint/Model/Helper.php +0 -224
- app/code/community/Shipperhq/Pbint/Model/Invoice/Duty.php +0 -79
- app/code/community/Shipperhq/Pbint/Model/Mysql4/Inboundparcel/Collection.php +0 -39
- app/code/community/Shipperhq/Pbint/Model/Mysql4/Ordernumber.php +0 -39
- app/code/community/Shipperhq/Pbint/Model/Mysql4/Ordernumber/Collection.php +0 -39
- app/code/community/Shipperhq/Pbint/Model/Mysql4/Variable.php +0 -39
- app/code/community/Shipperhq/Pbint/Model/Mysql4/Variable/Collection.php +0 -39
- app/code/community/Shipperhq/Pbint/Model/Observer.php +0 -171
- app/code/community/Shipperhq/Pbint/Model/Ordernumber.php +0 -40
- app/code/community/Shipperhq/Pbint/Model/Pdf/Duty.php +0 -41
- app/code/community/Shipperhq/Pbint/Model/Quote/Duty.php +0 -90
- app/code/community/Shipperhq/Pbint/Model/Resource/Mysql4/Setup.php +0 -33
- app/code/community/Shipperhq/Pbint/Model/Variable.php +0 -40
- app/code/community/Shipperhq/Pbint/README +0 -2
- app/code/community/Shipperhq/Pbint/changelog.txt +0 -0
- app/code/community/Shipperhq/Pbint/controllers/Adminhtml/ShqpitneyController.php +0 -66
- app/code/community/Shipperhq/Pbint/etc/config.xml +0 -248
- app/code/community/Shipperhq/Pbint/etc/system.xml +0 -162
- app/code/community/Shipperhq/Pbint/sql/shqpbint_setup/mysql4-install-1.0.0.php +0 -72
- app/code/community/Shipperhq/Pbint/sql/shqpbint_setup/mysql4-install-1.0.1.php +0 -73
- app/code/community/Shipperhq/Pbint/sql/shqpbint_setup/mysql4-upgrade-1.0.0-1.0.1.php +0 -29
- app/code/community/Shipperhq/{Pbint/Block/Sales/Order/Duty.php → Shipper/Block/Adminhtml/Carrier/Aboutblank.php} +23 -20
- app/code/community/Shipperhq/Shipper/Block/Adminhtml/Carrier/Notify.php +65 -0
- app/code/community/Shipperhq/Shipper/Block/Adminhtml/Synchronize/Notify.php +4 -2
- app/code/community/Shipperhq/Shipper/Helper/Data.php +299 -73
- app/code/community/Shipperhq/Shipper/Model/Adminhtml/System/Config/Source/Shipping/Allmethods.php +74 -0
- app/code/community/Shipperhq/Shipper/Model/Carrier/Backup.php +30 -22
- app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/AddressMapper.php +8 -2
- app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/OrderMapper.php +1 -1
- app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/ShipmentMapper.php +1 -1
- app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/ShipperMapper.php +52 -18
- app/code/community/Shipperhq/Shipper/Model/Carrier/Shipper.php +185 -97
- app/code/community/Shipperhq/Shipper/Model/Checkout/Helper.php +9 -3
- app/code/community/Shipperhq/Shipper/Model/Observer.php +152 -61
- app/code/community/Shipperhq/Shipper/Model/Observer/Order.php +12 -12
- app/code/community/Shipperhq/Shipper/Model/Resource/Order/Packages.php +3 -2
- app/code/community/Shipperhq/Shipper/Model/Resource/Quote/Packages.php +4 -3
- app/code/community/Shipperhq/Shipper/Model/Sales/Quote/Address/Rate.php +2 -4
- app/code/community/Shipperhq/Shipper/Model/Source/Freight/Freightclass.php +20 -0
- app/code/community/Shipperhq/Shipper/Model/Synchronize.php +17 -16
- app/code/community/Shipperhq/Shipper/changelog.txt +93 -0
- app/code/community/Shipperhq/Shipper/controllers/Adminhtml/ShqajaxController.php +1 -1
- app/code/community/Shipperhq/Shipper/etc/config.xml +38 -3
- app/code/community/Shipperhq/Shipper/etc/system.xml +59 -12
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.31.php +911 -0
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.32.php +911 -0
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.33.php +925 -0
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.34.php +932 -0
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.30-0.0.31.php +27 -0
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.31-0.0.32.php +18 -0
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.32-0.0.33.php +20 -0
- app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.33-0.0.34.php +19 -0
- app/code/community/Webshopapps/Adminshortcut/Helper/Data.php +0 -35
- app/code/community/Webshopapps/Adminshortcut/changelog.txt +0 -1
- app/code/community/Webshopapps/Adminshortcut/etc/adminhtml.xml +0 -88
- app/code/community/Webshopapps/Adminshortcut/etc/config.xml +0 -44
- app/design/adminhtml/default/default/layout/shipperhq/pbint.xml +0 -42
- app/design/adminhtml/default/default/layout/shipperhq/shipper.xml +1 -0
- app/design/adminhtml/default/default/template/shipperhq/frontend/sales/order/create/shipping_method/available.phtml +12 -5
- app/design/adminhtml/default/default/template/shipperhq/migrate_extension.phtml +0 -1
- app/{code/community/Shipperhq/Pbint/Model/Mysql4/Inboundparcel.php → design/adminhtml/default/default/template/shipperhq/shipper/carrier/notify.phtml} +38 -39
- app/design/adminhtml/default/default/template/shipperhq/shipper/synchronize/notify.phtml +1 -1
- app/design/adminhtml/default/default/template/shipperhq/upload.phtml +0 -71
- app/design/frontend/base/default/layout/shipperhq/pbint.xml +0 -65
- app/design/frontend/base/default/template/shipperhq/checkout/cart/rwd/shipping.phtml +15 -1
- app/design/frontend/base/default/template/shipperhq/checkout/cart/shipping.phtml +16 -2
- app/design/frontend/base/default/template/shipperhq/checkout/multishipping/shipping.phtml +10 -3
- app/design/frontend/base/default/template/shipperhq/checkout/onepage/shipping_method/available.phtml +27 -7
- app/design/frontend/base/default/template/shipperhq/checkout/onepage/shipping_method/comments.phtml +30 -0
- app/design/frontend/base/default/template/shipperhq/checkout/onestepcheckout/pickup_review.phtml +0 -1
- app/design/frontend/base/default/template/shipperhq/checkout/onestepcheckout/shipping_method_osc_shq.phtml +25 -8
- app/design/frontend/base/default/template/shipperhq/checkout/onestepcheckout/shipping_method_osc_shq_radio.phtml +19 -4
- app/etc/modules/Shipperhq_Paypalexpress.xml +0 -12
- app/etc/modules/Shipperhq_Pbint.xml +0 -12
- app/locale/en_US/template/email/sales/shipperhq_pitney_shipment_new.html +0 -100
- js/shipperhq/jquery-loader.js +9 -8
- lib/ShipperHQ/Checkout/Cart.php +0 -53
- lib/ShipperHQ/Checkout/Item.php +1 -20
- lib/ShipperHQ/WS/Client/WebServiceClient.php +8 -3
- package.xml +38 -39
- skin/adminhtml/default/default/shipperhq/css/calendarbase.css +133 -0
- skin/adminhtml/default/default/shipperhq/css/storepickup.css +252 -0
- skin/frontend/base/default/css/shipperhq/calendarbase.css +117 -12
- skin/frontend/base/default/css/shipperhq/storepickup.css +179 -77
- skin/frontend/base/default/images/shipperhq/calendar-blk.svg +25 -0
- skin/frontend/base/default/images/shipperhq/calendar-wht.svg +29 -0
- skin/frontend/base/default/images/shipperhq/clock-blk.svg +8 -0
- skin/frontend/base/default/images/shipperhq/clock-wht.svg +11 -0
- skin/frontend/base/default/images/shipperhq/location-blk.svg +11 -0
- skin/frontend/base/default/images/shipperhq/location-wht.svg +14 -0
app/code/community/Shipperhq/Frontend/Block/Checkout/AbstractBlock.php
CHANGED
@@ -48,5 +48,12 @@ abstract class Shipperhq_Frontend_Block_Checkout_AbstractBlock
|
|
48 |
{
|
49 |
return $this->_quote;
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
}
|
48 |
{
|
49 |
return $this->_quote;
|
50 |
}
|
51 |
+
|
52 |
+
public function getStandardErrorMessage()
|
53 |
+
{
|
54 |
+
$errorString = $this->__("Sorry, no quotes are available for this order at this time.");
|
55 |
+
$error = str_replace("'", ''',$errorString);
|
56 |
+
return $error;
|
57 |
+
}
|
58 |
|
59 |
}
|
app/code/community/Shipperhq/Frontend/Block/Checkout/Helper.php
CHANGED
@@ -10,11 +10,12 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
10 |
protected $_calendar;
|
11 |
protected $_rates;
|
12 |
protected $_accessorial;
|
|
|
13 |
|
14 |
|
15 |
/**
|
16 |
* Calendar block name
|
17 |
-
*
|
18 |
* @var string
|
19 |
*/
|
20 |
protected $_calendarBlockType;
|
@@ -28,7 +29,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
28 |
|
29 |
/**
|
30 |
* Store pickup block name
|
31 |
-
*
|
32 |
* @var string
|
33 |
*/
|
34 |
protected $_storePickupBlockType;
|
@@ -54,6 +55,20 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
54 |
*/
|
55 |
protected $_freightAccessorialsBlockTemplate;
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
/**
|
58 |
* Sets debug flag
|
59 |
*/
|
@@ -66,7 +81,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
66 |
|
67 |
/**
|
68 |
* Sets up block properties
|
69 |
-
*
|
70 |
* @param array $options
|
71 |
* @return $this
|
72 |
*/
|
@@ -90,13 +105,19 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
90 |
if (isset($options['accessorials_template'])) {
|
91 |
$this->setFreightAccessorialsBlockTemplate($options['accessorials_template']);
|
92 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
if (isset($options['quote'])) {
|
94 |
$this->setQuote($options['quote']);
|
95 |
-
}
|
96 |
if (isset($options['address'])) {
|
97 |
$this->setAddress($options['address']);
|
98 |
}
|
99 |
-
|
100 |
return $this;
|
101 |
}
|
102 |
|
@@ -166,6 +187,10 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
166 |
$itemsGrouped[$carriergroup]);
|
167 |
$carrierGroupRates[$carriergroup]['plain_item_list']= $itemsGrouped[$carriergroup];
|
168 |
}
|
|
|
|
|
|
|
|
|
169 |
if(array_key_exists($carriergroup, $carrierGroupErrors)) {
|
170 |
$carrierGroupRates[$carriergroup]['error']= $carrierGroupErrors[$carriergroup];
|
171 |
}
|
@@ -333,12 +358,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
333 |
|
334 |
public function getMethodTitle($methodTitle, $methodDescription, $includeContainer)
|
335 |
{
|
336 |
-
$
|
337 |
-
if($includeContainer) {
|
338 |
-
$truncatedTitle = str_replace($methodDescription, '', $methodTitle);
|
339 |
-
$title = '<span class="method-title">'.$truncatedTitle.'</span> <span class="method-extra">'.$methodDescription.'</span>';
|
340 |
-
}
|
341 |
-
return $title;
|
342 |
}
|
343 |
|
344 |
public function showToolTips() {
|
@@ -478,6 +498,14 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
478 |
->toHtml();
|
479 |
}
|
480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
public function isPickupCarrier($rate)
|
482 |
{
|
483 |
if(!Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Pickup')) {
|
@@ -490,10 +518,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
490 |
}
|
491 |
return true;
|
492 |
}
|
493 |
-
|
494 |
-
Mage::helper('wsalogger/log')->postDebug('ShipperHQ Pickup','This carrier is not pickup enabled ',
|
495 |
-
'Carrier: ' .$rate->getCode() .', Type : ' .$rate->getCarrierType());
|
496 |
-
}
|
497 |
return false;
|
498 |
}
|
499 |
|
@@ -510,11 +535,6 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
510 |
}
|
511 |
return true;
|
512 |
}
|
513 |
-
if (self::$_debug) {
|
514 |
-
Mage::helper('wsalogger/log')->postDebug('ShipperHQ Freight','Carrier is NOT freight enabled',
|
515 |
-
'Carrier : ' . $rate->getCode() .', Is freight rate : ' .$rate->getFreightRate()
|
516 |
-
);
|
517 |
-
}
|
518 |
return false;
|
519 |
}
|
520 |
|
@@ -525,6 +545,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
525 |
return $this->_getAccessorial('freight_'.$carrierCode)
|
526 |
->setCarriergroupId($carrierGroup)
|
527 |
->setCarrierCode($carrierCode)
|
|
|
528 |
->setName('accessorial_'.$carrierCode)
|
529 |
->setTemplate($this->getFreightAccessorialsBlockTemplate())
|
530 |
->toHtml();
|
@@ -560,9 +581,20 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
560 |
return $this->_accessorial;
|
561 |
}
|
562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
563 |
/**
|
564 |
* Returns a block type, that should be used for a calendar
|
565 |
-
*
|
566 |
* @return string
|
567 |
*/
|
568 |
public function getStorePickUpBlockType()
|
@@ -572,7 +604,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
572 |
|
573 |
/**
|
574 |
* Sets store pickup block type
|
575 |
-
*
|
576 |
* @param $blockType
|
577 |
* @return $this
|
578 |
*/
|
@@ -584,7 +616,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
584 |
|
585 |
/**
|
586 |
* Returns calendar block type
|
587 |
-
*
|
588 |
* @return string
|
589 |
*/
|
590 |
public function getCalendarBlockType()
|
@@ -594,7 +626,7 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
594 |
|
595 |
/**
|
596 |
* Sets calendar block type
|
597 |
-
*
|
598 |
* @param string $blockType
|
599 |
* @return $this
|
600 |
*/
|
@@ -604,6 +636,51 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
604 |
return $this;
|
605 |
}
|
606 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
/**
|
608 |
* Returns a block type, that should be used for a calendar
|
609 |
*
|
@@ -679,15 +756,13 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
679 |
{
|
680 |
return $this->_freightAccessorialsBlockType;
|
681 |
}
|
682 |
-
|
683 |
-
|
684 |
|
685 |
public function getCarrierName($carrierCode)
|
686 |
{
|
687 |
if ($name = Mage::getStoreConfig('carriers/'.$carrierCode.'/title', $this->getQuote()->getStoreId())) {
|
688 |
return $name;
|
689 |
}
|
690 |
-
|
691 |
return $carrierCode;
|
692 |
}
|
693 |
|
@@ -695,4 +770,9 @@ class Shipperhq_Frontend_Block_Checkout_Helper
|
|
695 |
{
|
696 |
return $this->getAddress()->getShippingMethod();
|
697 |
}
|
|
|
|
|
|
|
|
|
|
|
698 |
}
|
10 |
protected $_calendar;
|
11 |
protected $_rates;
|
12 |
protected $_accessorial;
|
13 |
+
protected $_deliveryComments;
|
14 |
|
15 |
|
16 |
/**
|
17 |
* Calendar block name
|
18 |
+
*
|
19 |
* @var string
|
20 |
*/
|
21 |
protected $_calendarBlockType;
|
29 |
|
30 |
/**
|
31 |
* Store pickup block name
|
32 |
+
*
|
33 |
* @var string
|
34 |
*/
|
35 |
protected $_storePickupBlockType;
|
55 |
*/
|
56 |
protected $_freightAccessorialsBlockTemplate;
|
57 |
|
58 |
+
/**
|
59 |
+
* comments block name
|
60 |
+
*
|
61 |
+
* @var string
|
62 |
+
*/
|
63 |
+
protected $_deliveryCommentsBlockType;
|
64 |
+
|
65 |
+
/*
|
66 |
+
* comments block template
|
67 |
+
*
|
68 |
+
* @var string
|
69 |
+
*/
|
70 |
+
protected $_deliveryCommentsBlockTemplate;
|
71 |
+
|
72 |
/**
|
73 |
* Sets debug flag
|
74 |
*/
|
81 |
|
82 |
/**
|
83 |
* Sets up block properties
|
84 |
+
*
|
85 |
* @param array $options
|
86 |
* @return $this
|
87 |
*/
|
105 |
if (isset($options['accessorials_template'])) {
|
106 |
$this->setFreightAccessorialsBlockTemplate($options['accessorials_template']);
|
107 |
}
|
108 |
+
if (isset($options['delivery_comments_block'])) {
|
109 |
+
$this->setDeliveryCommentsBlockType($options['delivery_comments_block']);
|
110 |
+
}
|
111 |
+
if (isset($options['delivery_comments_template'])) {
|
112 |
+
$this->setDeliveryCommentsBlockTemplate($options['delivery_comments_template']);
|
113 |
+
}
|
114 |
if (isset($options['quote'])) {
|
115 |
$this->setQuote($options['quote']);
|
116 |
+
}
|
117 |
if (isset($options['address'])) {
|
118 |
$this->setAddress($options['address']);
|
119 |
}
|
120 |
+
|
121 |
return $this;
|
122 |
}
|
123 |
|
187 |
$itemsGrouped[$carriergroup]);
|
188 |
$carrierGroupRates[$carriergroup]['plain_item_list']= $itemsGrouped[$carriergroup];
|
189 |
}
|
190 |
+
if($displayMerged && $carriergroup == '') {
|
191 |
+
$carrierGroupRates[$carriergroup]['item_list']= $this->getFormattedItemList($address->getAllItems());
|
192 |
+
$carrierGroupRates[$carriergroup]['plain_item_list']= $address->getAllItems();
|
193 |
+
}
|
194 |
if(array_key_exists($carriergroup, $carrierGroupErrors)) {
|
195 |
$carrierGroupRates[$carriergroup]['error']= $carrierGroupErrors[$carriergroup];
|
196 |
}
|
358 |
|
359 |
public function getMethodTitle($methodTitle, $methodDescription, $includeContainer)
|
360 |
{
|
361 |
+
return Mage::helper('shipperhq_shipper')->getMethodTitle($methodTitle, $methodDescription, $includeContainer);
|
|
|
|
|
|
|
|
|
|
|
362 |
}
|
363 |
|
364 |
public function showToolTips() {
|
498 |
->toHtml();
|
499 |
}
|
500 |
|
501 |
+
public function getDeliveryCommentsHtml()
|
502 |
+
{
|
503 |
+
return $this->_getDeliveryComments()
|
504 |
+
->setName('delivery_comments')
|
505 |
+
->setTemplate($this->getDeliveryCommentsBlockTemplate())
|
506 |
+
->toHtml();
|
507 |
+
}
|
508 |
+
|
509 |
public function isPickupCarrier($rate)
|
510 |
{
|
511 |
if(!Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Pickup')) {
|
518 |
}
|
519 |
return true;
|
520 |
}
|
521 |
+
|
|
|
|
|
|
|
522 |
return false;
|
523 |
}
|
524 |
|
535 |
}
|
536 |
return true;
|
537 |
}
|
|
|
|
|
|
|
|
|
|
|
538 |
return false;
|
539 |
}
|
540 |
|
545 |
return $this->_getAccessorial('freight_'.$carrierCode)
|
546 |
->setCarriergroupId($carrierGroup)
|
547 |
->setCarrierCode($carrierCode)
|
548 |
+
->setCarrierType($carrierType)
|
549 |
->setName('accessorial_'.$carrierCode)
|
550 |
->setTemplate($this->getFreightAccessorialsBlockTemplate())
|
551 |
->toHtml();
|
581 |
return $this->_accessorial;
|
582 |
}
|
583 |
|
584 |
+
protected function _getDeliveryComments($name = '')
|
585 |
+
{
|
586 |
+
if (!$this->_deliveryComments) {
|
587 |
+
$this->_deliveryComments = $this->getLayout()->createBlock($this->getDeliveryCommentsBlockType(), $name);
|
588 |
+
$this->_deliveryComments->setQuote($this->getQuote());
|
589 |
+
$this->_deliveryComments->setAddress($this->getAddress());
|
590 |
+
}
|
591 |
+
|
592 |
+
return $this->_deliveryComments;
|
593 |
+
}
|
594 |
+
|
595 |
/**
|
596 |
* Returns a block type, that should be used for a calendar
|
597 |
+
*
|
598 |
* @return string
|
599 |
*/
|
600 |
public function getStorePickUpBlockType()
|
604 |
|
605 |
/**
|
606 |
* Sets store pickup block type
|
607 |
+
*
|
608 |
* @param $blockType
|
609 |
* @return $this
|
610 |
*/
|
616 |
|
617 |
/**
|
618 |
* Returns calendar block type
|
619 |
+
*
|
620 |
* @return string
|
621 |
*/
|
622 |
public function getCalendarBlockType()
|
626 |
|
627 |
/**
|
628 |
* Sets calendar block type
|
629 |
+
*
|
630 |
* @param string $blockType
|
631 |
* @return $this
|
632 |
*/
|
636 |
return $this;
|
637 |
}
|
638 |
|
639 |
+
/**
|
640 |
+
* Returns comments block type
|
641 |
+
*
|
642 |
+
* @return string
|
643 |
+
*/
|
644 |
+
public function getDeliveryCommentsBlockType()
|
645 |
+
{
|
646 |
+
return $this->_deliveryCommentsBlockType;
|
647 |
+
}
|
648 |
+
|
649 |
+
/**
|
650 |
+
* Sets comments block type
|
651 |
+
*
|
652 |
+
* @param string $blockType
|
653 |
+
* @return $this
|
654 |
+
*/
|
655 |
+
public function setDeliveryCommentsBlockType($blockType)
|
656 |
+
{
|
657 |
+
$this->_deliveryCommentsBlockType = $blockType;
|
658 |
+
return $this;
|
659 |
+
}
|
660 |
+
|
661 |
+
/**
|
662 |
+
* Returns a block type, that should be used for a comments
|
663 |
+
*
|
664 |
+
* @return string
|
665 |
+
*/
|
666 |
+
public function getDeliveryCommentsBlockTemplate()
|
667 |
+
{
|
668 |
+
return $this->_deliveryCommentsBlockTemplate;
|
669 |
+
}
|
670 |
+
|
671 |
+
|
672 |
+
/**
|
673 |
+
* Sets calendar block type
|
674 |
+
*
|
675 |
+
* @param string $blockType
|
676 |
+
* @return $this
|
677 |
+
*/
|
678 |
+
public function setDeliveryCommentsBlockTemplate($template)
|
679 |
+
{
|
680 |
+
$this->_deliveryCommentsBlockTemplate = $template;
|
681 |
+
return $this;
|
682 |
+
}
|
683 |
+
|
684 |
/**
|
685 |
* Returns a block type, that should be used for a calendar
|
686 |
*
|
756 |
{
|
757 |
return $this->_freightAccessorialsBlockType;
|
758 |
}
|
|
|
|
|
759 |
|
760 |
public function getCarrierName($carrierCode)
|
761 |
{
|
762 |
if ($name = Mage::getStoreConfig('carriers/'.$carrierCode.'/title', $this->getQuote()->getStoreId())) {
|
763 |
return $name;
|
764 |
}
|
765 |
+
|
766 |
return $carrierCode;
|
767 |
}
|
768 |
|
770 |
{
|
771 |
return $this->getAddress()->getShippingMethod();
|
772 |
}
|
773 |
+
|
774 |
+
public function showDeliveryComments()
|
775 |
+
{
|
776 |
+
return Mage::getStoreConfig('carriers/shipper/delivery_comments');
|
777 |
+
}
|
778 |
}
|
app/code/community/Shipperhq/Frontend/Block/Checkout/Onepage/Shipping/Method/Available.php
CHANGED
@@ -30,14 +30,14 @@
|
|
30 |
|
31 |
/**
|
32 |
* Provides proxy methods for helper block
|
33 |
-
*
|
34 |
-
* Supplies helper block with render information
|
35 |
*/
|
36 |
class Shipperhq_Frontend_Block_Checkout_Onepage_Shipping_Method_Available extends Mage_Checkout_Block_Onepage_Shipping_Method_Available
|
37 |
{
|
38 |
/**
|
39 |
* Returns a helper block, that is used to retrieve all data
|
40 |
-
*
|
41 |
* @return Shipperhq_Frontend_Block_Checkout_Helper
|
42 |
*/
|
43 |
public function getHelperBlock()
|
@@ -55,12 +55,14 @@ class Shipperhq_Frontend_Block_Checkout_Onepage_Shipping_Method_Available extend
|
|
55 |
'pickup_template' => 'shipperhq/pickup/checkout/onepage/shipping_method/storepickup.phtml',
|
56 |
'accessorials_block' => 'shipperhq_freight/checkout_onepage_shipping_method_accessorials',
|
57 |
'accessorials_template' => 'shipperhq/freight/checkout/onepage/shipping_method/accessorials.phtml',
|
|
|
|
|
58 |
'quote' => $this->getQuote(),
|
59 |
'address' => $this->getAddress()
|
60 |
));
|
61 |
}
|
62 |
-
|
63 |
-
|
64 |
return $this->_helperBlock;
|
65 |
}
|
66 |
|
@@ -91,7 +93,7 @@ class Shipperhq_Frontend_Block_Checkout_Onepage_Shipping_Method_Available extend
|
|
91 |
return $this->getHelperBlock()->getShippingMethodsSelect($name, $id, $value, $rates, $sole);
|
92 |
}
|
93 |
|
94 |
-
|
95 |
public function isShippingMethodSelected($rates)
|
96 |
{
|
97 |
return $this->getHelperBlock()->isShippingMethodSelected($rates);
|
@@ -135,7 +137,7 @@ class Shipperhq_Frontend_Block_Checkout_Onepage_Shipping_Method_Available extend
|
|
135 |
{
|
136 |
return $this->getHelperBlock()->getStorepickupHtml($carrierCode, $carrierType, $carriergroup);
|
137 |
}
|
138 |
-
|
139 |
public function getCalendarHtml($carriergroup, $code, $soleMethod = false)
|
140 |
{
|
141 |
return $this->getHelperBlock()->getCalendarHtml($carriergroup, $code, $soleMethod);
|
@@ -155,4 +157,14 @@ class Shipperhq_Frontend_Block_Checkout_Onepage_Shipping_Method_Available extend
|
|
155 |
{
|
156 |
return $this->getHelperBlock()->getFreightAccessorialsHtml($carrerigroup, $carrierCode, $carrierType);
|
157 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
30 |
|
31 |
/**
|
32 |
* Provides proxy methods for helper block
|
33 |
+
*
|
34 |
+
* Supplies helper block with render information
|
35 |
*/
|
36 |
class Shipperhq_Frontend_Block_Checkout_Onepage_Shipping_Method_Available extends Mage_Checkout_Block_Onepage_Shipping_Method_Available
|
37 |
{
|
38 |
/**
|
39 |
* Returns a helper block, that is used to retrieve all data
|
40 |
+
*
|
41 |
* @return Shipperhq_Frontend_Block_Checkout_Helper
|
42 |
*/
|
43 |
public function getHelperBlock()
|
55 |
'pickup_template' => 'shipperhq/pickup/checkout/onepage/shipping_method/storepickup.phtml',
|
56 |
'accessorials_block' => 'shipperhq_freight/checkout_onepage_shipping_method_accessorials',
|
57 |
'accessorials_template' => 'shipperhq/freight/checkout/onepage/shipping_method/accessorials.phtml',
|
58 |
+
'delivery_comments_block' => 'shipperhq_frontend/checkout_onepage_shipping_method_comments',
|
59 |
+
'delivery_comments_template' => 'shipperhq/checkout/onepage/shipping_method/comments.phtml',
|
60 |
'quote' => $this->getQuote(),
|
61 |
'address' => $this->getAddress()
|
62 |
));
|
63 |
}
|
64 |
+
|
65 |
+
|
66 |
return $this->_helperBlock;
|
67 |
}
|
68 |
|
93 |
return $this->getHelperBlock()->getShippingMethodsSelect($name, $id, $value, $rates, $sole);
|
94 |
}
|
95 |
|
96 |
+
|
97 |
public function isShippingMethodSelected($rates)
|
98 |
{
|
99 |
return $this->getHelperBlock()->isShippingMethodSelected($rates);
|
137 |
{
|
138 |
return $this->getHelperBlock()->getStorepickupHtml($carrierCode, $carrierType, $carriergroup);
|
139 |
}
|
140 |
+
|
141 |
public function getCalendarHtml($carriergroup, $code, $soleMethod = false)
|
142 |
{
|
143 |
return $this->getHelperBlock()->getCalendarHtml($carriergroup, $code, $soleMethod);
|
157 |
{
|
158 |
return $this->getHelperBlock()->getFreightAccessorialsHtml($carrerigroup, $carrierCode, $carrierType);
|
159 |
}
|
160 |
+
|
161 |
+
public function showDeliveryComments()
|
162 |
+
{
|
163 |
+
return $this->getHelperBlock()->showDeliveryComments();
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getDeliveryCommentsHtml()
|
167 |
+
{
|
168 |
+
return $this->getHelperBlock()->getDeliveryCommentsHtml();
|
169 |
+
}
|
170 |
}
|
app/code/community/Shipperhq/{Pbint/Model/Inboundparcel.php → Frontend/Block/Checkout/Onepage/Shipping/Method/Comments.php}
RENAMED
@@ -1,40 +1,42 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
*
|
15 |
-
*
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
*
|
20 |
-
*
|
21 |
-
*
|
22 |
-
*
|
23 |
-
*
|
24 |
-
*
|
25 |
-
* @
|
26 |
-
* @
|
27 |
-
* @
|
28 |
-
* @
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Webshopapps Shipping Module
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* Shipper HQ Shipping
|
23 |
+
*
|
24 |
+
* @category ShipperHQ
|
25 |
+
* @package ShipperHQ_Shipping_Carrier
|
26 |
+
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
+
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
+
*/
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Provides proxy methods for helper block
|
33 |
+
*
|
34 |
+
* Supplies helper block with render information
|
35 |
+
*/
|
36 |
+
class Shipperhq_Frontend_Block_Checkout_Onepage_Shipping_Method_Comments extends Shipperhq_Frontend_Block_Checkout_AbstractBlock
|
37 |
+
{
|
38 |
+
public function getDeliveryCommentsInitialText()
|
39 |
+
{
|
40 |
+
return Mage::getStoreConfig('carriers/shipper/delivery_comments_text');
|
41 |
+
}
|
42 |
+
}
|
app/code/community/Shipperhq/Paypalexpress/Model/Express/Checkout.php
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Shipping
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*
|
30 |
-
* ST_Core_Model_Resource_Iterator_Batched : Kalen Jordan
|
31 |
-
*/
|
32 |
-
class Shipperhq_Paypalexpress_Model_Express_Checkout extends Mage_Paypal_Model_Express_Checkout
|
33 |
-
{
|
34 |
-
|
35 |
-
/*
|
36 |
-
* Resolve bug where PayPal displays the code instead of the name
|
37 |
-
*/
|
38 |
-
protected function _prepareShippingOptions(
|
39 |
-
Mage_Sales_Model_Quote_Address $address,
|
40 |
-
$mayReturnEmpty = false, $calculateTax = false
|
41 |
-
) {
|
42 |
-
$options = array(); $i = 0; $iMin = false; $min = false;
|
43 |
-
$userSelectedOption = null;
|
44 |
-
|
45 |
-
foreach ($address->getGroupedAllShippingRates() as $group) {
|
46 |
-
foreach ($group as $rate) {
|
47 |
-
$amount = (float)$rate->getPrice();
|
48 |
-
if ($rate->getErrorMessage()) {
|
49 |
-
continue;
|
50 |
-
}
|
51 |
-
$isDefault = $address->getShippingMethod() === $rate->getCode();
|
52 |
-
$amountExclTax = Mage::helper('tax')->getShippingPrice($amount, false, $address);
|
53 |
-
$amountInclTax = Mage::helper('tax')->getShippingPrice($amount, true, $address);
|
54 |
-
|
55 |
-
$options[$i] = new Varien_Object(array(
|
56 |
-
'is_default' => $isDefault,
|
57 |
-
'name' => $rate->getCode(),
|
58 |
-
'code' => trim("{$rate->getCarrierTitle()} - {$rate->getMethodTitle()}", ' -'),
|
59 |
-
'amount' => $amountExclTax,
|
60 |
-
));
|
61 |
-
if ($calculateTax) {
|
62 |
-
$options[$i]->setTaxAmount(
|
63 |
-
$amountInclTax - $amountExclTax
|
64 |
-
+ $address->getTaxAmount() - $address->getShippingTaxAmount()
|
65 |
-
);
|
66 |
-
}
|
67 |
-
if ($isDefault) {
|
68 |
-
$userSelectedOption = $options[$i];
|
69 |
-
}
|
70 |
-
if (false === $min || $amountInclTax < $min) {
|
71 |
-
$min = $amountInclTax;
|
72 |
-
$iMin = $i;
|
73 |
-
}
|
74 |
-
$i++;
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
if ($mayReturnEmpty && is_null($userSelectedOption)) {
|
79 |
-
$options[] = new Varien_Object(array(
|
80 |
-
'is_default' => true,
|
81 |
-
'code' => Mage::helper('paypal')->__('N/A'),
|
82 |
-
'name' => 'no_rate',
|
83 |
-
'amount' => 0.00,
|
84 |
-
));
|
85 |
-
if ($calculateTax) {
|
86 |
-
$options[$i]->setTaxAmount($address->getTaxAmount());
|
87 |
-
}
|
88 |
-
} elseif (is_null($userSelectedOption) && isset($options[$iMin])) {
|
89 |
-
$options[$iMin]->setIsDefault(true);
|
90 |
-
}
|
91 |
-
|
92 |
-
// Magento will transfer only first 10 cheapest shipping options if there are more than 10 available.
|
93 |
-
if (count($options) > 10) {
|
94 |
-
usort($options, array(get_class($this),'cmpShippingOptions'));
|
95 |
-
array_splice($options, 10);
|
96 |
-
// User selected option will be always included in options list
|
97 |
-
if (!is_null($userSelectedOption) && !in_array($userSelectedOption, $options)) {
|
98 |
-
$options[9] = $userSelectedOption;
|
99 |
-
}
|
100 |
-
}
|
101 |
-
|
102 |
-
return $options;
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
/*
|
107 |
-
* Reverse code and name in option matching to encompass fix above
|
108 |
-
*
|
109 |
-
*/
|
110 |
-
protected function _matchShippingMethodCode(Mage_Sales_Model_Quote_Address $address, $selectedCode)
|
111 |
-
{
|
112 |
-
$options = $this->_prepareShippingOptions($address, false);
|
113 |
-
foreach ($options as $option) {
|
114 |
-
if ($selectedCode === $option['code'] // the proper case as outlined in documentation
|
115 |
-
|| $selectedCode === $option['name'] // workaround: PayPal may return name instead of the code
|
116 |
-
// workaround: PayPal may concatenate code and name, and return it instead of the code:
|
117 |
-
|| $selectedCode === "{$option['code']} {$option['name']}"
|
118 |
-
) {
|
119 |
-
return $option['name'];
|
120 |
-
}
|
121 |
-
}
|
122 |
-
return '';
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Paypalexpress/etc/config.xml
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Shipping
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
-->
|
32 |
-
<config>
|
33 |
-
<modules>
|
34 |
-
<Shipperhq_Paypalexpress>
|
35 |
-
<version>0.0.1</version>
|
36 |
-
</Shipperhq_Paypalexpress>
|
37 |
-
</modules>
|
38 |
-
<global>
|
39 |
-
<models>
|
40 |
-
<paypal>
|
41 |
-
<rewrite>
|
42 |
-
<express_checkout>Shipperhq_Paypalexpress_Model_Express_Checkout</express_checkout>
|
43 |
-
</rewrite>
|
44 |
-
</paypal>
|
45 |
-
</models>
|
46 |
-
</global>
|
47 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Block/Adminhtml/System/Upload.php
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Block_Adminhtml_System_Upload extends Mage_Adminhtml_Block_System_Config_Form_Field
|
32 |
-
{
|
33 |
-
|
34 |
-
protected function _prepareLayout()
|
35 |
-
{
|
36 |
-
parent::_prepareLayout();
|
37 |
-
if (!$this->getTemplate()) {
|
38 |
-
$this->setTemplate('shipperhq/upload.phtml');
|
39 |
-
}
|
40 |
-
return $this;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Unset some non-related element parameters
|
45 |
-
*
|
46 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
47 |
-
* @return string
|
48 |
-
*/
|
49 |
-
public function render(Varien_Data_Form_Element_Abstract $element)
|
50 |
-
{
|
51 |
-
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
|
52 |
-
return parent::render($element);
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Get the button and scripts contents
|
57 |
-
*
|
58 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
59 |
-
* @return string
|
60 |
-
*/
|
61 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
62 |
-
{
|
63 |
-
$originalData = $element->getOriginalData();
|
64 |
-
$this->addData(array(
|
65 |
-
'button_label' => Mage::helper('customer')->__($originalData['button_label']),
|
66 |
-
'html_id' => $element->getHtmlId(),
|
67 |
-
'ajax_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/Shqpitney/uploadcatalog')
|
68 |
-
));
|
69 |
-
|
70 |
-
return $this->_toHtml();
|
71 |
-
}
|
72 |
-
|
73 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Helper/Data.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Pitney Bowes International
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
|
31 |
-
class Shipperhq_Pbint_Helper_Data extends Mage_Core_Helper_Abstract
|
32 |
-
{
|
33 |
-
protected static $_debug;
|
34 |
-
protected static $code = 'pitney';
|
35 |
-
/**
|
36 |
-
* Retrieve debug configuration
|
37 |
-
* @return boolean
|
38 |
-
*/
|
39 |
-
public function isDebug()
|
40 |
-
{
|
41 |
-
if (self::$_debug == NULL) {
|
42 |
-
self::$_debug = Mage::helper('wsalogger')->isDebug('Shipperhq_Pbint');
|
43 |
-
}
|
44 |
-
return self::$_debug;
|
45 |
-
}
|
46 |
-
|
47 |
-
public function isPbOrder($carrierType)
|
48 |
-
{
|
49 |
-
if($carrierType == self::$code) {
|
50 |
-
if ($this->isDebug()) {
|
51 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
52 |
-
'Carrier type is Pitney Bowes International via ShipperHQ', $carrierType);
|
53 |
-
}
|
54 |
-
return true;
|
55 |
-
}
|
56 |
-
if ($this->isDebug()) {
|
57 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
58 |
-
'Carrier type is not Pitney Bowes International via ShipperHQ', $carrierType);
|
59 |
-
|
60 |
-
}
|
61 |
-
return false;
|
62 |
-
|
63 |
-
}
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Catalog/Category.php
DELETED
@@ -1,180 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Catalog_Category
|
32 |
-
{
|
33 |
-
protected $category;
|
34 |
-
private static $roots;
|
35 |
-
protected $url;
|
36 |
-
protected $_debug;
|
37 |
-
|
38 |
-
public function __construct($id, $url = null)
|
39 |
-
{
|
40 |
-
|
41 |
-
$this->_debug = Mage::helper('shipperhq_pbint')->isDebug();
|
42 |
-
if (gettype($id) == "object" && $id instanceOf Mage_Catalog_Model_Category) {
|
43 |
-
$this->category = $id;
|
44 |
-
} else {
|
45 |
-
$this->category = Mage::getModel('catalog/category')->load($id);
|
46 |
-
}
|
47 |
-
$this->url = $url;
|
48 |
-
}
|
49 |
-
|
50 |
-
public function getCategory()
|
51 |
-
{
|
52 |
-
return $this->category;
|
53 |
-
}
|
54 |
-
|
55 |
-
public function getName()
|
56 |
-
{
|
57 |
-
return $this->category->getName();
|
58 |
-
}
|
59 |
-
|
60 |
-
public function getCode()
|
61 |
-
{
|
62 |
-
return $this->category->getId();
|
63 |
-
}
|
64 |
-
|
65 |
-
public function getUrl()
|
66 |
-
{
|
67 |
-
if ($this->_debug) {
|
68 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
69 |
-
'Category processing, url is ', $this->category->getUrl() );
|
70 |
-
}
|
71 |
-
if ($this->url)
|
72 |
-
return $this->url;
|
73 |
-
return $this->category->getUrl();
|
74 |
-
}
|
75 |
-
|
76 |
-
public function isRoot()
|
77 |
-
{
|
78 |
-
if (!$this->category->getParentId()) {
|
79 |
-
return true;
|
80 |
-
}
|
81 |
-
if (!self::$roots) {
|
82 |
-
$categoryOp = new Mage_Adminhtml_Block_Catalog_Category_Abstract();
|
83 |
-
self::$roots = $categoryOp->getRootIds();
|
84 |
-
}
|
85 |
-
foreach (self::$roots as $rootId) {
|
86 |
-
if ($this->getCode() == $rootId) {
|
87 |
-
return true;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
return false;
|
91 |
-
}
|
92 |
-
|
93 |
-
public function getParentCode()
|
94 |
-
{
|
95 |
-
return $this->category->getParentId();
|
96 |
-
}
|
97 |
-
|
98 |
-
public function writeToFile($file)
|
99 |
-
{
|
100 |
-
$name = Shipperhq_Pbint_Model_Catalog_File::stripHtml($this->getName());
|
101 |
-
$name = preg_replace("/[,.\-\+=;:\\(){}\[\]@?%$#]/", '', $name);
|
102 |
-
$parentCateID = '';
|
103 |
-
if ($this->getParentCode() != 1 && !$this->isRoot()) {
|
104 |
-
$parentCateID = $this->getParentCode();
|
105 |
-
}
|
106 |
-
fputcsv($file, array($this->getCode(), $parentCateID, $name, '', $this->getUrl()));
|
107 |
-
}
|
108 |
-
|
109 |
-
public function upload()
|
110 |
-
{
|
111 |
-
if ($this->_debug) {
|
112 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
113 |
-
'Uploading category: ', $this->category->getName() . "... " );
|
114 |
-
}
|
115 |
-
|
116 |
-
if (Shipperhq_Pbint_Model_Api::addCategory($this)) {
|
117 |
-
if ($this->_debug) {
|
118 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
119 |
-
'Uploading category result: ', 'OK');
|
120 |
-
}
|
121 |
-
} else {
|
122 |
-
if ($this->_debug) {
|
123 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
124 |
-
'Uploading category result: ', 'Failed');
|
125 |
-
}
|
126 |
-
}
|
127 |
-
$products = $this->category->getProductCollection();
|
128 |
-
|
129 |
-
foreach ($products as $product) {
|
130 |
-
$clearPathProduct = new Shipperhq_Pbint_Model_Catalog_Product($product);
|
131 |
-
if ($this->_debug) {
|
132 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
133 |
-
'Uploading product: ',$clearPathProduct->getName() . "... ");
|
134 |
-
}
|
135 |
-
if (Shipperhq_Pbint_Model_Api::addCommodity($clearPathProduct)) {
|
136 |
-
if ($this->_debug) {
|
137 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
138 |
-
'Uploading product: ',$clearPathProduct->getName() . " - OK");
|
139 |
-
}
|
140 |
-
} else {
|
141 |
-
if ($this->_debug) {
|
142 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
143 |
-
'Uploading product: ',$clearPathProduct->getName() . " - Failed");
|
144 |
-
}
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
|
149 |
-
$children = $this->category->getChildrenCategories();
|
150 |
-
|
151 |
-
// TODO: this code will run out of memory if there are a lot of categories....
|
152 |
-
// Need to convert the recursive call to a loop at some point.
|
153 |
-
foreach ($children as $child) {
|
154 |
-
$childCategory = new Shipperhq_Pbint_Model_Catalog_Category($child);
|
155 |
-
$childCategory->upload();
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
// TODO This fuction starts at the Magento root and its not very efficient... see isRoot for proper implementation.
|
160 |
-
// This function is only used by the API upload.
|
161 |
-
public static function getAllRootCategories()
|
162 |
-
{
|
163 |
-
$roots = array();
|
164 |
-
|
165 |
-
$categories = Mage::getModel('catalog/category')->getCollection(); //->getSelect()->order(array('IF(`id`>0, `id`, 9999) ASC'));
|
166 |
-
$categories = $categories->getIterator();
|
167 |
-
|
168 |
-
foreach ($categories as $category) {
|
169 |
-
$parents = $category->getParentId();
|
170 |
-
if (!$parents) {
|
171 |
-
$rootCategory = new Shipperhq_Pbint_Model_Catalog_Category($category->getId());
|
172 |
-
array_push($roots, $rootCategory);
|
173 |
-
}
|
174 |
-
}
|
175 |
-
return $roots;
|
176 |
-
}
|
177 |
-
|
178 |
-
}
|
179 |
-
|
180 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Catalog/Cron.php
DELETED
@@ -1,151 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Catalog_Cron
|
32 |
-
{
|
33 |
-
|
34 |
-
private $lastDiff;
|
35 |
-
private $lastFull;
|
36 |
-
|
37 |
-
protected $_debug;
|
38 |
-
|
39 |
-
public function catalogSync()
|
40 |
-
{
|
41 |
-
$this->_debug = Mage::helper('shipperhq_pbint')->isDebug();
|
42 |
-
if ($this->_debug) {
|
43 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
44 |
-
'Catalog synch', 'Synchronization starting');
|
45 |
-
}
|
46 |
-
$diffPeriod = Mage::getStoreConfig('shipperhqpitney/shqpbint/catalog_diff');
|
47 |
-
$fullPeriod = Mage::getStoreConfig('shipperhqpitney/shqpbint/catalog_full');
|
48 |
-
|
49 |
-
$collection = Mage::getModel("shipperhq_pbint/variable")->getCollection();
|
50 |
-
foreach ($collection as $variable) {
|
51 |
-
if ($this->_debug) {
|
52 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
53 |
-
'Processing: ', $variable->getName() . " -> " . $variable->getValue());
|
54 |
-
}
|
55 |
-
if ($variable->getName() == "lastFull") {
|
56 |
-
$this->lastFull = $variable;
|
57 |
-
}
|
58 |
-
if ($variable->getName() == "lastDiff") {
|
59 |
-
$this->lastDiff = $variable;
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
$appRoot = Mage::getRoot();
|
65 |
-
$mageRoot = dirname($appRoot);
|
66 |
-
$configOptions = Mage::getModel('core/config_options');
|
67 |
-
$configOptions->createDirIfNotExists($mageRoot . '/var/pbint');
|
68 |
-
chmod($mageRoot . '/var/pbint/', 0777);
|
69 |
-
|
70 |
-
if (!isset($this->lastFull) || $this->lastFull->getValue() < time() - $fullPeriod * 24 * 3600) {
|
71 |
-
// Full catalog upload needed
|
72 |
-
$this->uploadCatalog();
|
73 |
-
} else if (!isset($this->lastDiff) && $this->lastFull->getValue() < time() - $diffPeriod * 3600) {
|
74 |
-
// First catalog diff upload
|
75 |
-
$this->uploadCatalog($this->lastFull);
|
76 |
-
} else if (isset($this->lastDiff) && ($this->lastDiff->getValue() < time() - $diffPeriod * 3600 &&
|
77 |
-
$this->lastFull->getValue() < time() - $diffPeriod * 3600)
|
78 |
-
) {
|
79 |
-
// Catalog diff upload
|
80 |
-
$this->uploadCatalog($this->lastDiff);
|
81 |
-
} else {
|
82 |
-
if ($this->_debug) {
|
83 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
84 |
-
'PB Export cron.', 'Do not export catalog');
|
85 |
-
}
|
86 |
-
}
|
87 |
-
|
88 |
-
}
|
89 |
-
|
90 |
-
public function uploadCatalog($lastDiff = false)
|
91 |
-
{
|
92 |
-
$this->_debug = Mage::helper('shipperhq_pbint')->isDebug();
|
93 |
-
if (!$lastDiff) {
|
94 |
-
if ($this->_debug) {
|
95 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
96 |
-
'PB Synch', 'Full catalog upload');
|
97 |
-
}
|
98 |
-
$file = new Shipperhq_Pbint_Model_Catalog_File();
|
99 |
-
if (isset($this->lastFull)) {
|
100 |
-
$this->lastFull->setValue(time());
|
101 |
-
} else {
|
102 |
-
$this->lastFull = Mage::getModel("shipperhq_pbint/variable");
|
103 |
-
$this->lastFull->setName("lastFull");
|
104 |
-
$this->lastFull->setValue(time());
|
105 |
-
}
|
106 |
-
$this->lastFull->save();
|
107 |
-
} else {
|
108 |
-
if ($this->_debug) {
|
109 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
110 |
-
'PB Synch', 'Catalog diff');
|
111 |
-
}
|
112 |
-
$file = new Shipperhq_Pbint_Model_Catalog_File($lastDiff->getValue());
|
113 |
-
if (isset($this->lastDiff)) {
|
114 |
-
$this->lastDiff->setValue(time());
|
115 |
-
} else {
|
116 |
-
$this->lastDiff = Mage::getModel("shipperhq_pbint/variable");
|
117 |
-
$this->lastDiff->setName("lastDiff");
|
118 |
-
$this->lastDiff->setValue(time());
|
119 |
-
}
|
120 |
-
$this->lastDiff->save();
|
121 |
-
}
|
122 |
-
|
123 |
-
if ($this->_debug) {
|
124 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
125 |
-
'Catalog synch', 'Create function started');
|
126 |
-
}
|
127 |
-
$result = $file->createNew();
|
128 |
-
if ($this->_debug) {
|
129 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
130 |
-
'Catalog synch', 'Create function complete');
|
131 |
-
}
|
132 |
-
|
133 |
-
$result = $file->upload();
|
134 |
-
$file->logProdWithoutCategories();
|
135 |
-
if ($this->_debug) {
|
136 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
137 |
-
'PB Synch', 'Upload Complete');
|
138 |
-
}
|
139 |
-
return $result;
|
140 |
-
}
|
141 |
-
|
142 |
-
public function processStatusNotifications()
|
143 |
-
{
|
144 |
-
$file = new Shipperhq_Pbint_Model_Catalog_File();
|
145 |
-
$file->processStatusNotifications();
|
146 |
-
}
|
147 |
-
|
148 |
-
}
|
149 |
-
|
150 |
-
|
151 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Catalog/File.php
DELETED
@@ -1,862 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Pitney Bowes International
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
/* Creates a temporary file containing a Pb catalog xml file. Because of possible PHP timeouts the creation of the
|
31 |
-
* xml file is done in concrete steps that can be resumed in case of a timeout.
|
32 |
-
*/
|
33 |
-
|
34 |
-
class Shipperhq_Pbint_Model_Catalog_File
|
35 |
-
{
|
36 |
-
|
37 |
-
|
38 |
-
private $file;
|
39 |
-
private $filename;
|
40 |
-
private $lastDiff;
|
41 |
-
private $productIds;
|
42 |
-
private $lastFileName;
|
43 |
-
|
44 |
-
protected $_debug;
|
45 |
-
|
46 |
-
public function __construct($lastDiff = false)
|
47 |
-
{
|
48 |
-
$this->lastDiff = $lastDiff;
|
49 |
-
$this->productIds = array();
|
50 |
-
}
|
51 |
-
|
52 |
-
private function _getTempDir()
|
53 |
-
{
|
54 |
-
$appRoot = Mage::getRoot();
|
55 |
-
$mageRoot = dirname($appRoot);
|
56 |
-
$configOptions = Mage::getModel('core/config_options');
|
57 |
-
$tmpDir = $mageRoot . '/var/pbint/tmp/';
|
58 |
-
$configOptions->createDirIfNotExists($tmpDir);
|
59 |
-
chmod($tmpDir, 0777);
|
60 |
-
return $tmpDir;
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
private function _getDataFileName($dataFeedName, $part = null)
|
65 |
-
{
|
66 |
-
$partName = '';
|
67 |
-
if ($part)
|
68 |
-
$partName = '_part' . $part;
|
69 |
-
$fileName = Shipperhq_Pbint_Model_Credentials::getCatalogSenderID() . "_" . $dataFeedName . "_update_" . Shipperhq_Pbint_Model_Credentials::getPBID() . '_' . date('Ymd_His') . '_' . mt_rand(100000, 999999);
|
70 |
-
if ($part == 1)
|
71 |
-
$this->lastFileName = $fileName;
|
72 |
-
else
|
73 |
-
$fileName = $this->lastFileName;
|
74 |
-
return $fileName . $partName . '.csv';
|
75 |
-
}
|
76 |
-
|
77 |
-
private function _createNewCommoditiyFile($part = null)
|
78 |
-
{
|
79 |
-
$fileName = $this->_getDataFileName('catalog', $part);
|
80 |
-
if(is_resource($this->file)) {
|
81 |
-
fflush($this->file);
|
82 |
-
|
83 |
-
fclose($this->file);
|
84 |
-
|
85 |
-
}
|
86 |
-
|
87 |
-
$this->filename = $this->_getTempDir() . $fileName;
|
88 |
-
if ($this->_debug) {
|
89 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
90 |
-
'Product catalog upload - creating new commodity file', $fileName);
|
91 |
-
}
|
92 |
-
try {
|
93 |
-
$this->file = fopen($this->filename, "w+");
|
94 |
-
chmod($this->filename, 0777);
|
95 |
-
}
|
96 |
-
catch(Exception $e) {
|
97 |
-
if ($this->_debug) {
|
98 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
99 |
-
'Product catalog upload exception during file opening', $e->getMessage());
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
//add header row
|
104 |
-
fputcsv($this->file, array('MERCHANT_COMMODITY_REF_ID', 'COMMODITY_NAME_TITLE', 'SHORT_DESCRIPTION',
|
105 |
-
'LONG_DESCRIPTION', 'RETAILER_ID', 'COMMODITY_URL', 'RETAILER_UNIQUE_ID', 'PCH_CATEGORY_ID',
|
106 |
-
'RH_CATEGORY_ID', 'STANDARD_PRICE', 'WEIGHT_UNIT', 'DISTANCE_UNIT', 'COO', 'IMAGE_URL', 'PARENT_SKU',
|
107 |
-
'CHILD_SKU', 'PARCELS_PER_SKU', 'UPC', 'UPC_CHECK_DIGIT', 'GTIN', 'MPN', 'ISBN', 'BRAND', 'MANUFACTURER',
|
108 |
-
'MODEL_NUMBER', 'MANUFACTURER_STOCK_NUMBER', 'COMMODITY_CONDITION', 'COMMODITY_HEIGHT',
|
109 |
-
'COMMODITY_WIDTH', 'COMMODITY_LENGTH', 'PACKAGE_WEIGHT', 'PACKAGE_HEIGHT', 'PACKAGE_WIDTH',
|
110 |
-
'PACKAGE_LENGTH', 'HAZMAT', 'ORMD', 'CHEMICAL_INDICATOR', 'PESTICIDE_INDICATOR', 'AEROSOL_INDICATOR',
|
111 |
-
'RPPC_INDICATOR', 'BATTERY_TYPE', 'NON_SPILLABLE_BATTERY', 'FUEL_RESTRICTION', 'SHIP_ALONE',
|
112 |
-
'RH_CATEGORY_ID_PATH', 'RH_CATEGORY_NAME_PATH'));
|
113 |
-
//,'RH_CATEGORY_URL_PATH','GPC','COMMODITY_WEIGHT','HS_CODE','CURRENCY'
|
114 |
-
|
115 |
-
fflush($this->file);
|
116 |
-
}
|
117 |
-
|
118 |
-
private function _createNewCategoryFile($part = null)
|
119 |
-
{
|
120 |
-
if(is_resource($this->file)) {
|
121 |
-
fflush($this->file);
|
122 |
-
fclose($this->file);
|
123 |
-
|
124 |
-
}
|
125 |
-
|
126 |
-
$fileName = $this->_getDataFileName('category-tree', $part);
|
127 |
-
|
128 |
-
|
129 |
-
$this->filename = $this->_getTempDir() . $fileName;
|
130 |
-
if ($this->_debug) {
|
131 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
132 |
-
'Product catalog upload - creating new category file', $fileName);
|
133 |
-
}
|
134 |
-
try {
|
135 |
-
$this->file = fopen($this->filename, "w+");
|
136 |
-
chmod($this->filename, 0777);
|
137 |
-
}
|
138 |
-
catch(Exception $e) {
|
139 |
-
if ($this->_debug) {
|
140 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
141 |
-
'Product catalog upload exception during file opening', $e->getMessage());
|
142 |
-
}
|
143 |
-
}
|
144 |
-
//add header row
|
145 |
-
fputcsv($this->file, array('CATEGORY_ID', 'PARENT_CATEGORY_ID', 'NAME',
|
146 |
-
'ID_PATH', 'URL'));
|
147 |
-
|
148 |
-
fflush($this->file);
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
private function _getSelectedCategory($categories, $catId)
|
153 |
-
{
|
154 |
-
foreach ($categories as $cat) {
|
155 |
-
if ($cat->getId() == $catId)
|
156 |
-
return $cat;
|
157 |
-
}
|
158 |
-
return false;
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Extracts the categories and products and exports them into xml file.
|
163 |
-
*/
|
164 |
-
public function createNew()
|
165 |
-
{
|
166 |
-
$this->_debug = Mage::helper('shipperhq_pbint')->isDebug();
|
167 |
-
|
168 |
-
$maxRecordsCount = Shipperhq_Pbint_Model_Credentials::getMaxRecordsCount();
|
169 |
-
if (!$maxRecordsCount) {
|
170 |
-
$maxRecordsCount = 10000;
|
171 |
-
}
|
172 |
-
|
173 |
-
if ($this->_debug) {
|
174 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
175 |
-
'ShipperHQ Pitney product catalog upload', 'Maxium number of records: ' .$maxRecordsCount);
|
176 |
-
}
|
177 |
-
$prodCount = 0;
|
178 |
-
$catCount = 0;
|
179 |
-
$fileRecordCount = 0;
|
180 |
-
//get stores which has disabled clearpath
|
181 |
-
$stores = Mage::app()->getStores();
|
182 |
-
$defaultStoreUrl = Mage::getBaseUrl();
|
183 |
-
$secDefaultStoreUrl = str_replace("http", "https", $defaultStoreUrl);
|
184 |
-
$disabledStores = array();
|
185 |
-
$addedCategories = array();
|
186 |
-
$part = 1;
|
187 |
-
$atLeastOneStoreEnabled = false;
|
188 |
-
if ($this->_debug) {
|
189 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
190 |
-
'ShipperHQ Pitney product catalog upload', 'Number of stores in Magento: ' .count($stores));
|
191 |
-
}
|
192 |
-
foreach ($stores as $store) {
|
193 |
-
|
194 |
-
$isActive = Mage::getStoreConfig('shipperhqpitney/shqpbint/active', $store);
|
195 |
-
$baseURL = $store->getBaseUrl();
|
196 |
-
|
197 |
-
if (!$isActive) {
|
198 |
-
$disabledStores[] = $store;
|
199 |
-
if ($this->_debug) {
|
200 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
201 |
-
'Disabled store ', $store->getId() . ' ' . $store->getCode());
|
202 |
-
}
|
203 |
-
} else {
|
204 |
-
$atLeastOneStoreEnabled = true;
|
205 |
-
$rootId = Mage::app()->getStore($store->getId())->getRootCategoryId();
|
206 |
-
$rootCat = Mage::getModel('catalog/category')->load($rootId);
|
207 |
-
/* @var $rootCat Mage_Catalog_Model_Category */
|
208 |
-
$rootCat->setData('store', $store);
|
209 |
-
if ($this->_debug) {
|
210 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
211 |
-
'Default store url ', $defaultStoreUrl . 'store ' . $store->getCode() . ' store base url'
|
212 |
-
. $baseURL . " root cat url" . $rootCat->getUrl() . " cat name" . $rootCat->getName());
|
213 |
-
}
|
214 |
-
|
215 |
-
$catUrl = str_replace($defaultStoreUrl, $baseURL, $rootCat->getUrl());
|
216 |
-
if ($catUrl == $rootCat->getUrl())
|
217 |
-
$catUrl = str_replace($secDefaultStoreUrl, $baseURL, $rootCat->getUrl());
|
218 |
-
$cat = new Shipperhq_Pbint_Model_Catalog_Category($rootCat, $catUrl);
|
219 |
-
if (!$this->file || $fileRecordCount > $maxRecordsCount) {
|
220 |
-
$this->_createNewCategoryFile($part);
|
221 |
-
$fileRecordCount = 0;
|
222 |
-
$part++;
|
223 |
-
}
|
224 |
-
$cat->writeToFile($this->file);
|
225 |
-
fflush($this->file);
|
226 |
-
$catCount++;
|
227 |
-
$fileRecordCount++;
|
228 |
-
$categories = Mage::getModel('catalog/category')
|
229 |
-
->getCollection()
|
230 |
-
->addUrlRewriteToResult()
|
231 |
-
->addAttributeToSelect('name')
|
232 |
-
->addFieldToFilter('path', array('like' => "1/$rootId/%"));
|
233 |
-
$addedCategories[] = $rootCat;
|
234 |
-
if ($this->_debug) {
|
235 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
236 |
-
'Product catalog upload ', 'Found ' .count($categories) .' for processing');
|
237 |
-
}
|
238 |
-
foreach ($categories as $category) {
|
239 |
-
if (!$this->file || $fileRecordCount > $maxRecordsCount) {
|
240 |
-
$this->_createNewCategoryFile($part);
|
241 |
-
$fileRecordCount = 0;
|
242 |
-
$part++;
|
243 |
-
}
|
244 |
-
/* @var $category Mage_Catalog_Model_Category */
|
245 |
-
$category->setStoreId($store->getId());
|
246 |
-
$category->setData('store', $store);
|
247 |
-
$addedCategories[] = $category;
|
248 |
-
|
249 |
-
$catUrl = str_replace($defaultStoreUrl, $baseURL, $category->getUrl());
|
250 |
-
if ($catUrl == $category->getUrl())
|
251 |
-
$catUrl = str_replace($secDefaultStoreUrl, $baseURL, $category->getUrl());
|
252 |
-
$cat = new Shipperhq_Pbint_Model_Catalog_Category($category, $catUrl);
|
253 |
-
$cat->writeToFile($this->file);
|
254 |
-
fflush($this->file);
|
255 |
-
$catCount++;
|
256 |
-
$fileRecordCount++;
|
257 |
-
}
|
258 |
-
}
|
259 |
-
}
|
260 |
-
if(!$atLeastOneStoreEnabled) {
|
261 |
-
if ($this->_debug) {
|
262 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Pbint',
|
263 |
-
'Product catalog upload issue ', ' ShipperHQ Pitney is not set to active for any of your stores,
|
264 |
-
Please enable in at least one store before attempting to upload catalog');
|
265 |
-
}
|
266 |
-
}
|
267 |
-
if($this->file) {
|
268 |
-
fclose($this->file);
|
269 |
-
}
|
270 |
-
else {
|
271 |
-
if ($this->_debug) {
|
272 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Pbint',
|
273 |
-
'Product catalog upload issue ', 'No upload file object was created');
|
274 |
-
}
|
275 |
-
}
|
276 |
-
$this->_stripPartFromFileName($part);
|
277 |
-
//fwrite($this->file,"</CategoryList>\n<CommodityList>\n");
|
278 |
-
$fileRecordCount = 0;
|
279 |
-
$part = 1;
|
280 |
-
$this->_createNewCommoditiyFile($part);
|
281 |
-
$part++;
|
282 |
-
$addedProducts = array();
|
283 |
-
if(count($addedCategories) == 0) {
|
284 |
-
if ($this->_debug) {
|
285 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Pbint',
|
286 |
-
'Product catalog upload ', 'During processing, no product categories were found. Please review full log files for details');
|
287 |
-
}
|
288 |
-
}
|
289 |
-
|
290 |
-
$productCollection = Mage::getModel('catalog/product')->getCollection()
|
291 |
-
->addAttributeToSelect('name')
|
292 |
-
->addAttributeToSelect('sku')
|
293 |
-
->addAttributeToSelect('country_of_manufacture')
|
294 |
-
->addAttributeToSelect('description')
|
295 |
-
->addAttributeToSelect('product_url')
|
296 |
-
->addAttributeToSelect('type_id')
|
297 |
-
->addAttributeToSelect('shipperhq_pbint_upload')
|
298 |
-
->addAttributeToSelect('price')
|
299 |
-
->addAttributeToSelect('weight');
|
300 |
-
|
301 |
-
$productCollection->setPageSize(100);
|
302 |
-
|
303 |
-
$pages = $productCollection->getLastPageNumber();
|
304 |
-
if ($this->_debug) {
|
305 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
306 |
-
'Product catalog upload ', 'There are ' .$pages.' pages x 100 products to process');
|
307 |
-
}
|
308 |
-
$currentPage = 1;
|
309 |
-
|
310 |
-
do {
|
311 |
-
$productCollection->setCurPage($currentPage);
|
312 |
-
$productCollection->load();
|
313 |
-
|
314 |
-
foreach ($productCollection as $product) {
|
315 |
-
if ($product->getTypeId() == 'virtual') {
|
316 |
-
continue;
|
317 |
-
}
|
318 |
-
|
319 |
-
if ($product->getTypeId() == 'configurable' || $product->getTypeId() == 'bundle') {
|
320 |
-
//as we'll use the child products only
|
321 |
-
continue;
|
322 |
-
}
|
323 |
-
|
324 |
-
$cateIds = $product->getCategoryIds();
|
325 |
-
$cateId = 0;
|
326 |
-
foreach ($cateIds as $cId) {
|
327 |
-
$cateId = $cId; //get lower level of category
|
328 |
-
}
|
329 |
-
|
330 |
-
$prodCat = $this->_getSelectedCategory($addedCategories, $cateId);
|
331 |
-
if (!$prodCat) {
|
332 |
-
$parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')
|
333 |
-
->getParentIdsByChild($product->getId());
|
334 |
-
if(empty($parentIds)) {
|
335 |
-
$parentIds = Mage::getResourceSingleton('bundle/selection')
|
336 |
-
->getParentIdsByChild($product->getId());
|
337 |
-
if(empty($parentIds)) {
|
338 |
-
if ($this->_debug) {
|
339 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
340 |
-
'Product catalog upload ', 'unable to find an exported category for SKU ' .$product->getSku() .' and no assigned parents on this product');
|
341 |
-
}
|
342 |
-
continue;
|
343 |
-
}
|
344 |
-
}
|
345 |
-
$parent = Mage::getModel('catalog/product')->load($parentIds[0]);
|
346 |
-
foreach ($parent->getCategoryIds() as $cId) {
|
347 |
-
$cateId = $cId; //get lower level of category
|
348 |
-
}
|
349 |
-
$prodCat = $this->_getSelectedCategory($addedCategories, $cateId);
|
350 |
-
if(!$prodCat) {
|
351 |
-
if ($this->_debug) {
|
352 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
353 |
-
'Product catalog upload ', 'unable to find an exported category for SKU ' .$product->getSku() .' - category ID is ' .$cateId);
|
354 |
-
}
|
355 |
-
continue; //can't find the category
|
356 |
-
}
|
357 |
-
}
|
358 |
-
$baseURL = Mage::app()->getStore($category->getStoreId())->getBaseUrl();
|
359 |
-
$productUrlFormat = $baseURL . "catalog/product/view/id/%d/";
|
360 |
-
|
361 |
-
$cIds = explode('/', $prodCat->getPath());
|
362 |
-
$cIds = array_slice($cIds, 1); //remove root category
|
363 |
-
$prodCat->setData('id_path', implode(':', $cIds));
|
364 |
-
$prodCat->setData('name_path', $this->_getCatNamePath($addedCategories, $cIds));
|
365 |
-
|
366 |
-
$pbProduct = new Shipperhq_Pbint_Model_Catalog_Product($product, sprintf($productUrlFormat, $product->getId()));
|
367 |
-
if ($fileRecordCount > $maxRecordsCount) {
|
368 |
-
$this->_createNewCommoditiyFile();
|
369 |
-
$fileRecordCount = 0;
|
370 |
-
$part++;
|
371 |
-
}
|
372 |
-
$this->writeProduct($pbProduct, $cateId, null, $prodCat);
|
373 |
-
$prodCount++;
|
374 |
-
$fileRecordCount++;
|
375 |
-
$addedProducts[$product->getSku()] = "added";
|
376 |
-
|
377 |
-
}
|
378 |
-
|
379 |
-
$currentPage++;
|
380 |
-
//clear collection and free memory
|
381 |
-
$productCollection->clear();
|
382 |
-
} while ($currentPage <= $pages);
|
383 |
-
|
384 |
-
if($this->file) {
|
385 |
-
fflush($this->file);
|
386 |
-
}
|
387 |
-
if ($this->_debug) {
|
388 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
389 |
-
'Product upload - Completed file creation', 'Processed ' .$prodCount .' products');
|
390 |
-
}
|
391 |
-
|
392 |
-
$this->_stripPartFromFileName($part);
|
393 |
-
return true;
|
394 |
-
}
|
395 |
-
|
396 |
-
private function _getCatNamePath($categories, $cateIds)
|
397 |
-
{
|
398 |
-
|
399 |
-
$names = array();
|
400 |
-
foreach ($cateIds as $id) {
|
401 |
-
foreach ($categories as $cat) {
|
402 |
-
if ($cat->getId() == $id) {
|
403 |
-
array_push($names, $cat->getName());
|
404 |
-
break;
|
405 |
-
}
|
406 |
-
}
|
407 |
-
}
|
408 |
-
return implode('|', $names);
|
409 |
-
}
|
410 |
-
|
411 |
-
/**
|
412 |
-
* Updates the shipperhq_pbint_upload time in all uploaded products
|
413 |
-
*/
|
414 |
-
public function updateLastProductUpload()
|
415 |
-
{
|
416 |
-
|
417 |
-
$this->_debug = Mage::helper('shipperhq_pbint')->isDebug();
|
418 |
-
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'shipperhq_pbint_upload');
|
419 |
-
if (!$attribute->getAttributeId()) {
|
420 |
-
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
421 |
-
$setup->addAttribute('catalog_product', 'shipperhq_pbint_upload', array(
|
422 |
-
'label' => 'Last Pb upload timestampt',
|
423 |
-
'type' => 'varchar',
|
424 |
-
'input' => 'text',
|
425 |
-
'visible' => false,
|
426 |
-
'required' => false,
|
427 |
-
'position' => 1,
|
428 |
-
));
|
429 |
-
}
|
430 |
-
|
431 |
-
$productIds = array_unique($this->productIds);
|
432 |
-
if ($this->_debug) {
|
433 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
434 |
-
'Uploaded products', count($productIds));
|
435 |
-
}
|
436 |
-
$updated = 0;
|
437 |
-
foreach ($productIds as $prodId) {
|
438 |
-
$product = Mage::getModel("catalog/product")->load($prodId);
|
439 |
-
$product->setPbPbgspUpload(time());
|
440 |
-
try {
|
441 |
-
$product->save();
|
442 |
-
$updated++;
|
443 |
-
} catch (Exception $e) {
|
444 |
-
if ($this->_debug) {
|
445 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
446 |
-
'There was a problem saving the product with sku', $product->getSku() . " Error Message \n" . $e->getMessage());
|
447 |
-
}
|
448 |
-
}
|
449 |
-
|
450 |
-
}
|
451 |
-
if ($this->_debug) {
|
452 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
453 |
-
'shipperhq_pbint_upload', $updated . ' products updated');
|
454 |
-
}
|
455 |
-
}
|
456 |
-
|
457 |
-
/**
|
458 |
-
* Uploads the xml file to clearpath SFTP server
|
459 |
-
*/
|
460 |
-
|
461 |
-
private function _getNotificationDir()
|
462 |
-
{
|
463 |
-
$tmpDir = $this->_getTempDir();
|
464 |
-
$configOptions = Mage::getModel('core/config_options');
|
465 |
-
$notificationDir = $tmpDir . 'notifications';
|
466 |
-
$configOptions->createDirIfNotExists($notificationDir);
|
467 |
-
chmod($notificationDir, 0777);
|
468 |
-
return $notificationDir;
|
469 |
-
}
|
470 |
-
|
471 |
-
public function processStatusNotifications()
|
472 |
-
{
|
473 |
-
$this->_debug = Mage::helper('shipperhq_pbint')->isDebug();
|
474 |
-
try {
|
475 |
-
$adminEmail = Shipperhq_Pbint_Model_Credentials::getAdminEmail();
|
476 |
-
if (!isset($adminEmail) || $adminEmail == '')
|
477 |
-
return;
|
478 |
-
$notificationDir = $this->_getNotificationDir();
|
479 |
-
$this->_downloadStatusNotifications($notificationDir);
|
480 |
-
$notificationFiles = array_diff(scandir($notificationDir), array('..', '.'));
|
481 |
-
if (count($notificationFiles) > 0) {
|
482 |
-
$mail = new Zend_Mail();
|
483 |
-
$mail->setFrom('no-reply@pb.com', 'Pitney Bowes');
|
484 |
-
$mail->addTo($adminEmail)
|
485 |
-
->setSubject('Catalog Export Error')
|
486 |
-
->setBodyText('Catalog Export Error. Please see attached files.');
|
487 |
-
$fileCount = 0;
|
488 |
-
foreach ($notificationFiles as $notificationFile) {
|
489 |
-
if ($this->_endsWith($notificationFile, '.err') || $this->_endsWith($notificationFile, '.log')) {
|
490 |
-
$file = $notificationDir . '/' . $notificationFile;
|
491 |
-
$at = new Zend_Mime_Part(file_get_contents($file));
|
492 |
-
$at->filename = basename($file);
|
493 |
-
$at->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
|
494 |
-
$at->encoding = Zend_Mime::ENCODING_8BIT;
|
495 |
-
|
496 |
-
$mail->addAttachment($at);
|
497 |
-
$fileCount++;
|
498 |
-
}
|
499 |
-
|
500 |
-
}
|
501 |
-
if ($fileCount > 0) {
|
502 |
-
$mail->send();
|
503 |
-
if ($this->_debug) {
|
504 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
505 |
-
'ProcessStatusNotifications', 'Email sent with error files.');
|
506 |
-
}
|
507 |
-
} else {
|
508 |
-
if ($this->_debug) {
|
509 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
510 |
-
'ProcessStatusNotifications', 'No error files found.');
|
511 |
-
}
|
512 |
-
}
|
513 |
-
//keep these files until next upload and delete files from old upload
|
514 |
-
$this->_cleanNotificationFiles();
|
515 |
-
}
|
516 |
-
} catch (Exception $e) {
|
517 |
-
if ($this->_debug) {
|
518 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
519 |
-
'ProcessStatusNotifications', 'Error in processStatusNotifications:' . $e->getMessage());
|
520 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
521 |
-
'Full trace of exception: ', $e->getTraceAsString());
|
522 |
-
}
|
523 |
-
}
|
524 |
-
}
|
525 |
-
|
526 |
-
private function _cleanNotificationFiles()
|
527 |
-
{
|
528 |
-
//keep resent files until next upload and delete files from old upload
|
529 |
-
$lastExportedFiles = $this->_getLastExportedFileNames();
|
530 |
-
if (!$lastExportedFiles)
|
531 |
-
return;
|
532 |
-
$notificationDir = $this->_getNotificationDir();
|
533 |
-
$notificationFiles = array_diff(scandir($notificationDir), array('..', '.'));
|
534 |
-
|
535 |
-
foreach ($notificationFiles as $notificationFile) {
|
536 |
-
$path_parts = pathinfo($notificationFile);
|
537 |
-
$localFileNameWithoutExt = $path_parts['filename'];
|
538 |
-
$isOldFile = true;
|
539 |
-
foreach ($lastExportedFiles as $lastExportedFile) {
|
540 |
-
$lastExportedFileNameWithoutExt = str_replace('.gpg', '', str_replace('.csv', '', $lastExportedFile));
|
541 |
-
if ($lastExportedFileNameWithoutExt == $localFileNameWithoutExt) {
|
542 |
-
$isOldFile = false;
|
543 |
-
break;
|
544 |
-
}
|
545 |
-
}
|
546 |
-
if ($isOldFile) {
|
547 |
-
//this is from 2nd last upload, remove it from disk
|
548 |
-
unlink($notificationDir . '/' . $notificationFile);
|
549 |
-
}
|
550 |
-
}
|
551 |
-
|
552 |
-
}
|
553 |
-
|
554 |
-
private function _downloadStatusNotifications($notificationDir)
|
555 |
-
{
|
556 |
-
|
557 |
-
$credentials = $this->_getSftpCredentials();
|
558 |
-
try {
|
559 |
-
$sftpDumpFile = new Varien_Io_Sftp();
|
560 |
-
$sftpDumpFile->open(
|
561 |
-
$credentials
|
562 |
-
);
|
563 |
-
$rootDir = Shipperhq_Pbint_Model_Credentials::getSftpCatalogDirectory();
|
564 |
-
if (!$this->_endsWith($rootDir, '/'))
|
565 |
-
$rootDir = $rootDir . '/';
|
566 |
-
$processedDir = $rootDir . 'outbound';
|
567 |
-
$sftpDumpFile->cd($processedDir);
|
568 |
-
$files = $sftpDumpFile->ls();
|
569 |
-
|
570 |
-
$exportedFiles = $this->_getLastExportedFileNames();
|
571 |
-
if (!$exportedFiles)
|
572 |
-
return;
|
573 |
-
foreach ($files as $file) {
|
574 |
-
foreach ($exportedFiles as $exportedFile) {
|
575 |
-
$fileNameWithoutExtension = str_replace(".gpg", "", str_replace(".csv", "", $exportedFile));
|
576 |
-
if ($this->_startsWith($file['text'], $fileNameWithoutExtension)) {
|
577 |
-
$dest = $notificationDir . '/' . $file['text'];
|
578 |
-
$sftpDumpFile->read($file['text'], $dest);
|
579 |
-
}
|
580 |
-
}
|
581 |
-
|
582 |
-
}
|
583 |
-
$sftpDumpFile->close();
|
584 |
-
} catch (Exception $e) {
|
585 |
-
if ($this->_debug) {
|
586 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
587 |
-
'Pb Module could not connect to sftp server: ',
|
588 |
-
$credentials['host'], $e->getMessage());
|
589 |
-
}
|
590 |
-
return;
|
591 |
-
}
|
592 |
-
|
593 |
-
}
|
594 |
-
|
595 |
-
private function _encryptExportedFiles($exportedFiles)
|
596 |
-
{
|
597 |
-
$encryptedFiles = array();
|
598 |
-
$publicKey = Shipperhq_Pbint_Model_Credentials::getPublicKey();
|
599 |
-
if (!isset($publicKey) || $publicKey == '') {
|
600 |
-
if ($this->_debug) {
|
601 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
602 |
-
'EncryptExportedFiles', 'Public key is not set cannot encrypt catalog files.');
|
603 |
-
}
|
604 |
-
return $exportedFiles;
|
605 |
-
}
|
606 |
-
try {
|
607 |
-
$gnupg = new gnupg();
|
608 |
-
$keyInfo = $gnupg->import($publicKey);
|
609 |
-
$gnupg->addencryptkey($keyInfo['fingerprint']);
|
610 |
-
$tmpDir = $this->_getTempDir();
|
611 |
-
if ($this->_debug) {
|
612 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'EncryptExportedFiles', 'Encrypting the files.');
|
613 |
-
}
|
614 |
-
foreach ($exportedFiles as $exportedFile) {
|
615 |
-
$fileName = $tmpDir . $exportedFile;
|
616 |
-
if (is_dir($fileName))
|
617 |
-
continue;
|
618 |
-
$encryptedFileName = $exportedFile . '.gpg';
|
619 |
-
if ($this->_debug) {
|
620 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'EncryptExportedFiles', 'Encrypted file' . $encryptedFileName);
|
621 |
-
}
|
622 |
-
file_put_contents($tmpDir . $encryptedFileName, $gnupg->encrypt(file_get_contents($fileName)));
|
623 |
-
$encryptedFiles[] = $encryptedFileName;
|
624 |
-
}
|
625 |
-
return $encryptedFiles;
|
626 |
-
} catch (Exception $e) {
|
627 |
-
if ($this->_debug) {
|
628 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint', 'Error in encryption', $e->getTraceAsString());
|
629 |
-
}
|
630 |
-
return $encryptedFiles;
|
631 |
-
}
|
632 |
-
|
633 |
-
|
634 |
-
}
|
635 |
-
|
636 |
-
public function upload()
|
637 |
-
{
|
638 |
-
$this->_debug = Mage::helper('shipperhq_pbint')->isDebug();
|
639 |
-
|
640 |
-
$tmpDir = $this->_getTempDir();
|
641 |
-
$exportedFiles = array_diff(scandir($tmpDir), array('..', '.'));
|
642 |
-
if (count($this->productIds) == 0) {
|
643 |
-
// No new products to send, don't send anything.
|
644 |
-
$this->_removeExportedFiles($exportedFiles);
|
645 |
-
return;
|
646 |
-
}
|
647 |
-
if ($this->_debug) {
|
648 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'upload', 'Pb catalog file upload started for ' .count($this->productIds) .' products');
|
649 |
-
}
|
650 |
-
try {
|
651 |
-
|
652 |
-
if (Shipperhq_Pbint_Model_Credentials::isEncryptionEnabled()) {
|
653 |
-
$exportedFiles = $this->_encryptExportedFiles($exportedFiles);
|
654 |
-
} else {
|
655 |
-
if ($this->_debug) {
|
656 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'upload',
|
657 |
-
'Encryption is not enabled.' . Shipperhq_Pbint_Model_Credentials::isEncryptionEnabled());
|
658 |
-
}
|
659 |
-
}
|
660 |
-
$sftpDumpFile = new Varien_Io_Sftp();
|
661 |
-
$credentials = $this->_getSftpCredentials();
|
662 |
-
|
663 |
-
if ($this->_debug) {
|
664 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'upload', $credentials);
|
665 |
-
}
|
666 |
-
$sftpDumpFile->open(
|
667 |
-
$credentials
|
668 |
-
);
|
669 |
-
//Upload to SFTP
|
670 |
-
$rootDir = Shipperhq_Pbint_Model_Credentials::getSftpCatalogDirectory();
|
671 |
-
if (!$this->_endsWith($rootDir, '/'))
|
672 |
-
$rootDir = $rootDir . '/';
|
673 |
-
$tmpSFTPDir = $rootDir . 'tmp';
|
674 |
-
$inboundDir = $rootDir . 'inbound';
|
675 |
-
$uploadedFiles = array();
|
676 |
-
foreach ($exportedFiles as $exportedFile) {
|
677 |
-
$fileName = $tmpDir . $exportedFile;
|
678 |
-
if (is_dir($fileName))
|
679 |
-
continue;
|
680 |
-
|
681 |
-
if ($this->_debug) {
|
682 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'upload', 'CD to ' . $tmpSFTPDir);
|
683 |
-
}
|
684 |
-
$sftpDumpFile->cd($tmpSFTPDir);
|
685 |
-
if ($this->_debug) {
|
686 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'upload', 'Uploading: ' . $fileName);
|
687 |
-
}
|
688 |
-
$writeOutcome = $sftpDumpFile->write($exportedFile, file_get_contents($fileName));
|
689 |
-
|
690 |
-
if($writeOutcome) {
|
691 |
-
if ($this->_debug) {
|
692 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'upload', 'File upload outcome was ' . $writeOutcome
|
693 |
-
. " - now moving " . $tmpSFTPDir . "/$exportedFile" . " to " . $inboundDir . "/$exportedFile");
|
694 |
-
}
|
695 |
-
$sftpDumpFile->mv($tmpSFTPDir . "/$exportedFile", $inboundDir . "/$exportedFile");
|
696 |
-
$uploadedFiles[] = $exportedFile;
|
697 |
-
}
|
698 |
-
else {
|
699 |
-
if ($this->_debug) {
|
700 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint', 'upload', 'File upload outcome was ' . $writeOutcome
|
701 |
-
. ' Unable to write file' . $tmpSFTPDir . "/$exportedFile");
|
702 |
-
}
|
703 |
-
}
|
704 |
-
}
|
705 |
-
$sftpDumpFile->close();
|
706 |
-
|
707 |
-
} catch (Exception $e) {
|
708 |
-
if ($this->_debug) {
|
709 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint', 'Could not connect to Pitne Bowes sftp server: ',
|
710 |
-
$credentials['host'] . $e->getMessage());
|
711 |
-
}
|
712 |
-
$message = 'Could not connect to Pitney Bowes sftp server:' .$e->getMessage();
|
713 |
-
return $message;
|
714 |
-
}
|
715 |
-
|
716 |
-
if ($this->_debug) {
|
717 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'upload',
|
718 |
-
'Pb catalog file upload ended');
|
719 |
-
}
|
720 |
-
|
721 |
-
$this->_removeExportedFiles($exportedFiles);
|
722 |
-
$this->updateLastProductUpload();
|
723 |
-
$this->_logExportedFileInDB($uploadedFiles);
|
724 |
-
return true;
|
725 |
-
}
|
726 |
-
|
727 |
-
private function _getExportedFilesVariable()
|
728 |
-
{
|
729 |
-
$collection = Mage::getModel("shipperhq_pbint/variable")->getCollection();
|
730 |
-
$exportedFilesVariable = null;
|
731 |
-
foreach ($collection as $variable) {
|
732 |
-
|
733 |
-
if ($variable->getName() == "exportedFiles") {
|
734 |
-
$exportedFilesVariable = $variable;
|
735 |
-
break;
|
736 |
-
}
|
737 |
-
|
738 |
-
}
|
739 |
-
return $exportedFilesVariable;
|
740 |
-
}
|
741 |
-
|
742 |
-
private function _getLastExportedFileNames()
|
743 |
-
{
|
744 |
-
$exportedFilesVariable = $this->_getExportedFilesVariable();
|
745 |
-
if (!isset($exportedFilesVariable))
|
746 |
-
return false;
|
747 |
-
$exportedFiles = explode('|', $exportedFilesVariable->getValue());
|
748 |
-
return $exportedFiles;
|
749 |
-
}
|
750 |
-
|
751 |
-
private function _logExportedFileInDB($exportedFiles)
|
752 |
-
{
|
753 |
-
$strExportedFiles = implode('|', $exportedFiles);
|
754 |
-
$exportedFilesVariable = $this->_getExportedFilesVariable();
|
755 |
-
if (!isset($exportedFilesVariable)) {
|
756 |
-
$exportedFilesVariable = Mage::getModel("shipperhq_pbint/variable");
|
757 |
-
$exportedFilesVariable->setName("exportedFiles");
|
758 |
-
}
|
759 |
-
|
760 |
-
$exportedFilesVariable->setValue($strExportedFiles);
|
761 |
-
$exportedFilesVariable->save();
|
762 |
-
}
|
763 |
-
|
764 |
-
private function _startsWith($haystack, $needle)
|
765 |
-
{
|
766 |
-
// search backwards starting from haystack length characters from the end
|
767 |
-
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
|
768 |
-
}
|
769 |
-
|
770 |
-
private function _endsWith($haystack, $needle)
|
771 |
-
{
|
772 |
-
// search forward starting from end minus needle length characters
|
773 |
-
return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
|
774 |
-
}
|
775 |
-
|
776 |
-
private function _removeExportedFiles($exportedFiles)
|
777 |
-
{
|
778 |
-
$tmpDir = $this->_getTempDir();
|
779 |
-
foreach ($exportedFiles as $exportedFile) {
|
780 |
-
$fileName = $tmpDir . $exportedFile;
|
781 |
-
if (is_dir($fileName))
|
782 |
-
continue;
|
783 |
-
unlink($fileName);
|
784 |
-
$fileName = str_replace(".gpg", "", $fileName); //remove unencrypted file
|
785 |
-
if (is_file($fileName))
|
786 |
-
unlink($fileName);
|
787 |
-
}
|
788 |
-
}
|
789 |
-
|
790 |
-
|
791 |
-
/**
|
792 |
-
* @param Shipperhq_Pbint_Model_Catalog_Product $product
|
793 |
-
* @param string $categoryCode
|
794 |
-
*/
|
795 |
-
private function writeProduct($product, $categoryCode, $parentSku, $category)
|
796 |
-
{
|
797 |
-
if ($product->shouldUpload($this->lastDiff)) {
|
798 |
-
array_push($this->productIds, $product->getMageProduct()->getId());
|
799 |
-
$product->writeToFile($this->file, $categoryCode, $parentSku, $category);
|
800 |
-
fflush($this->file);
|
801 |
-
}
|
802 |
-
}
|
803 |
-
|
804 |
-
public static function stripHtml($text)
|
805 |
-
{
|
806 |
-
return preg_replace("/<\s*\/\s*\w\s*.*?>|<\s*br\s*>/", '', preg_replace("/<\s*\w.*?>/", '', $text));
|
807 |
-
}
|
808 |
-
|
809 |
-
/**
|
810 |
-
* Loads products without categories and logs them in log file
|
811 |
-
*/
|
812 |
-
public function logProdWithoutCategories()
|
813 |
-
{
|
814 |
-
$productCollection = Mage::getResourceModel('catalog/product_collection')
|
815 |
-
->setStoreId(0)
|
816 |
-
->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left')
|
817 |
-
->addAttributeToFilter('category_id', array('null' => true))
|
818 |
-
->addAttributeToSelect('*');
|
819 |
-
|
820 |
-
|
821 |
-
$productCollection->getSelect()->group('product_id')->distinct(true);
|
822 |
-
|
823 |
-
$productCollection->load();
|
824 |
-
$skus = '';
|
825 |
-
foreach ($productCollection as $product) {
|
826 |
-
$skus = $skus . $product->getSku() . ",";
|
827 |
-
|
828 |
-
}
|
829 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
830 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint', 'Products without categories:',
|
831 |
-
$skus);
|
832 |
-
}
|
833 |
-
}
|
834 |
-
|
835 |
-
/**
|
836 |
-
* @return array
|
837 |
-
*/
|
838 |
-
private function _getSftpCredentials()
|
839 |
-
{
|
840 |
-
$credentials = array(
|
841 |
-
'host' => Shipperhq_Pbint_Model_Credentials::getSftpHostname(),
|
842 |
-
"port" => Shipperhq_Pbint_Model_Credentials::getSftpPort(),
|
843 |
-
'username' => Shipperhq_Pbint_Model_Credentials::getSftpUsername(),
|
844 |
-
'password' => Shipperhq_Pbint_Model_Credentials::getSftpPassword(),
|
845 |
-
'timeout' => '10'
|
846 |
-
);
|
847 |
-
return $credentials;
|
848 |
-
}
|
849 |
-
|
850 |
-
/**
|
851 |
-
* @param $part
|
852 |
-
*/
|
853 |
-
private function _stripPartFromFileName($part)
|
854 |
-
{
|
855 |
-
if ($part > 0) {
|
856 |
-
//there is only one part remove part1 from filename
|
857 |
-
rename($this->filename, str_replace('_part1', '', $this->filename));
|
858 |
-
}
|
859 |
-
}
|
860 |
-
}
|
861 |
-
|
862 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Catalog/Product.php
DELETED
@@ -1,244 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Pitney Bowes International
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Class Shipperhq_Pbint_Model_Catalog_Product
|
33 |
-
*
|
34 |
-
*/
|
35 |
-
class Shipperhq_Pbint_Model_Catalog_Product
|
36 |
-
{
|
37 |
-
/*@var $product Mage_Catalog_Model_Product */
|
38 |
-
protected $product;
|
39 |
-
protected $_productUrl;
|
40 |
-
|
41 |
-
|
42 |
-
public function __construct($product, $url = null)
|
43 |
-
{
|
44 |
-
$id = $product;
|
45 |
-
if (gettype($product) == "object" && $id instanceOf Mage_Catalog_Model_Product) {
|
46 |
-
$this->product = $product;
|
47 |
-
} else
|
48 |
-
$this->product = Mage::getModel('catalog/product')->load($id);
|
49 |
-
$this->_productUrl = $url;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Created by BigPixel 6/15/2012
|
54 |
-
* @return Mage_Catalog_Model_Product
|
55 |
-
*/
|
56 |
-
public function getMageProduct()
|
57 |
-
{
|
58 |
-
return $this->product;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @return string
|
63 |
-
*/
|
64 |
-
public function getSKU()
|
65 |
-
{
|
66 |
-
return $this->product->getSku();
|
67 |
-
}
|
68 |
-
|
69 |
-
public function getPrice()
|
70 |
-
{
|
71 |
-
return $this->product->getPrice();
|
72 |
-
}
|
73 |
-
|
74 |
-
public function getUPC()
|
75 |
-
{
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* @return string
|
80 |
-
*/
|
81 |
-
public function getURL()
|
82 |
-
{
|
83 |
-
if ($this->_productUrl)
|
84 |
-
return $this->_productUrl;
|
85 |
-
return $this->product->getProductUrl();
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* @return int
|
90 |
-
* Gets the id of the category that is direct parent of the product
|
91 |
-
*/
|
92 |
-
public function getCategoryCode()
|
93 |
-
{
|
94 |
-
$categories = $this->product->getCategoryCollection();
|
95 |
-
|
96 |
-
$maxDepth = -1;
|
97 |
-
$finalCategory = null;
|
98 |
-
foreach ($categories as $category) {
|
99 |
-
$pathComponents = explode("/", $category->getPath());
|
100 |
-
if (count($pathComponents) > $maxDepth) {
|
101 |
-
$finalCategory = $category;
|
102 |
-
$maxDepth = count($pathComponents);
|
103 |
-
}
|
104 |
-
}
|
105 |
-
return $finalCategory->getId();
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* @return string
|
110 |
-
*
|
111 |
-
*/
|
112 |
-
public function getCountryOfOrigin()
|
113 |
-
{
|
114 |
-
return $this->product->getCountryOfManufacture(); //added by kamran,1/14/2012
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* @return string
|
119 |
-
*/
|
120 |
-
public function getDescription()
|
121 |
-
{
|
122 |
-
return utf8_encode($this->product->getDescription());
|
123 |
-
}
|
124 |
-
|
125 |
-
public function getShortDescription()
|
126 |
-
{
|
127 |
-
return utf8_encode($this->product->getShortDescription());
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @return string
|
132 |
-
*/
|
133 |
-
public function getName()
|
134 |
-
{
|
135 |
-
return utf8_encode($this->product->getName());
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* @return flaot
|
140 |
-
*/
|
141 |
-
public function getWeight()
|
142 |
-
{
|
143 |
-
return $this->product->getWeight();
|
144 |
-
}
|
145 |
-
|
146 |
-
public function getSize()
|
147 |
-
{
|
148 |
-
}
|
149 |
-
|
150 |
-
/**
|
151 |
-
* @param $file
|
152 |
-
* @param $categoryCode
|
153 |
-
* Write this product into the xml file
|
154 |
-
*/
|
155 |
-
public function writeToFile($file, $categoryCode, $parentSku, $category)
|
156 |
-
{
|
157 |
-
/** $categoryCode is passed in method because we don't have categoryCode for child products. BigPixel 6/11/2012 */
|
158 |
-
$name = Shipperhq_Pbint_Model_Catalog_File::stripHtml($this->getName());
|
159 |
-
$name = preg_replace("/[,.\-\+=;:\\(){}\[\]@?%$#]/", '', $name);
|
160 |
-
$string = "<Commodity>\n";
|
161 |
-
$string .= "<CategoryCode><![CDATA[" . htmlentities($categoryCode) . "]]></CategoryCode>\n";
|
162 |
-
$string .= "<SKU><![CDATA[" . htmlentities($this->getSKU()) . "]]></SKU>\n";
|
163 |
-
$string .= "<Name><![CDATA[" . htmlentities($name) . "]]></Name>\n";
|
164 |
-
$string .= "<CountryOfOrigin><![CDATA[" . htmlentities(preg_replace("/[^A-Za-z0-9]/", '', $this->getCountryOfOrigin())) . "]]></CountryOfOrigin>\n"; //added by kamran,1/14/2012
|
165 |
-
$description = Shipperhq_Pbint_Model_Catalog_File::stripHtml($this->getDescription());
|
166 |
-
$description = preg_replace("/[,.\-\+=;:\\(){}\[\]@?%$#]/", '', $description);
|
167 |
-
if (strlen($description) >= 2000) {
|
168 |
-
|
169 |
-
$description = $this->chopString($description, 1999);
|
170 |
-
}
|
171 |
-
|
172 |
-
$shortDescription = Shipperhq_Pbint_Model_Catalog_File::stripHtml($this->getShortDescription());
|
173 |
-
$shortDescription = preg_replace("/[,.\-\+=;:\\(){}\[\]@?%$#]/", '', $shortDescription);
|
174 |
-
if (strlen($shortDescription) >= 2000) {
|
175 |
-
|
176 |
-
$shortDescription = $this->chopString($shortDescription, 1999);
|
177 |
-
}
|
178 |
-
$string .= "<Description><![CDATA[" . $description . "]]></Description>\n";
|
179 |
-
$string .= "<URL><![CDATA[" . htmlentities($this->getURL()) . "]]></URL>\n";
|
180 |
-
|
181 |
-
if ($this->getWeight() != null) {
|
182 |
-
$string .= "<Size><Weight><![CDATA[" . $this->getWeight() . "]]></Weight><Source><![CDATA[" . Shipperhq_Pbint_Model_Credentials::getMerchantCode() . "]]></Source></Size>\n";
|
183 |
-
}
|
184 |
-
$string .= "</Commodity>\n";
|
185 |
-
// fputcsv($this->file,array('MERCHANT_COMMODITY_REF_ID','COMMODITY_NAME_TITLE','SHORT_DESCRIPTION',
|
186 |
-
// 'LONG_DESCRIPTION','RETAILER_ID','COMMODITY_URL','RETAILER_UNIQUE_ID','PCH_CATEGORY_ID',
|
187 |
-
// 'RH_CATEGORY_ID','STANDARD_PRICE','WEIGHT_UNIT','DISTANCE_UNIT','COO','IMAGE_URL','PARENT_SKU',
|
188 |
-
// 'CHILD_SKU','PARCELS_PER_SKU','UPC','UPC_CHECK_DIGIT','GTIN','MPN','ISBN','BRAND','MANUFACTURER',
|
189 |
-
// 'MODEL_NUMBER','MANUFACTURER_STOCK_NUMBER','COMMODITY_CONDITION','COMMODITY_HEIGHT',
|
190 |
-
// 'COMMODITY_WIDTH','COMMODITY_LENGTH','PACKAGE_WEIGHT','PACKAGE_HEIGHT','PACKAGE_WIDTH',
|
191 |
-
// 'PACKAGE_LENGTH','HAZMAT','ORMD','CHEMICAL_INDICATOR','PESTICIDE_INDICATOR','AEROSOL_INDICATOR',
|
192 |
-
// 'RPPC_INDICATOR','BATTERY_TYPE','NON_SPILLABLE_BATTERY','FUEL_RESTRICTION','SHIP_ALONE',
|
193 |
-
// 'RH_CATEGORY_ID_PATH','RH_CATEGORY_NAME_PATH','RH_CATEGORY_URL_PATH','GPC','COMMODITY_WEIGHT',
|
194 |
-
// 'HS_CODE','CURRENCY'));
|
195 |
-
$merchantCode = Shipperhq_Pbint_Model_Credentials::getMerchantCode();
|
196 |
-
fputcsv($file, array($this->getSKU(), $name, $shortDescription,
|
197 |
-
$description, $merchantCode, $this->getURL(), $merchantCode, '',
|
198 |
-
$categoryCode, $this->getPrice(), 'lb', '', $this->getCountryOfOrigin(), '', '',
|
199 |
-
'', '', '', '', '', '', '', '', '',
|
200 |
-
'', '', '', '',
|
201 |
-
'', '', $this->getWeight(), '', '',
|
202 |
-
'', '', '', '', '', '',
|
203 |
-
'', '', '', '', '',
|
204 |
-
strval($category->getData('id_path')), $category->getData('name_path')
|
205 |
-
//,'','','','',$category->getData('store')->getCurrentCurrencyCode()
|
206 |
-
));
|
207 |
-
//fwrite($file, $string);
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* @param $lastDiff
|
212 |
-
* @return bool
|
213 |
-
* Checks whether we need to upload this product or not
|
214 |
-
*/
|
215 |
-
public function shouldUpload($lastDiff)
|
216 |
-
{
|
217 |
-
$lastUpload = $this->product->getPbPbgspUpload();
|
218 |
-
|
219 |
-
if (!$lastUpload) {
|
220 |
-
// First upload.
|
221 |
-
return true;
|
222 |
-
} else if ($lastDiff <= $lastUpload - (30 * 60)) {
|
223 |
-
// Added after the last diff
|
224 |
-
return true;
|
225 |
-
} else {
|
226 |
-
return false;
|
227 |
-
}
|
228 |
-
}
|
229 |
-
|
230 |
-
public function chopString($str, $len)
|
231 |
-
{
|
232 |
-
$end = $len;
|
233 |
-
$lastFour = substr($str, $end - strlen("&"), strlen("&"));
|
234 |
-
$pos = strpos($lastFour, "&");
|
235 |
-
if (!($pos === FALSE)) {
|
236 |
-
$end = $end - strlen("&") + $pos;
|
237 |
-
}
|
238 |
-
$ret = substr($str, 0, $end);
|
239 |
-
return $ret;
|
240 |
-
}
|
241 |
-
|
242 |
-
}
|
243 |
-
|
244 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Credentials.php
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Pitney Bowes International
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
class Shipperhq_Pbint_Model_Credentials {
|
31 |
-
|
32 |
-
public static function decrypt($string) {
|
33 |
-
if (!empty($string)) {
|
34 |
-
return Mage::helper('core')->decrypt($string);
|
35 |
-
}
|
36 |
-
return "";
|
37 |
-
}
|
38 |
-
|
39 |
-
public static function getMaxRecordsCount() {
|
40 |
-
return Mage::getStoreConfig('shipperhqpitney/shqpbint/catalog_size');
|
41 |
-
}
|
42 |
-
public static function getAdminEmail() {
|
43 |
-
return Mage::getStoreConfig('shipperhqpitney/shqpbint/admin_email');
|
44 |
-
}
|
45 |
-
public static function getCatalogSenderID() {
|
46 |
-
return Mage::getStoreConfig('shipperhqpitney/shqpbint/catalog_sender_id');
|
47 |
-
}
|
48 |
-
|
49 |
-
public static function getMerchantCode() {
|
50 |
-
return self::decrypt(Mage::getStoreConfig('shipperhqpitney/shqpbint/merchantcode'));
|
51 |
-
}
|
52 |
-
|
53 |
-
public static function getSftpUsername() {
|
54 |
-
return self::decrypt(Mage::getStoreConfig('shipperhqpitney/shqpbint/ftpuser'));
|
55 |
-
}
|
56 |
-
public static function getSftpPassword() {
|
57 |
-
return self::decrypt(Mage::getStoreConfig('shipperhqpitney/shqpbint/ftppass'));
|
58 |
-
}
|
59 |
-
public static function getSftpHostname() {
|
60 |
-
return Mage::getStoreConfig('shipperhqpitney/shqpbint/ftphost');
|
61 |
-
}
|
62 |
-
public static function getSftpPort() {
|
63 |
-
return Mage::getStoreConfig('shipperhqpitney/shqpbint/ftpport');
|
64 |
-
}
|
65 |
-
public static function getSftpCatalogDirectory() {
|
66 |
-
return self::decrypt(Mage::getStoreConfig('shipperhqpitney/shqpbint/ftpdir'));
|
67 |
-
}
|
68 |
-
public static function isEncryptionEnabled() {
|
69 |
-
return Mage::getStoreConfig('shipperhqpitney/shqpbint/catalog_encryption_enabled');
|
70 |
-
}
|
71 |
-
public static function getPublicKey() {
|
72 |
-
return Mage::getStoreConfig('shipperhqpitney/shqpbint/encryption_public_key');
|
73 |
-
}
|
74 |
-
public static function getPBID() {
|
75 |
-
return "16061";
|
76 |
-
}
|
77 |
-
}
|
78 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Creditmemo/Duty.php
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Creditmemo_Duty extends Mage_Sales_Model_Order_Creditmemo_Total_Tax
|
32 |
-
{
|
33 |
-
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
|
34 |
-
{
|
35 |
-
|
36 |
-
$creditmemo->setShqPbDutyAmount(0);
|
37 |
-
$creditmemo->setBaseShqPbDutyAmount(0);
|
38 |
-
|
39 |
-
$prevCreditmemoDutyAmount = 0;
|
40 |
-
$prevBaseCreditmemoDutyAmount = 0;
|
41 |
-
|
42 |
-
foreach ($creditmemo->getOrder()->getCreditmemosCollection() as $prevCreditmemo) {
|
43 |
-
if ($prevCreditmemo->getShqPbDutyAmount() && ($prevCreditmemo->getState() != Mage_Sales_Model_Order_Creditmemo::STATE_CANCELED)) {
|
44 |
-
$prevCreditmemoDutyAmount += $prevCreditmemo->getShqPbDutyAmount();
|
45 |
-
$prevBaseCreditmemoDutyAmount += $prevCreditmemo->getBaseShqPbDutyAmount();
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
$allowedAmount = $creditmemo->getOrder()->getShqPbDutyAmount() - $prevCreditmemoDutyAmount;
|
50 |
-
$baseAllowedAmount = $creditmemo->getOrder()->getBaseShqPbDutyAmount() - $prevBaseCreditmemoDutyAmount;
|
51 |
-
|
52 |
-
$creditmemoIsLast = true;
|
53 |
-
foreach ($creditmemo->getAllItems() as $item) {
|
54 |
-
$orderItem = $item->getOrderItem();
|
55 |
-
if ($orderItem->isDummy()) {
|
56 |
-
continue;
|
57 |
-
}
|
58 |
-
|
59 |
-
if (!$item->isLast()) {
|
60 |
-
$creditmemoIsLast = false;
|
61 |
-
break;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
if ($creditmemoIsLast) {
|
66 |
-
$creditmemo->setShqPbDutyAmount($allowedAmount);
|
67 |
-
$creditmemo->setBaseShqPbDutyAmount($baseAllowedAmount);
|
68 |
-
|
69 |
-
$creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $allowedAmount);
|
70 |
-
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseAllowedAmount);
|
71 |
-
}
|
72 |
-
|
73 |
-
return $this;
|
74 |
-
}
|
75 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Helper.php
DELETED
@@ -1,224 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Helper extends Mage_Core_Model_Abstract
|
32 |
-
{
|
33 |
-
|
34 |
-
public function processReserveOrderResponse($response)
|
35 |
-
{
|
36 |
-
if($response) {
|
37 |
-
$errors = (array)$response->errors;
|
38 |
-
$responseSummary = (array)$response->responseSummary;
|
39 |
-
if(($errors && count($errors) > 0) || $responseSummary['status'] != 1) {
|
40 |
-
if(Mage::helper('shipperhq_shipper')->isDebug()) {
|
41 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_PbInt', 'Shipper HQ could not reserve the order',
|
42 |
-
$errors, $responseSummary);
|
43 |
-
}
|
44 |
-
//Mage::throwException("Unable to create Pb order.");
|
45 |
-
return false;
|
46 |
-
}
|
47 |
-
|
48 |
-
$orderId = $response->orderId;
|
49 |
-
$shipToHub = (array)$response->shipToHub;
|
50 |
-
$rateInformation = (array)$response->carrierRate;
|
51 |
-
if(empty($shipToHub) || empty($rateInformation) || $orderId == 'Not Set') {
|
52 |
-
if(Mage::helper('shipperhq_shipper')->isDebug()) {
|
53 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_PbInt', 'Shipper HQ did not return Pitney International duties information for order',
|
54 |
-
$response);
|
55 |
-
}
|
56 |
-
return false;
|
57 |
-
}
|
58 |
-
if($rateInformation && isset($rateInformation['rates']) && isset($rateInformation['rates'][0])) {
|
59 |
-
$rate = $rateInformation['rates'][0];
|
60 |
-
Mage::getSingleton("customer/session")->setPbDutyAndTax($rate->customDuties);
|
61 |
-
}
|
62 |
-
$orderNumber = Mage::getModel("shipperhq_pbint/ordernumber");
|
63 |
-
$hubAddress = $shipToHub['address'];
|
64 |
-
$orderNumber->setCpOrderNumber($orderId);
|
65 |
-
$orderNumber->setHubId($shipToHub['hubId']);
|
66 |
-
$orderNumber->setHubStreet1($hubAddress->street);
|
67 |
-
$orderNumber->setHubStreet2($hubAddress->street2);
|
68 |
-
$orderNumber->setHubProvinceOrState($hubAddress->region);
|
69 |
-
$orderNumber->setHubCity($hubAddress->city);
|
70 |
-
$orderNumber->setHubPostcode($hubAddress->zipcode);
|
71 |
-
$orderNumber->setHubCountry($hubAddress->country);
|
72 |
-
|
73 |
-
Mage::getSingleton("customer/session")->setPbOrderNumber($orderNumber);
|
74 |
-
if(Mage::helper('shipperhq_shipper')->isDebug()) {
|
75 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_PbInt',
|
76 |
-
'Shipper HQ Pitney International reserve order successful',
|
77 |
-
"Order ID: " .$orderId);
|
78 |
-
}
|
79 |
-
return true;
|
80 |
-
}
|
81 |
-
|
82 |
-
}
|
83 |
-
/*
|
84 |
-
* Determine whether this shipment requires processing to generate ASN
|
85 |
-
*/
|
86 |
-
public function analyzeProcessShipment($shipment)
|
87 |
-
{
|
88 |
-
$processRequired = false;
|
89 |
-
|
90 |
-
$order = $shipment->getOrder();
|
91 |
-
/* @var $order Mage_Sales_Model_Order */
|
92 |
-
|
93 |
-
if(Mage::helper('shipperhq_pbint')->isPbOrder($order->getCarrierType())) {
|
94 |
-
$processRequired = true;
|
95 |
-
}
|
96 |
-
$parcel = Mage::getModel("shipperhq_pbint/inboundparcel")-> getCollection();
|
97 |
-
$parcel->addFieldToFilter('mage_order_number', $order->getRealOrderId());
|
98 |
-
if(count($parcel) > 0) {
|
99 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
100 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
101 |
-
'Processing shipment', 'Inbound parcel already created for this order');
|
102 |
-
}
|
103 |
-
$processRequired = false;
|
104 |
-
}
|
105 |
-
|
106 |
-
return $processRequired;
|
107 |
-
|
108 |
-
}
|
109 |
-
|
110 |
-
public function processShipmentAddonResponse($shipment, $response, $pitneyOrderId)
|
111 |
-
{
|
112 |
-
try {
|
113 |
-
|
114 |
-
if($response) {
|
115 |
-
$errors = (array)$response->errors;
|
116 |
-
$responseSummary = (array)$response->responseSummary;
|
117 |
-
if(($errors && count($errors) > 0) || $responseSummary['status'] != 1) {
|
118 |
-
if(Mage::helper('shipperhq_shipper')->isDebug()) {
|
119 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_PbInt', 'Shipper HQ could create ASN for Pitney order',
|
120 |
-
$errors, $responseSummary);
|
121 |
-
}
|
122 |
-
return false;
|
123 |
-
}
|
124 |
-
$orderID = $shipment->getOrder()->getRealOrderId();
|
125 |
-
if(!isset($response->parcelId)) {
|
126 |
-
if(Mage::helper('shipperhq_shipper')->isDebug()) {
|
127 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_PbInt', 'Shipper HQ inbound parcel response.',
|
128 |
-
'No parcel ID returned for orderID' .$orderID . ', Pitney Order ID: ' .$pitneyOrderId .' with response: ' .$response);
|
129 |
-
}
|
130 |
-
return;
|
131 |
-
}
|
132 |
-
$pitneyParcel = Mage::getModel('shipperhq_pbint/inboundparcel');
|
133 |
-
$pitneyParcel->setInboundParcel($response->parcelId);
|
134 |
-
$pitneyParcel->setMageOrderNumber($orderID);
|
135 |
-
$pitneyParcel->setPbOrderNumber( $pitneyOrderId);
|
136 |
-
$pitneyParcel->save();
|
137 |
-
if(Mage::helper('shipperhq_shipper')->isDebug()) {
|
138 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_PbInt', 'Shipper HQ created inbound parcel ID.',
|
139 |
-
'Magento Order ID: ' .$orderID . ', Pitney Order ID: ' .$pitneyOrderId .' with ASN: ' .$response->parcelId);
|
140 |
-
}
|
141 |
-
|
142 |
-
|
143 |
-
}
|
144 |
-
}
|
145 |
-
catch(Exception $e) {
|
146 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
147 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
148 |
-
'Error creating inbound parcel.', $e->getMessage());
|
149 |
-
}
|
150 |
-
Mage::logException($e);
|
151 |
-
}
|
152 |
-
}
|
153 |
-
|
154 |
-
public function confirmOrderRequired($magentoOrderNumber)
|
155 |
-
{
|
156 |
-
Mage::getSingleton("customer/session")->setPbDutyAndTax(0);
|
157 |
-
$orderNumber = Mage::getSingleton("customer/session")->getPbOrderNumber();
|
158 |
-
|
159 |
-
if($orderNumber) {
|
160 |
-
$orderNumber->setMageOrderNumber($magentoOrderNumber);
|
161 |
-
$orderNumber->setConfirmed(false);
|
162 |
-
$orderNumber->setReferenced(false);
|
163 |
-
$orderNumber->save();
|
164 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
165 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
166 |
-
'Confirm order required with ShipperHQ Pitney for', $magentoOrderNumber.'. Hub ID: '
|
167 |
-
.$orderNumber->getHubId() . ', Hub country: ' . $orderNumber->getHubCountry());
|
168 |
-
}
|
169 |
-
Mage::getSingleton("customer/session")->setPbOrderNumber($orderNumber);
|
170 |
-
return $orderNumber->getData('cp_order_number');
|
171 |
-
}
|
172 |
-
return false;
|
173 |
-
}
|
174 |
-
|
175 |
-
public function processConfirmOrderResponse($response)
|
176 |
-
{
|
177 |
-
$pbOrder = Mage::getSingleton("customer/session")->getPbOrderNumber();
|
178 |
-
|
179 |
-
if(!is_object($response)) {
|
180 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
181 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
182 |
-
'Confirm Order did not return a response', $response);
|
183 |
-
}
|
184 |
-
return;
|
185 |
-
}
|
186 |
-
|
187 |
-
$errors = (array)$response->errors;
|
188 |
-
$responseSummary = (array)$response->responseSummary;
|
189 |
-
$result = isset($response->result) ? (array)$response->result : false;
|
190 |
-
if(($errors && count($errors) > 0) || $responseSummary['status'] != 1) {
|
191 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
192 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
193 |
-
'Error confirming order', $response);
|
194 |
-
}
|
195 |
-
}
|
196 |
-
elseif(in_array('SUCCCESS', $result)) {
|
197 |
-
try {
|
198 |
-
$pbOrder->setConfirmed(true);
|
199 |
-
$pbOrder->setReferenced(true);
|
200 |
-
$pbOrder->save();
|
201 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
202 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
203 |
-
'Confirmed order for ShipperHQ Pitney Bowes', $pbOrder->getData('mage_order_number'));
|
204 |
-
}
|
205 |
-
}
|
206 |
-
catch(Exception $e) {
|
207 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
208 |
-
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Pbint',
|
209 |
-
'Confirm order response processing, error', $e->getMessage());
|
210 |
-
}
|
211 |
-
}
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
/*
|
216 |
-
* reset session saved variables
|
217 |
-
*/
|
218 |
-
public function cleanDownSession()
|
219 |
-
{
|
220 |
-
Mage::getSingleton("customer/session")->setPbDutyAndTax(false);
|
221 |
-
Mage::getSingleton("customer/session")->setPbOrderNumber(false);
|
222 |
-
|
223 |
-
}
|
224 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Invoice/Duty.php
DELETED
@@ -1,79 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Invoice_Duty extends Mage_Sales_Model_Order_Invoice_Total_Tax
|
32 |
-
{
|
33 |
-
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
|
34 |
-
{
|
35 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
36 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
37 |
-
'Shipperhq_Pbint_Model_Invoice_Duty', 'collect function');
|
38 |
-
}
|
39 |
-
$invoice->setShqPbDutyAmount(0);
|
40 |
-
$invoice->setBaseShqPbDutyAmount(0);
|
41 |
-
|
42 |
-
// Get any amount we've invoiced already
|
43 |
-
$prevInvoiceDutyAmount = 0;
|
44 |
-
$prevBaseInvoiceDutyAmount = 0;
|
45 |
-
foreach ($invoice->getOrder()->getInvoiceCollection() as $prevInvoice) {
|
46 |
-
if ($prevInvoice->getShqPbDutyAmount() && !$prevInvoice->isCanceled()) {
|
47 |
-
$prevInvoiceDutyAmount += $prevInvoice->getShqPbDutyAmount();
|
48 |
-
$prevBaseInvoiceDutyAmount += $prevInvoice->getBaseShqPbDutyAmount();
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
$dutyAmount = 0;
|
53 |
-
$baseDutyAmount = 0;
|
54 |
-
$invoiceIsLast = true;
|
55 |
-
foreach ($invoice->getAllItems() as $item) {
|
56 |
-
$orderItem = $item->getOrderItem();
|
57 |
-
if ($orderItem->isDummy()) {
|
58 |
-
continue;
|
59 |
-
}
|
60 |
-
|
61 |
-
if (!$item->isLast()) {
|
62 |
-
$invoiceIsLast = false;
|
63 |
-
}
|
64 |
-
|
65 |
-
}
|
66 |
-
if ($invoiceIsLast) {
|
67 |
-
$dutyAmount = $invoice->getOrder()->getShqPbDutyAmount() - $prevInvoiceDutyAmount;
|
68 |
-
$baseDutyAmount = $invoice->getOrder()->getBaseShqPbDutyAmount() - $prevBaseInvoiceDutyAmount;
|
69 |
-
}
|
70 |
-
|
71 |
-
$invoice->setShqPbDutyAmount($dutyAmount);
|
72 |
-
$invoice->setBaseShqPbDutyAmount($baseDutyAmount);
|
73 |
-
|
74 |
-
$invoice->setGrandTotal($invoice->getGrandTotal() + $dutyAmount);
|
75 |
-
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseDutyAmount);
|
76 |
-
|
77 |
-
return $this;
|
78 |
-
}
|
79 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Mysql4/Inboundparcel/Collection.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Mysql4_Inboundparcel_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
32 |
-
{
|
33 |
-
public function _construct()
|
34 |
-
{
|
35 |
-
$this->_init('shipperhq_pbint/inboundparcel');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Mysql4/Ordernumber.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Mysql4_Ordernumber extends Mage_Core_Model_Mysql4_Abstract
|
32 |
-
{
|
33 |
-
public function _construct()
|
34 |
-
{
|
35 |
-
$this->_init('shipperhq_pbint/ordernumber', 'ordernumber_id');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Mysql4/Ordernumber/Collection.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Mysql4_Ordernumber_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
32 |
-
{
|
33 |
-
public function _construct()
|
34 |
-
{
|
35 |
-
$this->_init('shipperhq_pbint/ordernumber');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Mysql4/Variable.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Mysql4_Variable extends Mage_Core_Model_Mysql4_Abstract
|
32 |
-
{
|
33 |
-
public function _construct()
|
34 |
-
{
|
35 |
-
$this->_init('shipperhq_pbint/variable', 'variable_id');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Mysql4/Variable/Collection.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Mysql4_Variable_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
32 |
-
{
|
33 |
-
public function _construct()
|
34 |
-
{
|
35 |
-
$this->_init('shipperhq_pbint/variable');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Observer.php
DELETED
@@ -1,171 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Observer extends Mage_Core_Model_Abstract
|
32 |
-
{
|
33 |
-
const MODULE_NAME = 'Shipperhq_Pbint';
|
34 |
-
|
35 |
-
public function addDutiesOnEstimation($observer)
|
36 |
-
{
|
37 |
-
Mage::getSingleton("customer/session")->setPbDutyAndTax(false);
|
38 |
-
|
39 |
-
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
40 |
-
$selectedMethod = null;
|
41 |
-
if ($quote->getShippingAddress()) {
|
42 |
-
$selectedMethod = $quote->getShippingAddress()->getShippingMethod();
|
43 |
-
}
|
44 |
-
|
45 |
-
if ($selectedMethod) {
|
46 |
-
$rate = $quote->getShippingAddress()->getShippingRateByCode($selectedMethod);
|
47 |
-
if($rate) {
|
48 |
-
if (Mage::helper('shipperhq_pbint')->isDebug()) {
|
49 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Pbint',
|
50 |
-
'Add duties on estimation', $rate->getMethod() . ' and tax' . $rate->getCustomDuties());
|
51 |
-
}
|
52 |
-
Mage::getSingleton("customer/session")->setPbDutyAndTax($rate->getCustomDuties());
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
public function modifyOrderView($observer = NULL)
|
59 |
-
{
|
60 |
-
if (!$observer) {
|
61 |
-
return;
|
62 |
-
}
|
63 |
-
if (Mage::getStoreConfig('advanced/modules_disable_output/' . self::MODULE_NAME))
|
64 |
-
return;
|
65 |
-
$transport = $observer->getEvent()->getTransport();
|
66 |
-
$layoutName = $observer->getEvent()->getBlock()->getNameInLayout();
|
67 |
-
if ('order_info' == $layoutName) {
|
68 |
-
|
69 |
-
$pitneyOrderNumber = $this->_getCpOrderNumber($observer->getEvent()->getBlock()->getOrder());
|
70 |
-
if ($pitneyOrderNumber) {
|
71 |
-
$html = "<div class='entry-edit'>
|
72 |
-
<div class='entry-edit-head'>
|
73 |
-
<h4 class='icon-head '>Pitney Bowes Shipments</h4>
|
74 |
-
</div>
|
75 |
-
<fieldset>
|
76 |
-
<strong>PB Order Number</strong>
|
77 |
-
<span>" . $pitneyOrderNumber->getCpOrderNumber() . "</span><br/>
|
78 |
-
<strong>Hub ID</strong>
|
79 |
-
<span>" . $pitneyOrderNumber->getHubId() . "</span><br/>
|
80 |
-
<strong>Hub Street 1</strong>
|
81 |
-
<span>" . $pitneyOrderNumber->getHubStreet1() . "</span><br/>
|
82 |
-
<strong>Hub Street 2</strong>
|
83 |
-
<span>" . $pitneyOrderNumber->getHubStreet2() . "</span><br/>
|
84 |
-
<strong>Hub City</strong>
|
85 |
-
<span>" . $pitneyOrderNumber->getHubCity() . "</span><br/>
|
86 |
-
<strong>Hub Province/State</strong>
|
87 |
-
<span>" . $pitneyOrderNumber->getHubProvinceOrState() . "</span><br/>
|
88 |
-
<strong>Hub Zip</strong>
|
89 |
-
<span>" . $pitneyOrderNumber->getHubPostcode() . "</span><br/>
|
90 |
-
<strong>Hub Country</strong>
|
91 |
-
<span>" . $pitneyOrderNumber->getHubCountry() . "</span><br/>
|
92 |
-
</fieldset>
|
93 |
-
</div>";
|
94 |
-
$transport['html'] = $transport['html'] . $html;
|
95 |
-
}
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
} else if ('email/order/shipment/track.phtml' == $observer->getEvent()->getBlock()->getTemplate()) {
|
100 |
-
|
101 |
-
$cpord = $this->_getCPORD($observer->getEvent()->getBlock()->getOrder());
|
102 |
-
if ($cpord) {
|
103 |
-
$staging = 0;
|
104 |
-
//TODO offer staging
|
105 |
-
$transport['html'] = "<a href='http://tracking.ecommerce.pb.com/track/$cpord?staging=$staging'>Track your order</a>";
|
106 |
-
}
|
107 |
-
|
108 |
-
} else if ('shipping.tracking.popup' == $layoutName) {
|
109 |
-
|
110 |
-
$helper = Mage::helper('shipping');
|
111 |
-
$data = $helper->decodeTrackingHash($observer->getEvent()->getBlock()->getRequest()->getParam('hash'));
|
112 |
-
|
113 |
-
$orderId = null;
|
114 |
-
if ($data['key'] == 'order_id')
|
115 |
-
$orderId = $data['id'];
|
116 |
-
else if ($data['key'] == 'ship_id') {
|
117 |
-
/* @var $model Mage_Sales_Model_Order_Shipment */
|
118 |
-
$model = Mage::getModel('sales/order_shipment');
|
119 |
-
$ship = $model->load($data['id']);
|
120 |
-
$orderId = $model->getOrderId();
|
121 |
-
} else if ($data['key'] == 'track_id') {
|
122 |
-
$track = Mage::getModel('sales/order_shipment_track')->load($data['id']);
|
123 |
-
$orderId = $track->getOrderId();
|
124 |
-
}
|
125 |
-
if (!$orderId)
|
126 |
-
return;
|
127 |
-
$cpord = $this->_getCPORD(Mage::getModel('sales/order')->load($orderId));
|
128 |
-
if ($cpord) {
|
129 |
-
$staging = 0;
|
130 |
-
//TODO offer staging
|
131 |
-
$script = "<script lang='javascript'>
|
132 |
-
window.location = 'http://tracking.ecommerce.pb.com/track/$cpord?staging=$staging';
|
133 |
-
</script>
|
134 |
-
";
|
135 |
-
$transport['html'] = $script;
|
136 |
-
}
|
137 |
-
|
138 |
-
}
|
139 |
-
return $this;
|
140 |
-
}
|
141 |
-
|
142 |
-
private function _getCPORD($order)
|
143 |
-
{
|
144 |
-
if ($order) {
|
145 |
-
$cpOrder = $this->_getCpOrderNumber($order);
|
146 |
-
if ($cpOrder) {
|
147 |
-
return $cpOrder->getCpOrderNumber();
|
148 |
-
}
|
149 |
-
|
150 |
-
}
|
151 |
-
|
152 |
-
return false;
|
153 |
-
}
|
154 |
-
|
155 |
-
private function _getCpOrderNumber($order)
|
156 |
-
{
|
157 |
-
if ($order) {
|
158 |
-
$clearPathOrders = Mage::getModel("shipperhq_pbint/ordernumber")->getCollection();
|
159 |
-
|
160 |
-
$clearPathOrders->addFieldToFilter('mage_order_number', $order->getRealOrderId());
|
161 |
-
foreach ($clearPathOrders as $cpOrder) {
|
162 |
-
return $cpOrder;
|
163 |
-
|
164 |
-
}
|
165 |
-
}
|
166 |
-
|
167 |
-
return false;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
|
171 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Ordernumber.php
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Ordernumber extends Mage_Core_Model_Abstract
|
32 |
-
{
|
33 |
-
public function _construct()
|
34 |
-
{
|
35 |
-
parent::_construct();
|
36 |
-
$this->_init('shipperhq_pbint/ordernumber');
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Pdf/Duty.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Pitney Bowes International
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
class Shipperhq_Pbint_Model_Pdf_Duty extends Mage_Tax_Model_Sales_Pdf_Tax {
|
31 |
-
public function getTitle() {
|
32 |
-
$shipMethod = $this->getOrder()->getShippingMethod();
|
33 |
-
$len = strlen("pbint_");
|
34 |
-
if (strlen($shipMethod) > $len && substr($shipMethod,0,$len) == "pbint_") {
|
35 |
-
return "Importation Charges";
|
36 |
-
}
|
37 |
-
return parent::getTitle();
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Quote/Duty.php
DELETED
@@ -1,90 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Pitney Bowes International
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
class Shipperhq_Pbint_Model_Quote_Duty extends Mage_Sales_Model_Quote_Address_Total_Abstract
|
31 |
-
{
|
32 |
-
/**
|
33 |
-
* Discount calculation object
|
34 |
-
*
|
35 |
-
* @var Mage_SalesRule_Model_Validator
|
36 |
-
*/
|
37 |
-
protected $dutyCalculated = false;
|
38 |
-
protected $dutyDisplayed = false;
|
39 |
-
|
40 |
-
public function __construct()
|
41 |
-
{
|
42 |
-
// parent::__construct();
|
43 |
-
$this->setCode('shq_pb_duty');
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
public function getDutyAndTax() {
|
48 |
-
return Mage::getSingleton("customer/session")->getPbDutyAndTax();
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Collect address discount amount
|
53 |
-
*
|
54 |
-
* @param Mage_Sales_Model_Quote_Address $address
|
55 |
-
* @return Mage_SalesRule_Model_Quote_Discount
|
56 |
-
*/
|
57 |
-
public function collect(Mage_Sales_Model_Quote_Address $address)
|
58 |
-
{
|
59 |
-
parent::collect($address);
|
60 |
-
|
61 |
-
if ($amount = $this->getDutyAndTax()) {
|
62 |
-
$items = $this->_getAddressItems($address);
|
63 |
-
if (!count($items)) {
|
64 |
-
return $this;
|
65 |
-
}
|
66 |
-
|
67 |
-
$this->_setAmount($address->getQuote()->getStore()->convertPrice($amount, false));
|
68 |
-
$this->_setBaseAmount($amount);
|
69 |
-
}
|
70 |
-
return $this;
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Add discount total information to address
|
76 |
-
*
|
77 |
-
* @param Mage_Sales_Model_Quote_Address $address
|
78 |
-
* @return Mage_SalesRule_Model_Quote_Discount
|
79 |
-
*/
|
80 |
-
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
81 |
-
{
|
82 |
-
if ($address->getShqPbDutyAmount() != 0) {
|
83 |
-
$address->addTotal(array(
|
84 |
-
'code' => $this->getCode(),
|
85 |
-
'title' => 'International Duty',
|
86 |
-
'value' => $address->getShqPbDutyAmount()
|
87 |
-
));
|
88 |
-
}
|
89 |
-
}
|
90 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Resource/Mysql4/Setup.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Pitney Bowes International
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
|
31 |
-
class Shipperhq_Pbint_Model_Resource_Mysql4_Setup extends Mage_Tax_Model_Mysql4_Setup {
|
32 |
-
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/Model/Variable.php
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Model_Variable extends Mage_Core_Model_Abstract
|
32 |
-
{
|
33 |
-
public function _construct()
|
34 |
-
{
|
35 |
-
parent::_construct();
|
36 |
-
$this->_init('shipperhq_pbint/variable');
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/README
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
Dependencies:
|
2 |
-
gnupg
|
|
|
|
app/code/community/Shipperhq/Pbint/changelog.txt
DELETED
File without changes
|
app/code/community/Shipperhq/Pbint/controllers/Adminhtml/ShqpitneyController.php
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
* Webshopapps Shipping Module
|
6 |
-
*
|
7 |
-
* NOTICE OF LICENSE
|
8 |
-
*
|
9 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
-
* that is bundled with this package in the file LICENSE.txt.
|
11 |
-
* It is also available through the world-wide-web at this URL:
|
12 |
-
* http://opensource.org/licenses/osl-3.0.php
|
13 |
-
* If you did not receive a copy of the license and are unable to
|
14 |
-
* obtain it through the world-wide-web, please send an email
|
15 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
16 |
-
*
|
17 |
-
* DISCLAIMER
|
18 |
-
*
|
19 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
20 |
-
* versions in the future. If you wish to customize Magento for your
|
21 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
-
*
|
23 |
-
* Shipper HQ Pitney Bowes International
|
24 |
-
*
|
25 |
-
* @category ShipperHQ
|
26 |
-
* @package ShipperHQ_Shipping_Carrier
|
27 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
28 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
-
*/
|
31 |
-
class Shipperhq_Pbint_Adminhtml_ShqpitneyController extends Mage_Adminhtml_Controller_Action
|
32 |
-
{
|
33 |
-
|
34 |
-
public function uploadcatalogAction()
|
35 |
-
{
|
36 |
-
$pbExport = Mage::getModel('shipperhq_pbint/catalog_cron');
|
37 |
-
$result = $pbExport->uploadCatalog();
|
38 |
-
$pbExport->processStatusNotifications();
|
39 |
-
$session = Mage::getSingleton('Mage_Adminhtml_Model_Session');
|
40 |
-
$session->getMessages(true);
|
41 |
-
$success = 1;
|
42 |
-
|
43 |
-
if ($result === true) {
|
44 |
-
$message = Mage::helper('shipperhq_pbint')->__('Catalog synch was a success');
|
45 |
-
$session->addSuccess($message);
|
46 |
-
}
|
47 |
-
else {
|
48 |
-
$message = Mage::helper('shipperhq_pbint')->__(
|
49 |
-
'Catalog synch with Pitney Bowes did not complete. ');
|
50 |
-
if(is_string($result)) {
|
51 |
-
$message .= $result;
|
52 |
-
}
|
53 |
-
else {
|
54 |
-
$message .= Mage::helper('shipperhq_pbint')->__('Please review your log files for error details');
|
55 |
-
}
|
56 |
-
$session->addError($message);
|
57 |
-
$success = 0;
|
58 |
-
}
|
59 |
-
|
60 |
-
$this->_initLayoutMessages('adminhtml/session');
|
61 |
-
$session_messages = $this->getLayout()->getMessagesBlock()->getGroupedHtml();
|
62 |
-
|
63 |
-
$result = array('result' => $success, 'message' => $message, 'session_messages' => $session_messages);
|
64 |
-
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
65 |
-
}
|
66 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/etc/config.xml
DELETED
@@ -1,248 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Shipperhq_Pbint>
|
5 |
-
<version>1.0.1</version>
|
6 |
-
</Shipperhq_Pbint>
|
7 |
-
</modules>
|
8 |
-
<admin>
|
9 |
-
<routers>
|
10 |
-
<adminhtml>
|
11 |
-
<args>
|
12 |
-
<modules>
|
13 |
-
<Shipperhq_Pbint after="Mage_Adminhtml">Shipperhq_Pbint_Adminhtml</Shipperhq_Pbint>
|
14 |
-
</modules>
|
15 |
-
</args>
|
16 |
-
</adminhtml>
|
17 |
-
</routers>
|
18 |
-
</admin>
|
19 |
-
<global>
|
20 |
-
<blocks>
|
21 |
-
<shipperhq_pbint>
|
22 |
-
<class>Shipperhq_Pbint_Block</class>
|
23 |
-
</shipperhq_pbint>
|
24 |
-
</blocks>
|
25 |
-
<helpers>
|
26 |
-
<shipperhq_pbint>
|
27 |
-
<class>Shipperhq_Pbint_Helper</class>
|
28 |
-
</shipperhq_pbint>
|
29 |
-
</helpers>
|
30 |
-
<models>
|
31 |
-
<shipperhq_pbint>
|
32 |
-
<class>Shipperhq_Pbint_Model</class>
|
33 |
-
<resourceModel>shipperhq_pbint_mysql4</resourceModel>
|
34 |
-
</shipperhq_pbint>
|
35 |
-
<shipperhq_pbint_mysql4>
|
36 |
-
<class>Shipperhq_Pbint_Model_Mysql4</class>
|
37 |
-
<entities>
|
38 |
-
<variable>
|
39 |
-
<table>shqpbint_variable</table>
|
40 |
-
</variable>
|
41 |
-
<ordernumber>
|
42 |
-
<table>shqpbint_ordernumber</table>
|
43 |
-
</ordernumber>
|
44 |
-
<inboundparcel>
|
45 |
-
<table>shqpbint_inbound_parcel</table>
|
46 |
-
</inboundparcel>
|
47 |
-
</entities>
|
48 |
-
</shipperhq_pbint_mysql4>
|
49 |
-
</models>
|
50 |
-
<resources>
|
51 |
-
<shqpbint_setup>
|
52 |
-
<setup>
|
53 |
-
<module>Shipperhq_Pbint</module>
|
54 |
-
<class>Shipperhq_Pbint_Model_Resource_Mysql4_Setup</class>
|
55 |
-
</setup>
|
56 |
-
<connection>
|
57 |
-
<use>core_setup</use>
|
58 |
-
</connection>
|
59 |
-
</shqpbint_setup>
|
60 |
-
<shipperhq_pbint_write>
|
61 |
-
<connection>
|
62 |
-
<use>core_write</use>
|
63 |
-
</connection>
|
64 |
-
</shipperhq_pbint_write>
|
65 |
-
<shipperhq_pbint_read>
|
66 |
-
<connection>
|
67 |
-
<use>core_read</use>
|
68 |
-
</connection>
|
69 |
-
</shipperhq_pbint_read>
|
70 |
-
</resources>
|
71 |
-
<events>
|
72 |
-
<core_block_abstract_to_html_after>
|
73 |
-
<observers>
|
74 |
-
<Shipperhq_Pbint_Model_OrderView>
|
75 |
-
<type>model</type>
|
76 |
-
<class>shipperhq_pbint/observer</class>
|
77 |
-
<method>modifyOrderView</method>
|
78 |
-
</Shipperhq_Pbint_Model_OrderView>
|
79 |
-
</observers>
|
80 |
-
</core_block_abstract_to_html_after>
|
81 |
-
<controller_action_postdispatch_checkout_cart_estimateUpdatePost>
|
82 |
-
<observers>
|
83 |
-
<Shipperhq_Pbint_Estimated_Shipping>
|
84 |
-
<type>model</type>
|
85 |
-
<class>shipperhq_pbint/observer</class>
|
86 |
-
<method>addDutiesOnEstimation</method>
|
87 |
-
</Shipperhq_Pbint_Estimated_Shipping>
|
88 |
-
</observers>
|
89 |
-
</controller_action_postdispatch_checkout_cart_estimateUpdatePost>
|
90 |
-
</events>
|
91 |
-
<sales>
|
92 |
-
<quote>
|
93 |
-
<totals>
|
94 |
-
<shq_pb_duty>
|
95 |
-
<class>Shipperhq_Pbint_Model_Quote_Duty</class>
|
96 |
-
<before>grand_total</before>
|
97 |
-
<after>tax</after>
|
98 |
-
</shq_pb_duty>
|
99 |
-
</totals>
|
100 |
-
</quote>
|
101 |
-
<order_invoice>
|
102 |
-
<totals>
|
103 |
-
<shq_pb_duty>
|
104 |
-
<class>Shipperhq_Pbint_Model_Invoice_Duty</class>
|
105 |
-
<before>grand_total</before>
|
106 |
-
<after>tax</after>
|
107 |
-
</shq_pb_duty>
|
108 |
-
</totals>
|
109 |
-
</order_invoice>
|
110 |
-
<order_creditmemo>
|
111 |
-
<totals>
|
112 |
-
<shq_pb_duty>
|
113 |
-
<class>Shipperhq_Pbint_Model_Creditmemo_Duty</class>
|
114 |
-
<before>grand_total</before>
|
115 |
-
<after>tax</after>
|
116 |
-
</shq_pb_duty>
|
117 |
-
</totals>
|
118 |
-
</order_creditmemo>
|
119 |
-
</sales>
|
120 |
-
<pdf>
|
121 |
-
<totals>
|
122 |
-
<shq_pb_duty translate="title">
|
123 |
-
<title>International Duty</title>
|
124 |
-
<source_field>shq_pb_duty</source_field>
|
125 |
-
<model>shipperhq_pbint/pdf_duty</model>
|
126 |
-
<font_size>7</font_size>
|
127 |
-
<display_zero>0</display_zero>
|
128 |
-
<sort_order>300</sort_order>
|
129 |
-
</shq_pb_duty>
|
130 |
-
</totals>
|
131 |
-
</pdf>
|
132 |
-
<template>
|
133 |
-
<email>
|
134 |
-
<wsa_email_shipment_template translate="label" module="sales">
|
135 |
-
<label>ShipperHQ Pitney Bowes Custom Shipment Email</label>
|
136 |
-
<file>sales/shipperhq_pitney_shipment_new.html</file>
|
137 |
-
<type>html</type>
|
138 |
-
</wsa_email_shipment_template>
|
139 |
-
</email>
|
140 |
-
</template>
|
141 |
-
<fieldsets>
|
142 |
-
<!-- copies data from quote address to order during the order placement -->
|
143 |
-
<sales_convert_quote_address>
|
144 |
-
<base_shq_pb_duty_amount>
|
145 |
-
<to_order>*</to_order>
|
146 |
-
</base_shq_pb_duty_amount>
|
147 |
-
<shq_pb_duty_amount>
|
148 |
-
<to_order>*</to_order>
|
149 |
-
</shq_pb_duty_amount>
|
150 |
-
</sales_convert_quote_address>
|
151 |
-
<!-- copies data from order to invoice/shipment/creditmemo during their creation -->
|
152 |
-
<sales_convert_order>
|
153 |
-
<base_shq_pb_duty_amount>
|
154 |
-
<to_invoice>*</to_invoice>
|
155 |
-
<to_shipment>*</to_shipment>
|
156 |
-
<to_cm>*</to_cm>
|
157 |
-
</base_shq_pb_duty_amount>
|
158 |
-
<shq_pb_duty_amount>
|
159 |
-
<to_invoice>*</to_invoice>
|
160 |
-
<to_shipment>*</to_shipment>
|
161 |
-
<to_cm>*</to_cm>
|
162 |
-
</shq_pb_duty_amount>
|
163 |
-
</sales_convert_order>
|
164 |
-
</fieldsets>
|
165 |
-
</global>
|
166 |
-
<default>
|
167 |
-
<shipperhqpitney>
|
168 |
-
<shqpbint>
|
169 |
-
<catalog_encryption_enabled>0</catalog_encryption_enabled>
|
170 |
-
<catalog_diff>1</catalog_diff>
|
171 |
-
<catalog_full>1</catalog_full>
|
172 |
-
<catalog_size>10000</catalog_size>
|
173 |
-
</shqpbint>
|
174 |
-
</shipperhqpitney>
|
175 |
-
</default>
|
176 |
-
|
177 |
-
<!-- Please modify this part for CRON JOB
|
178 |
-
For more information on Magento Cron Job, please visit the following url:
|
179 |
-
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job#built-in_cron_jobs
|
180 |
-
-->
|
181 |
-
<crontab>
|
182 |
-
<jobs>
|
183 |
-
<shipperhq_pbint>
|
184 |
-
<schedule>
|
185 |
-
<cron_expr>30 * * * *</cron_expr>
|
186 |
-
</schedule>
|
187 |
-
<run>
|
188 |
-
<model>shipperhq_pbint/catalog_cron::catalogSync</model>
|
189 |
-
</run>
|
190 |
-
</shipperhq_pbint>
|
191 |
-
<pb_notifications>
|
192 |
-
<schedule>
|
193 |
-
<cron_expr>20 * * * *</cron_expr>
|
194 |
-
</schedule>
|
195 |
-
<run>
|
196 |
-
<model>shipperhq_pbint/catalog_cron::processStatusNotifications</model>
|
197 |
-
</run>
|
198 |
-
</pb_notifications>
|
199 |
-
</jobs>
|
200 |
-
</crontab>
|
201 |
-
<frontend>
|
202 |
-
<layout>
|
203 |
-
<updates>
|
204 |
-
<shipperhq_pbint module="Shipperhq_Pbint">
|
205 |
-
<file>shipperhq/pbint.xml</file>
|
206 |
-
</shipperhq_pbint>
|
207 |
-
</updates>
|
208 |
-
</layout>
|
209 |
-
</frontend>
|
210 |
-
<adminhtml>
|
211 |
-
<layout>
|
212 |
-
<updates>
|
213 |
-
<shipperhq_pbint module="Shipperhq_Pbint">
|
214 |
-
<file>shipperhq/pbint.xml</file>
|
215 |
-
</shipperhq_pbint>
|
216 |
-
</updates>
|
217 |
-
</layout>
|
218 |
-
<acl>
|
219 |
-
<resources>
|
220 |
-
<admin>
|
221 |
-
<children>
|
222 |
-
<system>
|
223 |
-
<children>
|
224 |
-
<config>
|
225 |
-
<children>
|
226 |
-
<shipperhqpitney>
|
227 |
-
<title>ShipperHQ Pitney Bowes International</title>
|
228 |
-
</shipperhqpitney>
|
229 |
-
</children>
|
230 |
-
</config>
|
231 |
-
</children>
|
232 |
-
</system>
|
233 |
-
</children>
|
234 |
-
</admin>
|
235 |
-
</resources>
|
236 |
-
</acl>
|
237 |
-
<translate>
|
238 |
-
<modules>
|
239 |
-
<translations>
|
240 |
-
<files>
|
241 |
-
<default>Shipperhq_Pbint.csv</default>
|
242 |
-
</files>
|
243 |
-
</translations>
|
244 |
-
</modules>
|
245 |
-
</translate>
|
246 |
-
</adminhtml>
|
247 |
-
</config>
|
248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/etc/system.xml
DELETED
@@ -1,162 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<tabs>
|
4 |
-
<shipperhq translate="label" module="shipperhq_pbint">
|
5 |
-
<label>ShipperHQ<!--<![CDATA[ <img src="http://www.webshopapps.com/images/logos/WSA_OfficialLogo_HorizontalLockup.png" alt='WebShopApps' height='22' /> ]]> -->
|
6 |
-
</label>
|
7 |
-
<sort_order>300</sort_order>
|
8 |
-
</shipperhq>
|
9 |
-
</tabs>
|
10 |
-
<sections>
|
11 |
-
<shipperhqpitney translate="label" module="shipperhq_pbint">
|
12 |
-
<label>ShipperHQ Pitney Bowes International</label>
|
13 |
-
<tab>shipperhq</tab>
|
14 |
-
<sort_order>40</sort_order>
|
15 |
-
<show_in_default>1</show_in_default>
|
16 |
-
<show_in_website>1</show_in_website>
|
17 |
-
<show_in_store>1</show_in_store>
|
18 |
-
<groups>
|
19 |
-
<shqpbint translate="label" module="shipperhq_pbint">
|
20 |
-
<label>ShipperHQ Pitney Bowes International</label>
|
21 |
-
<frontend_type>text</frontend_type>
|
22 |
-
<sort_order>1</sort_order>
|
23 |
-
<show_in_default>1</show_in_default>
|
24 |
-
<show_in_website>1</show_in_website>
|
25 |
-
<show_in_store>1</show_in_store>
|
26 |
-
<fields>
|
27 |
-
<active translate="label">
|
28 |
-
<label>Enabled</label>
|
29 |
-
<frontend_type>select</frontend_type>
|
30 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
-
<sort_order>1</sort_order>
|
32 |
-
<show_in_default>1</show_in_default>
|
33 |
-
<show_in_website>1</show_in_website>
|
34 |
-
<show_in_store>1</show_in_store>
|
35 |
-
</active>
|
36 |
-
<merchantcode translate="label">
|
37 |
-
<label>Merchant Code</label>
|
38 |
-
<frontend_type>text</frontend_type>
|
39 |
-
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
40 |
-
<sort_order>10</sort_order>
|
41 |
-
<show_in_default>1</show_in_default>
|
42 |
-
<show_in_website>1</show_in_website>
|
43 |
-
<show_in_store>1</show_in_store>
|
44 |
-
</merchantcode>
|
45 |
-
<ftpuser translate="label">
|
46 |
-
<label>SFTP username</label>
|
47 |
-
<frontend_type>text</frontend_type>
|
48 |
-
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
49 |
-
<sort_order>40</sort_order>
|
50 |
-
<show_in_default>1</show_in_default>
|
51 |
-
<show_in_website>1</show_in_website>
|
52 |
-
<show_in_store>1</show_in_store>
|
53 |
-
</ftpuser>
|
54 |
-
<ftppass translate="label">
|
55 |
-
<label>SFTP password</label>
|
56 |
-
<frontend_type>password</frontend_type>
|
57 |
-
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
58 |
-
<sort_order>50</sort_order>
|
59 |
-
<show_in_default>1</show_in_default>
|
60 |
-
<show_in_website>1</show_in_website>
|
61 |
-
<show_in_store>1</show_in_store>
|
62 |
-
</ftppass>
|
63 |
-
<ftphost translate="label">
|
64 |
-
<label>SFTP hostname</label>
|
65 |
-
<frontend_type>text</frontend_type>
|
66 |
-
<sort_order>60</sort_order>
|
67 |
-
<show_in_default>1</show_in_default>
|
68 |
-
<show_in_website>1</show_in_website>
|
69 |
-
<show_in_store>1</show_in_store>
|
70 |
-
</ftphost>
|
71 |
-
<ftpport translate="label">
|
72 |
-
<label>SFTP port</label>
|
73 |
-
<frontend_type>text</frontend_type>
|
74 |
-
<sort_order>70</sort_order>
|
75 |
-
<show_in_default>1</show_in_default>
|
76 |
-
<show_in_website>1</show_in_website>
|
77 |
-
<show_in_store>1</show_in_store>
|
78 |
-
</ftpport>
|
79 |
-
<ftpdir translate="label">
|
80 |
-
<label>SFTP catalog directory</label>
|
81 |
-
<frontend_type>text</frontend_type>
|
82 |
-
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
83 |
-
<sort_order>80</sort_order>
|
84 |
-
<show_in_default>1</show_in_default>
|
85 |
-
<show_in_website>1</show_in_website>
|
86 |
-
<show_in_store>1</show_in_store>
|
87 |
-
</ftpdir>
|
88 |
-
<catalog_diff translate="label">
|
89 |
-
<label>Catalog update period (hours, min 1 hour)</label>
|
90 |
-
<frontend_type>text</frontend_type>
|
91 |
-
<sort_order>90</sort_order>
|
92 |
-
<show_in_default>1</show_in_default>
|
93 |
-
<show_in_website>1</show_in_website>
|
94 |
-
<show_in_store>1</show_in_store>
|
95 |
-
</catalog_diff>
|
96 |
-
<catalog_full translate="label">
|
97 |
-
<label>Full catalog upload period (days)</label>
|
98 |
-
<frontend_type>text</frontend_type>
|
99 |
-
<sort_order>100</sort_order>
|
100 |
-
<show_in_default>1</show_in_default>
|
101 |
-
<show_in_website>1</show_in_website>
|
102 |
-
<show_in_store>1</show_in_store>
|
103 |
-
</catalog_full>
|
104 |
-
<catalog_size translate="label">
|
105 |
-
<label>Maximum Records Per File</label>
|
106 |
-
<frontend_type>text</frontend_type>
|
107 |
-
<validate>validate-number</validate>
|
108 |
-
<sort_order>105</sort_order>
|
109 |
-
<show_in_default>1</show_in_default>
|
110 |
-
<show_in_website>1</show_in_website>
|
111 |
-
<show_in_store>1</show_in_store>
|
112 |
-
</catalog_size>
|
113 |
-
<catalog_sender_id translate="label">
|
114 |
-
<label>Catalog Sender ID</label>
|
115 |
-
<frontend_type>text</frontend_type>
|
116 |
-
<sort_order>106</sort_order>
|
117 |
-
<show_in_default>1</show_in_default>
|
118 |
-
<show_in_website>1</show_in_website>
|
119 |
-
<show_in_store>1</show_in_store>
|
120 |
-
</catalog_sender_id>
|
121 |
-
<admin_email translate="label">
|
122 |
-
<label>Admin Email</label>
|
123 |
-
<frontend_type>text</frontend_type>
|
124 |
-
<validate>validate-email</validate>
|
125 |
-
<sort_order>110</sort_order>
|
126 |
-
<show_in_default>1</show_in_default>
|
127 |
-
<show_in_website>1</show_in_website>
|
128 |
-
<show_in_store>1</show_in_store>
|
129 |
-
</admin_email>
|
130 |
-
<catalog_encryption_enabled translate="label">
|
131 |
-
<label>Catalog Encryption Enabled</label>
|
132 |
-
<frontend_type>select</frontend_type>
|
133 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
134 |
-
<sort_order>115</sort_order>
|
135 |
-
<show_in_default>1</show_in_default>
|
136 |
-
<show_in_website>1</show_in_website>
|
137 |
-
<show_in_store>1</show_in_store>
|
138 |
-
</catalog_encryption_enabled>
|
139 |
-
<encryption_public_key translate="label">
|
140 |
-
<label>Catalog Encryption Public Key</label>
|
141 |
-
<frontend_type>textarea</frontend_type>
|
142 |
-
<sort_order>120</sort_order>
|
143 |
-
<show_in_default>1</show_in_default>
|
144 |
-
<show_in_website>1</show_in_website>
|
145 |
-
<show_in_store>1</show_in_store>
|
146 |
-
</encryption_public_key>
|
147 |
-
<retrieve_credentials translate="label">
|
148 |
-
<label>Upload to Pitney Bowes</label>
|
149 |
-
<frontend_type>select</frontend_type>
|
150 |
-
<frontend_model>shipperhq_pbint/adminhtml_system_upload</frontend_model>
|
151 |
-
<button_label>Upload Catalog Now</button_label>
|
152 |
-
<sort_order>150</sort_order>
|
153 |
-
<show_in_default>1</show_in_default>
|
154 |
-
<show_in_website>0</show_in_website>
|
155 |
-
<show_in_store>0</show_in_store>
|
156 |
-
</retrieve_credentials>
|
157 |
-
</fields>
|
158 |
-
</shqpbint>
|
159 |
-
</groups>
|
160 |
-
</shipperhqpitney>
|
161 |
-
</sections>
|
162 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/sql/shqpbint_setup/mysql4-install-1.0.0.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$installer = $this;
|
4 |
-
|
5 |
-
$installer->startSetup();
|
6 |
-
|
7 |
-
$installer->run("
|
8 |
-
|
9 |
-
DROP TABLE IF EXISTS {$this->getTable('shipperhq_pbint/variable')};
|
10 |
-
CREATE TABLE {$this->getTable('shipperhq_pbint/variable')} (
|
11 |
-
`variable_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
-
`name` varchar(255) NOT NULL default '',
|
13 |
-
`value` varchar(255) NOT NULL default '',
|
14 |
-
PRIMARY KEY (`variable_id`)
|
15 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
16 |
-
|
17 |
-
DROP TABLE IF EXISTS {$this->getTable('shipperhq_pbint/ordernumber')};
|
18 |
-
CREATE TABLE {$this->getTable('shipperhq_pbint/ordernumber')} (
|
19 |
-
`ordernumber_id` int(11) unsigned NOT NULL auto_increment,
|
20 |
-
`cp_order_number` varchar(255) NOT NULL default '',
|
21 |
-
`mage_order_number` varchar(255) NOT NULL default '',
|
22 |
-
`confirmed` tinyint NOT NULL default 0,
|
23 |
-
`referenced` tinyint NOT NULL default 0,
|
24 |
-
`hub_id` varchar(50) null,
|
25 |
-
`hub_street1` varchar(50) null,
|
26 |
-
`hub_street2` varchar(50) null,
|
27 |
-
`hub_province_or_state` varchar(50) null,
|
28 |
-
`hub_postcode` varchar(50) null,
|
29 |
-
`hub_country` varchar(50) null,
|
30 |
-
PRIMARY KEY (`ordernumber_id`)
|
31 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
32 |
-
|
33 |
-
DROP TABLE IF EXISTS {$this->getTable('shipperhq_pbint/inboundparcel')};
|
34 |
-
CREATE TABLE {$this->getTable('shipperhq_pbint/inboundparcel')} (
|
35 |
-
`inbound_parcel_id` int(11) unsigned NOT NULL auto_increment,
|
36 |
-
`inbound_parcel` varchar(255) NOT NULL default '',
|
37 |
-
`mage_order_number` varchar(255) NOT NULL default '',
|
38 |
-
`pb_order_number` varchar(255) NOT NULL default '',
|
39 |
-
PRIMARY KEY (`inbound_parcel_id`)
|
40 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
41 |
-
|
42 |
-
");
|
43 |
-
|
44 |
-
$eav = Mage::getResourceModel('catalog/setup', 'catalog_setup');//new Mage_Eav_Model_Entity_Setup('catalog_setup');
|
45 |
-
//$eav->removeAttribute('catalog_product','shipperhq_pbint_upload');
|
46 |
-
$eav->addAttribute('catalog_product', 'shipperhq_pbint_upload', array(
|
47 |
-
'type' => 'int',
|
48 |
-
'input' => 'text',
|
49 |
-
'label' => 'Last PBGSP upload timestampt',
|
50 |
-
'global' => 2,
|
51 |
-
'user_defined' => 0,
|
52 |
-
'required' => 0,
|
53 |
-
'visible' => 1,
|
54 |
-
'default' => 0
|
55 |
-
|
56 |
-
));
|
57 |
-
|
58 |
-
|
59 |
-
$installer->addAttribute('quote_address', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
60 |
-
$installer->addAttribute('quote_address', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
61 |
-
|
62 |
-
$installer->addAttribute('order', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
63 |
-
$installer->addAttribute('order', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
64 |
-
|
65 |
-
$installer->addAttribute('invoice', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
66 |
-
$installer->addAttribute('invoice', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
67 |
-
|
68 |
-
$installer->addAttribute('creditmemo', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
69 |
-
$installer->addAttribute('creditmemo', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
70 |
-
|
71 |
-
$installer->endSetup();
|
72 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/sql/shqpbint_setup/mysql4-install-1.0.1.php
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$installer = $this;
|
4 |
-
|
5 |
-
$installer->startSetup();
|
6 |
-
|
7 |
-
$installer->run("
|
8 |
-
|
9 |
-
DROP TABLE IF EXISTS {$this->getTable('shipperhq_pbint/variable')};
|
10 |
-
CREATE TABLE {$this->getTable('shipperhq_pbint/variable')} (
|
11 |
-
`variable_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
-
`name` varchar(255) NOT NULL default '',
|
13 |
-
`value` varchar(255) NOT NULL default '',
|
14 |
-
PRIMARY KEY (`variable_id`)
|
15 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
16 |
-
|
17 |
-
DROP TABLE IF EXISTS {$this->getTable('shipperhq_pbint/ordernumber')};
|
18 |
-
CREATE TABLE {$this->getTable('shipperhq_pbint/ordernumber')} (
|
19 |
-
`ordernumber_id` int(11) unsigned NOT NULL auto_increment,
|
20 |
-
`cp_order_number` varchar(255) NOT NULL default '',
|
21 |
-
`mage_order_number` varchar(255) NOT NULL default '',
|
22 |
-
`confirmed` tinyint NOT NULL default 0,
|
23 |
-
`referenced` tinyint NOT NULL default 0,
|
24 |
-
`hub_id` varchar(50) null,
|
25 |
-
`hub_street1` varchar(50) null,
|
26 |
-
`hub_street2` varchar(50) null,
|
27 |
-
`hub_city` varchar(50) null,
|
28 |
-
`hub_province_or_state` varchar(50) null,
|
29 |
-
`hub_postcode` varchar(50) null,
|
30 |
-
`hub_country` varchar(50) null,
|
31 |
-
PRIMARY KEY (`ordernumber_id`)
|
32 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
33 |
-
|
34 |
-
DROP TABLE IF EXISTS {$this->getTable('shipperhq_pbint/inboundparcel')};
|
35 |
-
CREATE TABLE {$this->getTable('shipperhq_pbint/inboundparcel')} (
|
36 |
-
`inbound_parcel_id` int(11) unsigned NOT NULL auto_increment,
|
37 |
-
`inbound_parcel` varchar(255) NOT NULL default '',
|
38 |
-
`mage_order_number` varchar(255) NOT NULL default '',
|
39 |
-
`pb_order_number` varchar(255) NOT NULL default '',
|
40 |
-
PRIMARY KEY (`inbound_parcel_id`)
|
41 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
42 |
-
|
43 |
-
");
|
44 |
-
|
45 |
-
$eav = Mage::getResourceModel('catalog/setup', 'catalog_setup');//new Mage_Eav_Model_Entity_Setup('catalog_setup');
|
46 |
-
//$eav->removeAttribute('catalog_product','shipperhq_pbint_upload');
|
47 |
-
$eav->addAttribute('catalog_product', 'shipperhq_pbint_upload', array(
|
48 |
-
'type' => 'int',
|
49 |
-
'input' => 'text',
|
50 |
-
'label' => 'Last PBGSP upload timestampt',
|
51 |
-
'global' => 2,
|
52 |
-
'user_defined' => 0,
|
53 |
-
'required' => 0,
|
54 |
-
'visible' => 1,
|
55 |
-
'default' => 0
|
56 |
-
|
57 |
-
));
|
58 |
-
|
59 |
-
|
60 |
-
$installer->addAttribute('quote_address', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
61 |
-
$installer->addAttribute('quote_address', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
62 |
-
|
63 |
-
$installer->addAttribute('order', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
64 |
-
$installer->addAttribute('order', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
65 |
-
|
66 |
-
$installer->addAttribute('invoice', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
67 |
-
$installer->addAttribute('invoice', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
68 |
-
|
69 |
-
$installer->addAttribute('creditmemo', 'shq_pb_duty_amount', array('type'=>'decimal'));
|
70 |
-
$installer->addAttribute('creditmemo', 'base_shq_pb_duty_amount', array('type'=>'decimal'));
|
71 |
-
|
72 |
-
$installer->endSetup();
|
73 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/Pbint/sql/shqpbint_setup/mysql4-upgrade-1.0.0-1.0.1.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
-
$installer = $this;
|
4 |
-
$installer->startSetup();
|
5 |
-
|
6 |
-
|
7 |
-
$pbOrderTable = $installer->getTable('shipperhq_pbint/ordernumber');
|
8 |
-
|
9 |
-
if(!$installer->getConnection()->tableColumnExists($pbOrderTable, 'hub_city')){
|
10 |
-
$text = Mage::helper('wsalogger')->getNewVersion() > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text';
|
11 |
-
|
12 |
-
$hubCity = array(
|
13 |
-
'type' => $text,
|
14 |
-
'length' => 50,
|
15 |
-
'comment' => 'Hub city',
|
16 |
-
'nullable' => 'true',
|
17 |
-
);
|
18 |
-
$installer->getConnection()
|
19 |
-
->addColumn(
|
20 |
-
$pbOrderTable,
|
21 |
-
'hub_city',
|
22 |
-
$hubCity
|
23 |
-
);
|
24 |
-
}
|
25 |
-
|
26 |
-
$installer->endSetup();
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shipperhq/{Pbint/Block/Sales/Order/Duty.php → Shipper/Block/Adminhtml/Carrier/Aboutblank.php}
RENAMED
@@ -20,7 +20,7 @@
|
|
20 |
* versions in the future. If you wish to customize Magento for your
|
21 |
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
*
|
23 |
-
* Shipper HQ
|
24 |
*
|
25 |
* @category ShipperHQ
|
26 |
* @package ShipperHQ_Shipping_Carrier
|
@@ -28,28 +28,31 @@
|
|
28 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
*/
|
31 |
-
class
|
32 |
{
|
33 |
-
public function getSource()
|
34 |
-
{
|
35 |
-
return $this->getParentBlock()->getSource();
|
36 |
-
}
|
37 |
-
|
38 |
/**
|
39 |
-
*
|
|
|
|
|
|
|
40 |
*/
|
41 |
-
|
42 |
{
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
54 |
}
|
|
|
55 |
}
|
20 |
* versions in the future. If you wish to customize Magento for your
|
21 |
* needs please refer to http://www.magentocommerce.com for more information.
|
22 |
*
|
23 |
+
* Shipper HQ Shipping
|
24 |
*
|
25 |
* @category ShipperHQ
|
26 |
* @package ShipperHQ_Shipping_Carrier
|
28 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
29 |
* @author ShipperHQ Team sales@shipperhq.com
|
30 |
*/
|
31 |
+
class Shipperhq_Shipper_Block_Adminhtml_Carrier_Aboutblank extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
32 |
{
|
|
|
|
|
|
|
|
|
|
|
33 |
/**
|
34 |
+
* Return header comment part of html for fieldset
|
35 |
+
*
|
36 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
37 |
+
* @return string
|
38 |
*/
|
39 |
+
protected function _getHeaderCommentHtml($element)
|
40 |
{
|
41 |
+
$beforeDiv = '<div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">';
|
42 |
+
$afterDiv = '</div>';
|
43 |
+
$element->getComment()
|
44 |
+
? $comment = $element->getComment()
|
45 |
+
: $comment = '';
|
46 |
+
$html =$beforeDiv. '<table>
|
47 |
+
|
48 |
+
<tr>
|
49 |
+
<td colspan="3">
|
50 |
+
<p>'.$comment.'</p>
|
51 |
+
</td>
|
52 |
+
</tr>
|
53 |
+
|
54 |
+
</table>' .$afterDiv;
|
55 |
+
return $html;
|
56 |
}
|
57 |
+
|
58 |
}
|
app/code/community/Shipperhq/Shipper/Block/Adminhtml/Carrier/Notify.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Adminhtml
|
23 |
+
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
class Shipperhq_Shipper_Block_Adminhtml_Carrier_Notify extends Mage_Adminhtml_Block_Template
|
28 |
+
{
|
29 |
+
|
30 |
+
public function getConfigUrl()
|
31 |
+
{
|
32 |
+
$url = $this->getUrl('adminhtml/system_config/edit', array('section'=>'carriers'));
|
33 |
+
return $url;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Check verification result and return true if system must to show notification message
|
38 |
+
*
|
39 |
+
* @return bool
|
40 |
+
*/
|
41 |
+
protected function _canShowNotification()
|
42 |
+
{
|
43 |
+
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Shipper', 'carriers/shipper/active')) {
|
44 |
+
if(Mage::getStoreConfig(Shipperhq_Shipper_Helper_Data::SHIPPERHQ_INVALID_CREDENTIALS_SUPPLIED)) {
|
45 |
+
return true;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Prepare html output
|
54 |
+
*
|
55 |
+
* @return string
|
56 |
+
*/
|
57 |
+
protected function _toHtml()
|
58 |
+
{
|
59 |
+
if (!$this->_canShowNotification()) {
|
60 |
+
return '';
|
61 |
+
}
|
62 |
+
return parent::_toHtml();
|
63 |
+
}
|
64 |
+
|
65 |
+
}
|
app/code/community/Shipperhq/Shipper/Block/Adminhtml/Synchronize/Notify.php
CHANGED
@@ -53,15 +53,17 @@ class Shipperhq_Shipper_Block_Adminhtml_Synchronize_Notify extends Mage_Adminhtm
|
|
53 |
*/
|
54 |
protected function _canShowNotification()
|
55 |
{
|
|
|
56 |
if(Mage::getSingleton('adminhtml/session')->getAlreadySynched()) {
|
57 |
-
return false;
|
58 |
}
|
59 |
|
60 |
if ($this->_isSynchRequired()) {
|
|
|
61 |
return true;
|
62 |
}
|
63 |
|
64 |
-
Mage::getSingleton('adminhtml/session')->setAlreadySynched(
|
65 |
return false;
|
66 |
}
|
67 |
|
53 |
*/
|
54 |
protected function _canShowNotification()
|
55 |
{
|
56 |
+
$value = Mage::getSingleton('adminhtml/session')->getAlreadySynched();
|
57 |
if(Mage::getSingleton('adminhtml/session')->getAlreadySynched()) {
|
58 |
+
return $value == 'required' ? true : false;
|
59 |
}
|
60 |
|
61 |
if ($this->_isSynchRequired()) {
|
62 |
+
Mage::getSingleton('adminhtml/session')->setAlreadySynched('required');
|
63 |
return true;
|
64 |
}
|
65 |
|
66 |
+
Mage::getSingleton('adminhtml/session')->setAlreadySynched('not_required');
|
67 |
return false;
|
68 |
}
|
69 |
|
app/code/community/Shipperhq/Shipper/Helper/Data.php
CHANGED
@@ -65,6 +65,9 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
65 |
CONST DELIVERY_DATE_OPTION = 'delivery_date';
|
66 |
CONST TIME_IN_TRANSIT = 'time_in_transit';
|
67 |
CONST SHIPPERHQ_SHIPPER_CARRIERGROUP_DESC_PATH = 'carriers/shipper/carriergroup_describer';
|
|
|
|
|
|
|
68 |
|
69 |
/**
|
70 |
* Check is module exists and enabled in global config.
|
@@ -131,7 +134,7 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
131 |
|
132 |
/**
|
133 |
* Returns an instance of storage manager
|
134 |
-
*
|
135 |
* @return Shipperhq_Shipper_Model_Storage_Manager
|
136 |
*/
|
137 |
public function storageManager()
|
@@ -139,13 +142,13 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
139 |
if ($this->_storageManager === null) {
|
140 |
$this->_storageManager = Mage::getModel('shipperhq_shipper/storage_manager');
|
141 |
}
|
142 |
-
|
143 |
return $this->_storageManager;
|
144 |
}
|
145 |
|
146 |
/**
|
147 |
* Returns a storage for a quote
|
148 |
-
*
|
149 |
* @param Mage_Sales_Model_Quote|null $quote
|
150 |
* @return Shipperhq_Shipper_Model_Storage|bool
|
151 |
*/
|
@@ -154,7 +157,7 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
154 |
if ($quote === null) {
|
155 |
$quote = $this->getQuote();
|
156 |
}
|
157 |
-
|
158 |
return $this->storageManager()->findByQuote($quote);
|
159 |
}
|
160 |
|
@@ -206,29 +209,65 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
206 |
$carrierGroupDetail['carrierName'] = $carrierRate['carrierName'];
|
207 |
$shippingAddress = $this->getQuote()->getShippingAddress();
|
208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
//store packages
|
210 |
if(array_key_exists('shipments', $carrierRate) && $carrierRate['shipments'] != null) {
|
211 |
-
|
212 |
-
return;
|
213 |
-
}
|
214 |
-
$cgId = array_key_exists('carrierGroupId', $carrierGroupDetail) ? $carrierGroupDetail['carrierGroupId'] : null;
|
215 |
-
$this->cleanUpPackages($shippingAddress->getAddressId(),$cgId, $carrierRate['carrierCode']);
|
216 |
$mapping = $this->getPackagesMapping();
|
217 |
$standardData = array('address_id' => $shippingAddress->getAddressId(),
|
218 |
-
|
219 |
-
|
|
|
220 |
foreach($carrierRate['shipments'] as $shipment) {
|
221 |
$data = array_merge($standardData, Mage::helper('shipperhq_shipper/mapper')->map($mapping,(array)$shipment));
|
222 |
-
$
|
223 |
-
|
224 |
-
|
|
|
225 |
}
|
226 |
}
|
227 |
|
228 |
if(array_key_exists('rates', $carrierRate) && $carrierRate['rates'] != null) {
|
229 |
foreach($carrierRate['rates'] as $rate) {
|
230 |
$cgId = array_key_exists('carrierGroupId', $carrierGroupDetail) ? $carrierGroupDetail['carrierGroupId'] : null;
|
231 |
-
$this->cleanUpPackages($shippingAddress->getAddressId(),$cgId, $carrierRate['carrierCode'].'_'.$rate->code);
|
232 |
$mapping = $this->getPackagesMapping();
|
233 |
$standardData = array('address_id' => $shippingAddress->getAddressId(),
|
234 |
'carrier_group_id' => $cgId,
|
@@ -236,19 +275,20 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
236 |
if(!isset($rate->shipments)) {
|
237 |
continue;
|
238 |
}
|
239 |
-
|
240 |
-
$
|
241 |
-
$
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
244 |
}
|
245 |
}
|
246 |
}
|
247 |
-
|
248 |
-
|
249 |
-
public function isPackageBreakdownDisplayEnabled()
|
250 |
-
{
|
251 |
-
return Mage::helper('wsalogger')->isDebugError();
|
252 |
}
|
253 |
|
254 |
protected function cleanUpPackages($addressId, $carrierGroupId, $carrier_code)
|
@@ -269,6 +309,7 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
269 |
}
|
270 |
|
271 |
}
|
|
|
272 |
protected function getPackagesMapping()
|
273 |
{
|
274 |
return array(
|
@@ -279,6 +320,7 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
279 |
'weight' => 'weight',
|
280 |
'surcharge_price' => 'surchargePrice',
|
281 |
'declared_value' => 'declaredValue',
|
|
|
282 |
'items' => 'boxedItems'
|
283 |
);
|
284 |
}
|
@@ -286,16 +328,19 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
286 |
public function getPackageBreakdown($carrierGroupId, $carrier_code)
|
287 |
{
|
288 |
if($this->isPackageBreakdownDisplayEnabled()) {
|
289 |
-
$packages =
|
290 |
-
$this->getQuote()->getShippingAddress()->getAddressId(),$carrierGroupId, $carrier_code);
|
291 |
return $this->getPackageBreakdownText($packages);
|
292 |
}
|
293 |
|
294 |
}
|
295 |
|
296 |
-
public function getPackageBreakdownText($packages) {
|
297 |
$boxText = '';
|
298 |
$count = 1;
|
|
|
|
|
|
|
299 |
foreach ($packages as $key=>$box)
|
300 |
{
|
301 |
$boxText .= Mage::helper('shipperhq_shipper')->__('Package').' #'.($count++);
|
@@ -306,7 +351,10 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
306 |
$boxText .= 'x' . $box['width'] ;
|
307 |
$boxText .= 'x'. $box['height'] ;
|
308 |
$boxText .= ': W='.$box['weight'] . ':' ;
|
309 |
-
$boxText .= ' Value='.$box['
|
|
|
|
|
|
|
310 |
$boxText .= $this->getProductBreakdownText($box);
|
311 |
}
|
312 |
$boxText .= '</br>';
|
@@ -324,7 +372,14 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
324 |
if (array_key_exists('items',$box) || (is_object($box) && !is_null($box->getItems()))) {
|
325 |
if (is_array($box['items'])) {
|
326 |
foreach ($box['items'] as $item) {
|
327 |
-
$productText .= ' SKU=' .$item['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
}
|
329 |
} else {
|
330 |
$productText = $box['items'];
|
@@ -340,8 +395,17 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
340 |
$carrierGroupDetail['price'] = (float)$rate['totalCharges']*$currencyConversionRate;
|
341 |
$carrierGroupDetail['cost'] = (float)$rate['shippingPrice']*$currencyConversionRate;
|
342 |
$carrierGroupDetail['code'] = $rate['code'];
|
343 |
-
|
344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
}
|
346 |
|
347 |
public function getBaseCurrencyRate($code)
|
@@ -531,11 +595,10 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
531 |
*/
|
532 |
public function getWebserviceTimeout()
|
533 |
{
|
534 |
-
|
535 |
if (self::$_wsTimeout==NULL) {
|
536 |
$timeout = Mage::getStoreConfig('carriers/shipper/ws_timeout');
|
537 |
-
if(!is_numeric($timeout) || $timeout <
|
538 |
-
$timeout =
|
539 |
}
|
540 |
self::$_wsTimeout = $timeout;
|
541 |
}
|
@@ -561,11 +624,13 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
561 |
* @param int $scopeId
|
562 |
* @return $this
|
563 |
*/
|
564 |
-
public function saveConfig($path, $value, $scope = 'default', $scopeId = 0)
|
565 |
{
|
566 |
if (Mage::getStoreConfig($path) != $value) {
|
567 |
Mage::getConfig()->saveConfig(rtrim($path, '/'), $value, $scope, $scopeId);
|
568 |
-
|
|
|
|
|
569 |
}
|
570 |
}
|
571 |
|
@@ -576,7 +641,11 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
576 |
|
577 |
public function decodeShippingDetails($shippingDetailsEnc)
|
578 |
{
|
579 |
-
|
|
|
|
|
|
|
|
|
580 |
}
|
581 |
|
582 |
/**
|
@@ -599,7 +668,7 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
599 |
|
600 |
/**
|
601 |
* Overrides quote model
|
602 |
-
*
|
603 |
* @param Mage_Sales_Model_Quote|null $quote
|
604 |
* @return $this
|
605 |
*/
|
@@ -609,11 +678,6 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
609 |
return $this;
|
610 |
}
|
611 |
|
612 |
-
public function isSortOnPrice()
|
613 |
-
{
|
614 |
-
return $this->getGlobalSetting('sortBasedPrice');
|
615 |
-
}
|
616 |
-
|
617 |
public function getGlobalSetting($code)
|
618 |
{
|
619 |
$globals = Mage::helper('shipperhq_shipper')->getGlobalSettings();
|
@@ -764,6 +828,7 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
764 |
|
765 |
public function mapToMagentoCarrierCode($carrierType, $carrierCode)
|
766 |
{
|
|
|
767 |
if(array_key_exists($carrierType, $this->magentoCarrierCodes)) {
|
768 |
return $this->magentoCarrierCodes[$carrierType];
|
769 |
}
|
@@ -790,6 +855,14 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
790 |
return $cityRequired;
|
791 |
}
|
792 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
793 |
public function isCityRequired()
|
794 |
{
|
795 |
return $this->isCityEnabled();
|
@@ -799,6 +872,38 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
799 |
{
|
800 |
return Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Freight');
|
801 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
/**
|
803 |
*
|
804 |
* @return array
|
@@ -829,13 +934,44 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
829 |
$collection->addFieldToFilter(array(
|
830 |
array('attribute'=>$attribute_code,'finset'=>$value),
|
831 |
));
|
|
|
832 |
if($returnCount) {
|
833 |
return count($collection);
|
834 |
}
|
835 |
-
|
836 |
return $collection;
|
837 |
}
|
838 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
public function extractAddressIdAndCarriergroupId(&$addressId, &$carrierGroupId)
|
840 |
{
|
841 |
if(strstr($carrierGroupId, 'ma')) {
|
@@ -858,55 +994,146 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
858 |
return false;
|
859 |
}
|
860 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
861 |
public function isConfirmOrderRequired($carrierType)
|
862 |
{
|
863 |
return $carrierType == 'gso';
|
864 |
}
|
865 |
|
866 |
-
public function getCarriergroupShippingHtml($encodedDetails)
|
867 |
{
|
868 |
-
$
|
869 |
-
$htmlText='<br/>';
|
870 |
-
foreach ($decodedDetails as $shipLine) {
|
871 |
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
883 |
}
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
if(
|
889 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
890 |
}
|
891 |
-
$htmlText.= '<br/>';
|
892 |
-
}
|
893 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
894 |
}
|
895 |
-
return $
|
896 |
}
|
897 |
|
898 |
public function setShippingOnItems($shippingDetails, $shippingAddress)
|
899 |
{
|
900 |
$itemsGrouped = $this->getItemsGroupedByCarrierGroup($shippingAddress->getAllItems());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
901 |
foreach($shippingDetails as $carrierGroupDetail)
|
902 |
{
|
903 |
if(is_array($carrierGroupDetail) && array_key_exists('carrierTitle', $carrierGroupDetail)) {
|
904 |
$carrierGroupId = $carrierGroupDetail['carrierGroupId'];
|
905 |
$shippingText = $carrierGroupDetail['carrierTitle'] .' - ' .$carrierGroupDetail['methodTitle'];
|
906 |
-
if(array_key_exists('delivery_date', $carrierGroupDetail)) {
|
907 |
$shippingText .= ' Delivery: ' .$carrierGroupDetail['delivery_date'];
|
908 |
}
|
909 |
-
if(array_key_exists('dispatch_date', $carrierGroupDetail)) {
|
910 |
$shippingText .= ' Dispatch: ' .$carrierGroupDetail['dispatch_date'];
|
911 |
}
|
912 |
// if(array_key_exists('time_slot'))
|
@@ -994,8 +1221,7 @@ class Shipperhq_Shipper_Helper_Data extends Mage_Core_Helper_Abstract
|
|
994 |
$this->saveConfig('carriers/'.$carrierCode.'/active', 0);
|
995 |
}
|
996 |
$this->saveCarrierTitle($carrierCode, $carrierTitle);
|
997 |
-
|
998 |
-
if($sortOrder) {
|
999 |
$this->saveConfig('carriers/'.$carrierCode.'/sort_order', $sortOrder);
|
1000 |
}
|
1001 |
|
65 |
CONST DELIVERY_DATE_OPTION = 'delivery_date';
|
66 |
CONST TIME_IN_TRANSIT = 'time_in_transit';
|
67 |
CONST SHIPPERHQ_SHIPPER_CARRIERGROUP_DESC_PATH = 'carriers/shipper/carriergroup_describer';
|
68 |
+
CONST SHIPPERHQ_SHIPPER_ALLOWED_METHODS_PATH = 'carriers/shipper/allowed_methods';
|
69 |
+
CONST SHIPPERHQ_LAST_SYNC = 'carriers/shipper/last_sync';
|
70 |
+
CONST SHIPPERHQ_INVALID_CREDENTIALS_SUPPLIED = 'carriers/shipper/invalid_credentials_supplied';
|
71 |
|
72 |
/**
|
73 |
* Check is module exists and enabled in global config.
|
134 |
|
135 |
/**
|
136 |
* Returns an instance of storage manager
|
137 |
+
*
|
138 |
* @return Shipperhq_Shipper_Model_Storage_Manager
|
139 |
*/
|
140 |
public function storageManager()
|
142 |
if ($this->_storageManager === null) {
|
143 |
$this->_storageManager = Mage::getModel('shipperhq_shipper/storage_manager');
|
144 |
}
|
145 |
+
|
146 |
return $this->_storageManager;
|
147 |
}
|
148 |
|
149 |
/**
|
150 |
* Returns a storage for a quote
|
151 |
+
*
|
152 |
* @param Mage_Sales_Model_Quote|null $quote
|
153 |
* @return Shipperhq_Shipper_Model_Storage|bool
|
154 |
*/
|
157 |
if ($quote === null) {
|
158 |
$quote = $this->getQuote();
|
159 |
}
|
160 |
+
|
161 |
return $this->storageManager()->findByQuote($quote);
|
162 |
}
|
163 |
|
209 |
$carrierGroupDetail['carrierName'] = $carrierRate['carrierName'];
|
210 |
$shippingAddress = $this->getQuote()->getShippingAddress();
|
211 |
|
212 |
+
$cgId = array_key_exists('carrierGroupId', $carrierGroupDetail) ? $carrierGroupDetail['carrierGroupId'] : null;
|
213 |
+
|
214 |
+
$this->extractPackages($carrierRate, $carrierGroupDetail);
|
215 |
+
}
|
216 |
+
|
217 |
+
public function isPackageBreakdownDisplayEnabled()
|
218 |
+
{
|
219 |
+
return Mage::helper('wsalogger')->isDebugError();
|
220 |
+
}
|
221 |
+
|
222 |
+
public function loadSessionPackagesByCarrier($addressId, $carrierGroupId, $carrierCode, $methodCode)
|
223 |
+
{
|
224 |
+
$sessionPackages = $this->getQuoteStorage()->getShipperhqPackages();
|
225 |
+
$shippingMethod = $carrierCode .'_' .$methodCode;
|
226 |
+
$carrierPackages = isset($sessionPackages[$addressId]) && isset($sessionPackages[$addressId][$carrierGroupId]) ?
|
227 |
+
$sessionPackages[$addressId][$carrierGroupId] : array();
|
228 |
+
if(isset($carrierPackages[$shippingMethod])) {
|
229 |
+
return $carrierPackages[$shippingMethod];
|
230 |
+
}
|
231 |
+
elseif (isset($carrierPackages[$carrierCode])) {
|
232 |
+
return $carrierPackages[$carrierCode];
|
233 |
+
}
|
234 |
+
|
235 |
+
return array();
|
236 |
+
|
237 |
+
}
|
238 |
+
|
239 |
+
protected function extractPackages($carrierRate, &$carrierGroupDetail)
|
240 |
+
{
|
241 |
+
if(!$this->getQuote()->getShippingAddress()->getAddressId()) {
|
242 |
+
return;
|
243 |
+
}
|
244 |
+
$shippingAddress = $this->getQuote()->getShippingAddress();
|
245 |
+
$cgId = array_key_exists('carrierGroupId', $carrierGroupDetail) ? $carrierGroupDetail['carrierGroupId'] : null;
|
246 |
+
|
247 |
+
$sessionPackages = $this->getQuoteStorage()->getShipperhqPackages();
|
248 |
+
$carrierPackages = isset($sessionPackages[$shippingAddress->getAddressId()]) && isset($sessionPackages[$shippingAddress->getAddressId()][$cgId]) ?
|
249 |
+
$sessionPackages[$shippingAddress->getAddressId()][$cgId] : array();
|
250 |
+
|
251 |
//store packages
|
252 |
if(array_key_exists('shipments', $carrierRate) && $carrierRate['shipments'] != null) {
|
253 |
+
|
|
|
|
|
|
|
|
|
254 |
$mapping = $this->getPackagesMapping();
|
255 |
$standardData = array('address_id' => $shippingAddress->getAddressId(),
|
256 |
+
'carrier_group_id' => $cgId,
|
257 |
+
'carrier_code' => $carrierRate['carrierCode']);
|
258 |
+
$saveThese = array();
|
259 |
foreach($carrierRate['shipments'] as $shipment) {
|
260 |
$data = array_merge($standardData, Mage::helper('shipperhq_shipper/mapper')->map($mapping,(array)$shipment));
|
261 |
+
$saveThese[] = $data;
|
262 |
+
}
|
263 |
+
if(count($saveThese) > 0) {
|
264 |
+
$carrierPackages[$standardData['carrier_code']] = $saveThese;
|
265 |
}
|
266 |
}
|
267 |
|
268 |
if(array_key_exists('rates', $carrierRate) && $carrierRate['rates'] != null) {
|
269 |
foreach($carrierRate['rates'] as $rate) {
|
270 |
$cgId = array_key_exists('carrierGroupId', $carrierGroupDetail) ? $carrierGroupDetail['carrierGroupId'] : null;
|
|
|
271 |
$mapping = $this->getPackagesMapping();
|
272 |
$standardData = array('address_id' => $shippingAddress->getAddressId(),
|
273 |
'carrier_group_id' => $cgId,
|
275 |
if(!isset($rate->shipments)) {
|
276 |
continue;
|
277 |
}
|
278 |
+
if(!is_null($standardData['address_id'])) {
|
279 |
+
$saveThese = array();
|
280 |
+
foreach($rate->shipments as $shipment) {
|
281 |
+
$data = array_merge($standardData, Mage::helper('shipperhq_shipper/mapper')->map($mapping, (array)$shipment));
|
282 |
+
$saveThese[] = $data;
|
283 |
+
}
|
284 |
+
if(count($saveThese) > 0) {
|
285 |
+
$carrierPackages[$standardData['carrier_code']] = $saveThese;
|
286 |
+
}
|
287 |
}
|
288 |
}
|
289 |
}
|
290 |
+
$sessionPackages[$shippingAddress->getAddressId()][$cgId] = $carrierPackages;
|
291 |
+
$this->getQuoteStorage()->setShipperhqPackages($sessionPackages);
|
|
|
|
|
|
|
292 |
}
|
293 |
|
294 |
protected function cleanUpPackages($addressId, $carrierGroupId, $carrier_code)
|
309 |
}
|
310 |
|
311 |
}
|
312 |
+
|
313 |
protected function getPackagesMapping()
|
314 |
{
|
315 |
return array(
|
320 |
'weight' => 'weight',
|
321 |
'surcharge_price' => 'surchargePrice',
|
322 |
'declared_value' => 'declaredValue',
|
323 |
+
'volume' => 'volume',
|
324 |
'items' => 'boxedItems'
|
325 |
);
|
326 |
}
|
328 |
public function getPackageBreakdown($carrierGroupId, $carrier_code)
|
329 |
{
|
330 |
if($this->isPackageBreakdownDisplayEnabled()) {
|
331 |
+
$packages = $this->loadSessionPackagesByCarrier(
|
332 |
+
$this->getQuote()->getShippingAddress()->getAddressId(),$carrierGroupId, $carrier_code, '');
|
333 |
return $this->getPackageBreakdownText($packages);
|
334 |
}
|
335 |
|
336 |
}
|
337 |
|
338 |
+
public function getPackageBreakdownText($packages, $carrierGroupName = false) {
|
339 |
$boxText = '';
|
340 |
$count = 1;
|
341 |
+
if($carrierGroupName) {
|
342 |
+
$boxText .= $carrierGroupName .': ';
|
343 |
+
}
|
344 |
foreach ($packages as $key=>$box)
|
345 |
{
|
346 |
$boxText .= Mage::helper('shipperhq_shipper')->__('Package').' #'.($count++);
|
351 |
$boxText .= 'x' . $box['width'] ;
|
352 |
$boxText .= 'x'. $box['height'] ;
|
353 |
$boxText .= ': W='.$box['weight'] . ':' ;
|
354 |
+
$boxText .= ' Value='.$box['declared_value']. ':';
|
355 |
+
if(isset($box['volume'])) {
|
356 |
+
$boxText .= ' Volume=' .$box['volume'].':';
|
357 |
+
}
|
358 |
$boxText .= $this->getProductBreakdownText($box);
|
359 |
}
|
360 |
$boxText .= '</br>';
|
372 |
if (array_key_exists('items',$box) || (is_object($box) && !is_null($box->getItems()))) {
|
373 |
if (is_array($box['items'])) {
|
374 |
foreach ($box['items'] as $item) {
|
375 |
+
$productText .= ' SKU=' .$item['qtyPacked'] .' * '.$item['sku'] .' ' .$item['weightPacked'] .$weightUnit;
|
376 |
+
if(isset($item['indVolume'])) {
|
377 |
+
$productText .= ': Individual Volume =' .$item['indVolume'].':';
|
378 |
+
}
|
379 |
+
if(isset($item['volumePacked'])) {
|
380 |
+
$productText .= ': Volume Packed =' .$item['volumePacked'].':';
|
381 |
+
}
|
382 |
+
$productText .='; ';
|
383 |
}
|
384 |
} else {
|
385 |
$productText = $box['items'];
|
395 |
$carrierGroupDetail['price'] = (float)$rate['totalCharges']*$currencyConversionRate;
|
396 |
$carrierGroupDetail['cost'] = (float)$rate['shippingPrice']*$currencyConversionRate;
|
397 |
$carrierGroupDetail['code'] = $rate['code'];
|
398 |
+
if(isset($rate['selectedOptions'])) {
|
399 |
+
$selectedOptions = (array)$rate['selectedOptions'];
|
400 |
+
if(isset($selectedOptions['options'])) {
|
401 |
+
foreach($selectedOptions['options'] as $option) {
|
402 |
+
$thisOption =(array)$option;
|
403 |
+
if(isset($thisOption['name'])) {
|
404 |
+
$carrierGroupDetail[$thisOption['name']] = $thisOption['value'];
|
405 |
+
}
|
406 |
+
}
|
407 |
+
}
|
408 |
+
}
|
409 |
}
|
410 |
|
411 |
public function getBaseCurrencyRate($code)
|
595 |
*/
|
596 |
public function getWebserviceTimeout()
|
597 |
{
|
|
|
598 |
if (self::$_wsTimeout==NULL) {
|
599 |
$timeout = Mage::getStoreConfig('carriers/shipper/ws_timeout');
|
600 |
+
if(!is_numeric($timeout) || $timeout < 30) {
|
601 |
+
$timeout = 30;
|
602 |
}
|
603 |
self::$_wsTimeout = $timeout;
|
604 |
}
|
624 |
* @param int $scopeId
|
625 |
* @return $this
|
626 |
*/
|
627 |
+
public function saveConfig($path, $value, $scope = 'default', $scopeId = 0, $refreshRequired = true)
|
628 |
{
|
629 |
if (Mage::getStoreConfig($path) != $value) {
|
630 |
Mage::getConfig()->saveConfig(rtrim($path, '/'), $value, $scope, $scopeId);
|
631 |
+
if($refreshRequired) {
|
632 |
+
Mage::helper('shipperhq_shipper')->getQuoteStorage()->setConfigUpdated(true);
|
633 |
+
}
|
634 |
}
|
635 |
}
|
636 |
|
641 |
|
642 |
public function decodeShippingDetails($shippingDetailsEnc)
|
643 |
{
|
644 |
+
$decoded = array();
|
645 |
+
if(!is_null($shippingDetailsEnc) && $shippingDetailsEnc != '') {
|
646 |
+
$decoded = Zend_Json::decode($shippingDetailsEnc);
|
647 |
+
}
|
648 |
+
return $decoded;
|
649 |
}
|
650 |
|
651 |
/**
|
668 |
|
669 |
/**
|
670 |
* Overrides quote model
|
671 |
+
*
|
672 |
* @param Mage_Sales_Model_Quote|null $quote
|
673 |
* @return $this
|
674 |
*/
|
678 |
return $this;
|
679 |
}
|
680 |
|
|
|
|
|
|
|
|
|
|
|
681 |
public function getGlobalSetting($code)
|
682 |
{
|
683 |
$globals = Mage::helper('shipperhq_shipper')->getGlobalSettings();
|
828 |
|
829 |
public function mapToMagentoCarrierCode($carrierType, $carrierCode)
|
830 |
{
|
831 |
+
$carrierType = strstr($carrierType, "shqshared_") ? str_replace('shqshared_', '', $carrierType) : $carrierType;
|
832 |
if(array_key_exists($carrierType, $this->magentoCarrierCodes)) {
|
833 |
return $this->magentoCarrierCodes[$carrierType];
|
834 |
}
|
855 |
return $cityRequired;
|
856 |
}
|
857 |
|
858 |
+
public function storeDimComments() {
|
859 |
+
$storeDimComments = $this->getGlobalSetting('storeDimComments');
|
860 |
+
if(!$storeDimComments) {
|
861 |
+
$storeDimComments = Mage::getStoreConfig('carriers/shipper/STORE_DIM_COMMENTS');
|
862 |
+
}
|
863 |
+
return $storeDimComments;
|
864 |
+
}
|
865 |
+
|
866 |
public function isCityRequired()
|
867 |
{
|
868 |
return $this->isCityEnabled();
|
872 |
{
|
873 |
return Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Freight');
|
874 |
}
|
875 |
+
|
876 |
+
public function getMethodTitle($methodTitle, $methodDescription, $includeContainer)
|
877 |
+
{
|
878 |
+
$title = $methodTitle;
|
879 |
+
if($includeContainer) {
|
880 |
+
$truncatedTitle = str_replace($methodDescription, '', $methodTitle);
|
881 |
+
$title = '<span class="method-title">'.$truncatedTitle.'</span> <span class="method-extra">'.$methodDescription.'</span>';
|
882 |
+
}
|
883 |
+
return $title;
|
884 |
+
}
|
885 |
+
|
886 |
+
/**
|
887 |
+
* Returns price formatted with OSC design elements
|
888 |
+
*
|
889 |
+
* @param $price
|
890 |
+
*/
|
891 |
+
public function getOscFormattedPrice($price)
|
892 |
+
{
|
893 |
+
$title = '<strong><span class="price">'.$price.'</span></strong>';
|
894 |
+
|
895 |
+
return $title;
|
896 |
+
}
|
897 |
+
|
898 |
+
public function getOscFormattedTooltip($tooltip)
|
899 |
+
{
|
900 |
+
$formattedTooltip = '<span style="float:right;" class="helpcursor" title="'.$tooltip.'">
|
901 |
+
<img src="'.Mage::getDesign()->getSkinUrl("images/shipperhq/tooltip.jpg").'">
|
902 |
+
</span>';
|
903 |
+
|
904 |
+
return $formattedTooltip;
|
905 |
+
}
|
906 |
+
|
907 |
/**
|
908 |
*
|
909 |
* @return array
|
934 |
$collection->addFieldToFilter(array(
|
935 |
array('attribute'=>$attribute_code,'finset'=>$value),
|
936 |
));
|
937 |
+
|
938 |
if($returnCount) {
|
939 |
return count($collection);
|
940 |
}
|
|
|
941 |
return $collection;
|
942 |
}
|
943 |
|
944 |
+
public function getIsAttributeValueUsed($attribute_code, $value, $isSelect = false)
|
945 |
+
{
|
946 |
+
$attributeModel = Mage::getSingleton('eav/config')
|
947 |
+
->getAttribute('catalog_product', $attribute_code);
|
948 |
+
|
949 |
+
$select = Mage::getSingleton('core/resource')
|
950 |
+
->getConnection('default_read')->select()
|
951 |
+
->from($attributeModel->getBackend()->getTable(), 'value')
|
952 |
+
->where('attribute_id=?', $attributeModel->getId())
|
953 |
+
->where('value!=?','')
|
954 |
+
->distinct();
|
955 |
+
|
956 |
+
$usedAttributeValues = Mage::getSingleton('core/resource')
|
957 |
+
->getConnection('default_read')
|
958 |
+
->fetchCol($select);
|
959 |
+
if($isSelect) {
|
960 |
+
//account for multiselect values
|
961 |
+
$separated = array();
|
962 |
+
foreach($usedAttributeValues as $key => $aValue) {
|
963 |
+
if(strstr($aValue, ',')) {
|
964 |
+
$values = explode(',', $aValue);
|
965 |
+
$separated = array_merge($separated,$values);
|
966 |
+
unset($usedAttributeValues[$key]);
|
967 |
+
}
|
968 |
+
}
|
969 |
+
$usedAttributeValues = array_merge($usedAttributeValues, $separated);
|
970 |
+
|
971 |
+
}
|
972 |
+
return in_array($value, $usedAttributeValues);
|
973 |
+
}
|
974 |
+
|
975 |
public function extractAddressIdAndCarriergroupId(&$addressId, &$carrierGroupId)
|
976 |
{
|
977 |
if(strstr($carrierGroupId, 'ma')) {
|
994 |
return false;
|
995 |
}
|
996 |
|
997 |
+
public function useDefaultCarrierCodes()
|
998 |
+
{
|
999 |
+
$result = false;
|
1000 |
+
if(Mage::getStoreConfig('carriers/shipper/CARRIER_STRIP_CODE')) {
|
1001 |
+
$result = true;
|
1002 |
+
}
|
1003 |
+
return $result;
|
1004 |
+
}
|
1005 |
+
|
1006 |
public function isConfirmOrderRequired($carrierType)
|
1007 |
{
|
1008 |
return $carrierType == 'gso';
|
1009 |
}
|
1010 |
|
1011 |
+
public function getCarriergroupShippingHtml($encodedDetails, $order = null)
|
1012 |
{
|
1013 |
+
$displayValues = array('destination_type', 'customer_carrier', 'customer_carrier_ph', 'customer_carrier_account');
|
|
|
|
|
1014 |
|
1015 |
+
if($this->isModuleEnabled('Shipperhq_Freight')) {
|
1016 |
+
$options = Mage::helper('shipperhq_freight')->getAllNamedOptions();
|
1017 |
+
}
|
1018 |
+
else {
|
1019 |
+
$options = array();
|
1020 |
+
}
|
1021 |
+
//defaults
|
1022 |
+
$pickupDate = !is_null($order) ? $order->getPickupDate() : false;
|
1023 |
+
$timeSlot = !is_null($order) ? $order->getTimeslot() : false;
|
1024 |
+
$pickupLocation = !is_null($order) ? $order->getPickupLocation() : false;
|
1025 |
+
$dispatchDate = !is_null($order) ? $order->getDispatchDate() : false;
|
1026 |
+
$deliveryDate = !is_null($order) ? $order->getDeliveryDate() : false;
|
1027 |
+
|
1028 |
+
$cginfo = $this->decodeShippingDetails($encodedDetails);
|
1029 |
+
$carriergroupText = '';
|
1030 |
+
foreach ($cginfo as $cgrp) {
|
1031 |
+
if (is_array($cgrp)) {
|
1032 |
+
//SHQ16-2023 reset to be values set on order
|
1033 |
+
$displayPickupDate = $pickupDate;
|
1034 |
+
$displayTimeSlot = $timeSlot;
|
1035 |
+
$displayPickupLocation = $pickupLocation;
|
1036 |
+
$displayDispatchDate = $dispatchDate;
|
1037 |
+
$displayDeliveryDate = $deliveryDate;
|
1038 |
+
|
1039 |
+
$carriergroupText .= $cgrp['name'];
|
1040 |
+
$carriergroupText .= '<strong>: ' . $cgrp['carrierTitle'];
|
1041 |
+
$carriergroupText .= ' - ' . $cgrp['methodTitle'];
|
1042 |
+
$price = !is_null($order) ? $order->formatPrice($cgrp['price']) : $this->getQuote()->getStore()->formatPrice($cgrp['price']);
|
1043 |
+
$carriergroupText .= ' ' . $price . ' </strong>';
|
1044 |
+
if ((array_key_exists('carrierName', $cgrp) && $cgrp['carrierName'] != '')) {
|
1045 |
+
$carriergroupText .= '</br> Carrier: ';
|
1046 |
+
$carriergroupText .= '' . strtoupper($cgrp['carrierName']);
|
1047 |
}
|
1048 |
+
|
1049 |
+
if ((array_key_exists('pickup_date', $cgrp) && $cgrp['pickup_date'] != '')) {
|
1050 |
+
$displayPickupDate = $cgrp['pickup_date'];
|
1051 |
+
}
|
1052 |
+
if ($displayPickupDate) {
|
1053 |
+
$carriergroupText .= '</br> Pickup : ';
|
1054 |
+
if (array_key_exists('location_name', $cgrp)) {
|
1055 |
+
$displayPickupLocation = $cgrp['location_name'];
|
1056 |
+
}
|
1057 |
+
if ($displayPickupLocation) {
|
1058 |
+
$carriergroupText .= '' . $displayPickupLocation;
|
1059 |
+
}
|
1060 |
+
$carriergroupText .= ' ' . $displayPickupDate;
|
1061 |
+
if (array_key_exists('pickup_slot', $cgrp)) {
|
1062 |
+
$displayTimeSlot = $cgrp['pickup_slot'];
|
1063 |
+
$displayTimeSlot = str_replace('_', ' - ', $cgrp['pickup_slot']);
|
1064 |
+
}
|
1065 |
+
if ($displayTimeSlot) {
|
1066 |
+
$carriergroupText .= ' ' . $displayTimeSlot . ' ';
|
1067 |
+
}
|
1068 |
+
}
|
1069 |
+
if (array_key_exists('dispatch_date', $cgrp)) {
|
1070 |
+
$displayDispatchDate = $cgrp['dispatch_date'];
|
1071 |
+
}
|
1072 |
+
if ($displayDispatchDate) {
|
1073 |
+
$carriergroupText .= '</br>' . Mage::helper('shipperhq_shipper')->__('Dispatch Date') . ' : ' . $displayDispatchDate;
|
1074 |
}
|
|
|
|
|
1075 |
|
1076 |
+
if (array_key_exists('delivery_date', $cgrp)) {
|
1077 |
+
$displayDeliveryDate = $cgrp['delivery_date'];
|
1078 |
+
}
|
1079 |
+
if ($displayDeliveryDate) {
|
1080 |
+
$carriergroupText .= '</br>' . Mage::helper('shipperhq_shipper')->__('Delivery Date') . ' : ' . $displayDeliveryDate;
|
1081 |
+
if (array_key_exists('del_slot', $cgrp)) {
|
1082 |
+
$displayTimeSlot = $cgrp['del_slot'];
|
1083 |
+
$displayTimeSlot = str_replace('_', ' - ', $cgrp['del_slot']);
|
1084 |
+
}
|
1085 |
+
if ($displayTimeSlot) {
|
1086 |
+
$carriergroupText .= ' ' . $displayTimeSlot . ' ';
|
1087 |
+
}
|
1088 |
+
}
|
1089 |
+
foreach ($options as $code => $name) {
|
1090 |
+
$value = false;
|
1091 |
+
if (array_key_exists($code, $cgrp) && $cgrp[$code] != '') {
|
1092 |
+
$value = $cgrp[$code];
|
1093 |
+
}
|
1094 |
+
//SHQ16-1605 limit to display to selected carrier group only
|
1095 |
+
// elseif($order->getData($code)) {
|
1096 |
+
// $value = $order->getData($code);
|
1097 |
+
// }
|
1098 |
+
if ($value) {
|
1099 |
+
$carriergroupText .= '</br>' . $name;
|
1100 |
+
if (in_array($code, $displayValues)) {
|
1101 |
+
$carriergroupText .= ': ' . $value;
|
1102 |
+
}
|
1103 |
+
}
|
1104 |
+
}
|
1105 |
+
if (array_key_exists('freightQuoteId', $cgrp) && $cgrp['freightQuoteId'] != '') {
|
1106 |
+
$carriergroupText .= ' Quote Id: ' . $cgrp['freightQuoteId'];
|
1107 |
+
}
|
1108 |
+
$carriergroupText .= '<br/><br/>';
|
1109 |
+
}
|
1110 |
}
|
1111 |
+
return $carriergroupText;
|
1112 |
}
|
1113 |
|
1114 |
public function setShippingOnItems($shippingDetails, $shippingAddress)
|
1115 |
{
|
1116 |
$itemsGrouped = $this->getItemsGroupedByCarrierGroup($shippingAddress->getAllItems());
|
1117 |
+
|
1118 |
+
if(!count($shippingDetails)) {//SHQ16-1932
|
1119 |
+
foreach($itemsGrouped as $cgItemsGrouped) {
|
1120 |
+
foreach ($cgItemsGrouped as $item) {
|
1121 |
+
$item->setCarriergroupShipping(null);
|
1122 |
+
}
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
return null;
|
1126 |
+
}
|
1127 |
+
|
1128 |
foreach($shippingDetails as $carrierGroupDetail)
|
1129 |
{
|
1130 |
if(is_array($carrierGroupDetail) && array_key_exists('carrierTitle', $carrierGroupDetail)) {
|
1131 |
$carrierGroupId = $carrierGroupDetail['carrierGroupId'];
|
1132 |
$shippingText = $carrierGroupDetail['carrierTitle'] .' - ' .$carrierGroupDetail['methodTitle'];
|
1133 |
+
if(array_key_exists('delivery_date', $carrierGroupDetail) && $carrierGroupDetail['delivery_date'] != '') {
|
1134 |
$shippingText .= ' Delivery: ' .$carrierGroupDetail['delivery_date'];
|
1135 |
}
|
1136 |
+
if(array_key_exists('dispatch_date', $carrierGroupDetail) && $carrierGroupDetail['dispatch_date'] != '') {
|
1137 |
$shippingText .= ' Dispatch: ' .$carrierGroupDetail['dispatch_date'];
|
1138 |
}
|
1139 |
// if(array_key_exists('time_slot'))
|
1221 |
$this->saveConfig('carriers/'.$carrierCode.'/active', 0);
|
1222 |
}
|
1223 |
$this->saveCarrierTitle($carrierCode, $carrierTitle);
|
1224 |
+
if(!is_null($sortOrder)) {
|
|
|
1225 |
$this->saveConfig('carriers/'.$carrierCode.'/sort_order', $sortOrder);
|
1226 |
}
|
1227 |
|
app/code/community/Shipperhq/Shipper/Model/Adminhtml/System/Config/Source/Shipping/Allmethods.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Adminhtml
|
23 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
class Shipperhq_Shipper_Model_Adminhtml_System_Config_Source_Shipping_Allmethods extends Mage_Adminhtml_Model_System_Config_Source_Shipping_Allmethods
|
28 |
+
{
|
29 |
+
/*
|
30 |
+
* Ignore carrier codes for Allowed Methods
|
31 |
+
*/
|
32 |
+
protected $ignoreCarrierCodes = array('multicarrier', 'shipper', 'calendar', 'pickup');
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Return array of carriers.
|
36 |
+
* If $isActiveOnlyFlag is set to true, will return only active carriers
|
37 |
+
*
|
38 |
+
* @param bool $isActiveOnlyFlag
|
39 |
+
* @return array
|
40 |
+
*/
|
41 |
+
public function toOptionArray($isActiveOnlyFlag=false)
|
42 |
+
{
|
43 |
+
$methods = array(array('value'=>'', 'label'=>''));
|
44 |
+
$carriers = Mage::getSingleton('shipping/config')->getAllCarriers();
|
45 |
+
foreach ($carriers as $carrierCode=>$carrierModel) {
|
46 |
+
if ((!$carrierModel->isActive() && (bool)$isActiveOnlyFlag === true) ||
|
47 |
+
in_array($carrierCode, $this->ignoreCarrierCodes)) {
|
48 |
+
continue;
|
49 |
+
}
|
50 |
+
|
51 |
+
if(strstr($carrierCode, 'shq')) {
|
52 |
+
$carrierMethods = $carrierModel->getAllowedMethods($carrierCode);
|
53 |
+
}
|
54 |
+
else {
|
55 |
+
$carrierMethods = $carrierModel->getAllowedMethods();
|
56 |
+
}
|
57 |
+
if (!$carrierMethods) {
|
58 |
+
continue;
|
59 |
+
}
|
60 |
+
$carrierTitle = Mage::getStoreConfig('carriers/'.$carrierCode.'/title');
|
61 |
+
$methods[$carrierCode] = array(
|
62 |
+
'label' => $carrierTitle,
|
63 |
+
'value' => array(),
|
64 |
+
);
|
65 |
+
foreach ($carrierMethods as $methodCode=>$methodTitle) {
|
66 |
+
$methods[$carrierCode]['value'][] = array(
|
67 |
+
'value' => $carrierCode.'_'.$methodCode,
|
68 |
+
'label' => '['.$carrierCode.'] '.$methodTitle,
|
69 |
+
);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
return $methods;
|
73 |
+
}
|
74 |
+
}
|
app/code/community/Shipperhq/Shipper/Model/Carrier/Backup.php
CHANGED
@@ -41,37 +41,45 @@ class Shipperhq_Shipper_Model_Carrier_Backup extends Mage_Core_Model_Abstract
|
|
41 |
protected $storeId;
|
42 |
protected $availabilityConfigField = 'active';
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
45 |
{
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
|
|
|
|
57 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
58 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', '
|
59 |
-
$carrierCode);
|
60 |
}
|
61 |
-
return false;
|
62 |
-
}
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
$result);
|
68 |
-
}
|
69 |
|
70 |
-
|
71 |
-
$this->tempSetCarrierEnabled($carrierCode,false);
|
72 |
}
|
73 |
-
return $result;
|
74 |
|
|
|
75 |
}
|
76 |
|
77 |
/**
|
41 |
protected $storeId;
|
42 |
protected $availabilityConfigField = 'active';
|
43 |
|
44 |
+
/**
|
45 |
+
* @param $request
|
46 |
+
* @param bool $lastCheck is this the last check for backup rates as no rates found? No rates will be because of prevent carrier rule
|
47 |
+
* @return bool
|
48 |
+
*/
|
49 |
+
public function getBackupCarrierRates($request, $lastCheck = false)
|
50 |
{
|
51 |
+
if (!$lastCheck) {
|
52 |
+
$this->storeId = $request->getStoreId();
|
53 |
+
$carrierCode = $this->getBackupCarrierDetails();
|
54 |
+
if (!$carrierCode) {
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
|
58 |
+
$tempEnabledCarrier = $this->tempSetCarrierEnabled($carrierCode, true);
|
59 |
+
$carrier = $this->getCarrierByCode($carrierCode, $request->getStoreId());
|
60 |
|
61 |
+
if (!$carrier) {
|
62 |
+
$this->tempSetCarrierEnabled($carrierCode, false);
|
63 |
+
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
64 |
+
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Unable to activate backup carrier', $carrierCode);
|
65 |
+
}
|
66 |
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
|
70 |
+
$result = $carrier->collectRates($request);
|
71 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
72 |
+
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Backup carrier result: ', $result);
|
|
|
73 |
}
|
|
|
|
|
74 |
|
75 |
+
if ($tempEnabledCarrier) {
|
76 |
+
$this->tempSetCarrierEnabled($carrierCode, false);
|
77 |
+
}
|
|
|
|
|
78 |
|
79 |
+
return $result;
|
|
|
80 |
}
|
|
|
81 |
|
82 |
+
return false;
|
83 |
}
|
84 |
|
85 |
/**
|
app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/AddressMapper.php
CHANGED
@@ -173,8 +173,8 @@ class Shipperhq_Shipper_Model_Carrier_Convert_AddressMapper extends Shipperhq_Sh
|
|
173 |
'discountPercent' => $magentoItem->getDiscountPercent(),
|
174 |
'discountedBasePrice' => $magentoItem->getBasePrice() - ($magentoItem->getBaseDiscountAmount()/$magentoItem->getQty()),
|
175 |
'discountedStorePrice' => $magentoItem->getPrice() - ($magentoItem->getDiscountAmount()/$magentoItem->getQty()),
|
176 |
-
'discountedTaxInclBasePrice' => $magentoItem->
|
177 |
-
'discountedTaxInclStorePrice' => $magentoItem->
|
178 |
'attributes' => self::populateAttributes($stdAttributes, $magentoItem),
|
179 |
'legacyAttributes' => self::populateAttributes(self::$_legacyAttributeNames, $magentoItem),
|
180 |
'baseCurrency' => Mage::app()->getBaseCurrencyCode(),//$request->getBaseCurrency()->getCurrencyCode(),
|
@@ -188,6 +188,11 @@ class Shipperhq_Shipper_Model_Carrier_Convert_AddressMapper extends Shipperhq_Sh
|
|
188 |
'fixedWeight' => $fixedWeight,
|
189 |
);
|
190 |
|
|
|
|
|
|
|
|
|
|
|
191 |
if (!$childItems) {
|
192 |
$formattedItem['items'] = self::getFormattedItems(
|
193 |
$magentoItem->getChildren(), true, null );
|
@@ -199,6 +204,7 @@ class Shipperhq_Shipper_Model_Carrier_Convert_AddressMapper extends Shipperhq_Sh
|
|
199 |
return $formattedItems;
|
200 |
}
|
201 |
|
|
|
202 |
/**
|
203 |
* Get values for destination
|
204 |
*
|
173 |
'discountPercent' => $magentoItem->getDiscountPercent(),
|
174 |
'discountedBasePrice' => $magentoItem->getBasePrice() - ($magentoItem->getBaseDiscountAmount()/$magentoItem->getQty()),
|
175 |
'discountedStorePrice' => $magentoItem->getPrice() - ($magentoItem->getDiscountAmount()/$magentoItem->getQty()),
|
176 |
+
'discountedTaxInclBasePrice' => $magentoItem->getBasePriceInclTax() - ($magentoItem->getBaseDiscountAmount()/$magentoItem->getQty()),//SHQ16-1893
|
177 |
+
'discountedTaxInclStorePrice' => $magentoItem->getPriceInclTax() - ($magentoItem->getDiscountAmount()/$magentoItem->getQty()),//SHQ16-1893
|
178 |
'attributes' => self::populateAttributes($stdAttributes, $magentoItem),
|
179 |
'legacyAttributes' => self::populateAttributes(self::$_legacyAttributeNames, $magentoItem),
|
180 |
'baseCurrency' => Mage::app()->getBaseCurrencyCode(),//$request->getBaseCurrency()->getCurrencyCode(),
|
188 |
'fixedWeight' => $fixedWeight,
|
189 |
);
|
190 |
|
191 |
+
$formattedItem['discountedBasePrice'] = self::checkPricePositiveValue($formattedItem['discountedBasePrice']);
|
192 |
+
$formattedItem['discountedStorePrice'] = self::checkPricePositiveValue($formattedItem['discountedStorePrice']);
|
193 |
+
$formattedItem['discountedTaxInclBasePrice'] = self::checkPricePositiveValue($formattedItem['discountedTaxInclBasePrice']);
|
194 |
+
$formattedItem['discountedTaxInclStorePrice'] = self::checkPricePositiveValue($formattedItem['discountedTaxInclStorePrice']);
|
195 |
+
|
196 |
if (!$childItems) {
|
197 |
$formattedItem['items'] = self::getFormattedItems(
|
198 |
$magentoItem->getChildren(), true, null );
|
204 |
return $formattedItems;
|
205 |
}
|
206 |
|
207 |
+
|
208 |
/**
|
209 |
* Get values for destination
|
210 |
*
|
app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/OrderMapper.php
CHANGED
@@ -252,7 +252,7 @@ class Shipperhq_Shipper_Model_Carrier_Convert_OrderMapper extends Shipperhq_Ship
|
|
252 |
{
|
253 |
$carrierGroupDetail = $order->getCarriergroupShippingDetails();
|
254 |
if($carrierGroupDetail) {
|
255 |
-
$cgDetail =
|
256 |
foreach($cgDetail as $carrierGroup) {
|
257 |
if(!is_array($carrierGroup)) {
|
258 |
$carrierGroup = (array)$carrierGroup;
|
252 |
{
|
253 |
$carrierGroupDetail = $order->getCarriergroupShippingDetails();
|
254 |
if($carrierGroupDetail) {
|
255 |
+
$cgDetail = Mage::helper('shipperhq_shipper')->decodeShippingDetails($carrierGroupDetail);
|
256 |
foreach($cgDetail as $carrierGroup) {
|
257 |
if(!is_array($carrierGroup)) {
|
258 |
$carrierGroup = (array)$carrierGroup;
|
app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/ShipmentMapper.php
CHANGED
@@ -163,7 +163,7 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipmentMapper extends Shipperhq_S
|
|
163 |
{
|
164 |
$carrierGroupDetail = $order->getCarriergroupShippingDetails();
|
165 |
if($carrierGroupDetail) {
|
166 |
-
$cgDetail =
|
167 |
foreach($cgDetail as $carrierGroup) {
|
168 |
if(!is_array($carrierGroup)) {
|
169 |
$carrierGroup = (array)$carrierGroup;
|
163 |
{
|
164 |
$carrierGroupDetail = $order->getCarriergroupShippingDetails();
|
165 |
if($carrierGroupDetail) {
|
166 |
+
$cgDetail = Mage::helper('shipperhq_shipper')->decodeShippingDetails($carrierGroupDetail);
|
167 |
foreach($cgDetail as $carrierGroup) {
|
168 |
if(!is_array($carrierGroup)) {
|
169 |
$carrierGroup = (array)$carrierGroup;
|
app/code/community/Shipperhq/Shipper/Model/Carrier/Convert/ShipperMapper.php
CHANGED
@@ -53,7 +53,7 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
53 |
protected static $ecommerceType = 'magento';
|
54 |
protected static $_stdAttributeNames = array(
|
55 |
'shipperhq_shipping_group', 'shipperhq_post_shipping_group',
|
56 |
-
'shipperhq_warehouse', 'shipperhq_royal_mail_group', 'shipperhq_shipping_qty',
|
57 |
'shipperhq_shipping_fee','shipperhq_additional_price','freight_class',
|
58 |
'shipperhq_nmfc_class', 'shipperhq_nmfc_sub', 'shipperhq_handling_fee','shipperhq_carrier_code',
|
59 |
'shipperhq_volume_weight', 'shipperhq_declared_value', 'ship_separately','shipperhq_malleable_product',
|
@@ -79,7 +79,7 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
79 |
'package_type' // royal mail
|
80 |
);
|
81 |
|
82 |
-
protected static $_shippingOptions = array('liftgate_required', 'notify_required', 'inside_delivery', 'destination_type');
|
83 |
|
84 |
protected static $_prodAttributes;
|
85 |
|
@@ -314,6 +314,11 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
314 |
continue;
|
315 |
}
|
316 |
|
|
|
|
|
|
|
|
|
|
|
317 |
$calculator = Mage::helper('tax')->getCalculator();
|
318 |
$taxRequest = $calculator->getRateOriginRequest();
|
319 |
$taxRequest->setProductClassId($magentoItem->getProduct()->getTaxClassId());
|
@@ -325,19 +330,24 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
325 |
$stdAttributes = array_merge(self::getDimensionalAttributes($magentoItem), self::$_stdAttributeNames);
|
326 |
$options = self::populateCustomOptions($magentoItem);
|
327 |
$weight = $magentoItem->getWeight();
|
328 |
-
|
329 |
-
|
330 |
-
|
|
|
|
|
|
|
331 |
'Please review the product configuration for Sku ' .$magentoItem->getSku() .' as product has NULL weight');
|
|
|
332 |
}
|
333 |
-
$weight = 0;
|
334 |
}
|
|
|
335 |
if(is_null($id)) {
|
336 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
337 |
-
Mage::helper('wsalogger/log')->
|
338 |
-
|
339 |
}
|
340 |
}
|
|
|
341 |
$formattedItem = array(
|
342 |
'id' => $id,
|
343 |
'sku' => $magentoItem->getSku(),
|
@@ -354,12 +364,11 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
354 |
'discountPercent' => $magentoItem->getDiscountPercent(),
|
355 |
'discountedBasePrice' => $magentoItem->getBasePrice() - ($magentoItem->getBaseDiscountAmount()/$magentoItem->getQty()),
|
356 |
'discountedStorePrice' => $magentoItem->getPrice() - ($magentoItem->getDiscountAmount()/$magentoItem->getQty()),
|
357 |
-
'discountedTaxInclBasePrice' => $magentoItem->
|
358 |
-
'discountedTaxInclStorePrice' => $magentoItem->
|
359 |
'attributes' => $options? array_merge(self::populateAttributes($stdAttributes, $magentoItem), $options) : self::populateAttributes($stdAttributes, $magentoItem),
|
360 |
-
'legacyAttributes' => self::populateAttributes(self::$_legacyAttributeNames, $magentoItem),
|
361 |
'baseCurrency' => $request->getBaseCurrency()->getCurrencyCode(),
|
362 |
-
'packageCurrency' => $request->getPackageCurrency()->getCurrencyCode(),
|
363 |
'storeBaseCurrency' => Mage::app()->getBaseCurrencyCode(),
|
364 |
'storeCurrentCurrency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
365 |
'taxPercentage' => $taxPercentage,
|
@@ -369,6 +378,12 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
369 |
'fixedWeight' => $fixedWeight,
|
370 |
);
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
if (!$childItems) {
|
373 |
$formattedItem['items'] = self::getFormattedItems(
|
374 |
$request, $magentoItem->getChildren(), true, null );
|
@@ -404,13 +419,18 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
404 |
$formattedItem['discountedTaxInclStorePrice'] = $childPrices['taxInclStorePrice'] * $discountDifference;
|
405 |
}
|
406 |
}
|
407 |
-
|
408 |
$formattedItems[] = $formattedItem;
|
409 |
|
410 |
}
|
411 |
return $formattedItems;
|
412 |
}
|
413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
private static function getBundleChildPrices($magentoItem)
|
415 |
{
|
416 |
$parentProduct = $magentoItem->getParentItem()->getProduct();
|
@@ -455,8 +475,14 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
455 |
protected static function getCustomerGroupId($items)
|
456 |
{
|
457 |
if(count($items) > 0) {
|
458 |
-
|
|
|
|
|
|
|
|
|
|
|
459 |
}
|
|
|
460 |
return null;
|
461 |
}
|
462 |
|
@@ -592,7 +618,14 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
592 |
protected static function populateCustomOptions($item)
|
593 |
{
|
594 |
$option_labels = array();
|
595 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
$label = '';
|
597 |
foreach($options as $customOption) {
|
598 |
$label .= $customOption['label'];
|
@@ -637,10 +670,12 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
637 |
{
|
638 |
$shippingOptions = array();
|
639 |
if($request->getQuote() && $shippingAddress = $request->getQuote()->getShippingAddress()) {
|
|
|
640 |
foreach(self::$_shippingOptions as $option) {
|
641 |
//destination type is case sensitive in SHQ
|
642 |
-
if(
|
643 |
-
|
|
|
644 |
}
|
645 |
elseif($option == 'destination_type') {
|
646 |
$destType = Mage::registry('Shipperhq_Destination_Type');
|
@@ -650,7 +685,6 @@ class Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper {
|
|
650 |
}
|
651 |
}
|
652 |
}
|
653 |
-
|
654 |
$selectedOptions = new \ShipperHQ\Shipping\SelectedOptions(
|
655 |
$shippingOptions
|
656 |
);
|
53 |
protected static $ecommerceType = 'magento';
|
54 |
protected static $_stdAttributeNames = array(
|
55 |
'shipperhq_shipping_group', 'shipperhq_post_shipping_group',
|
56 |
+
'shipperhq_location', 'shipperhq_warehouse', 'shipperhq_royal_mail_group', 'shipperhq_shipping_qty', 'shipperhq_availability_date',
|
57 |
'shipperhq_shipping_fee','shipperhq_additional_price','freight_class',
|
58 |
'shipperhq_nmfc_class', 'shipperhq_nmfc_sub', 'shipperhq_handling_fee','shipperhq_carrier_code',
|
59 |
'shipperhq_volume_weight', 'shipperhq_declared_value', 'ship_separately','shipperhq_malleable_product',
|
79 |
'package_type' // royal mail
|
80 |
);
|
81 |
|
82 |
+
protected static $_shippingOptions = array('liftgate_required', 'notify_required', 'inside_delivery', 'destination_type', 'limited_delivery');
|
83 |
|
84 |
protected static $_prodAttributes;
|
85 |
|
314 |
continue;
|
315 |
}
|
316 |
|
317 |
+
// Custom patch here for support with IWD_OrderManager and getting rates for orders from admin order view
|
318 |
+
if($magentoItem instanceof Mage_Sales_Model_Order_Item) {
|
319 |
+
$magentoItem->setQty($magentoItem->getQtyToShip());
|
320 |
+
}
|
321 |
+
|
322 |
$calculator = Mage::helper('tax')->getCalculator();
|
323 |
$taxRequest = $calculator->getRateOriginRequest();
|
324 |
$taxRequest->setProductClassId($magentoItem->getProduct()->getTaxClassId());
|
330 |
$stdAttributes = array_merge(self::getDimensionalAttributes($magentoItem), self::$_stdAttributeNames);
|
331 |
$options = self::populateCustomOptions($magentoItem);
|
332 |
$weight = $magentoItem->getWeight();
|
333 |
+
|
334 |
+
if(is_null($weight) || $weight == 0) { //SHIPPERHQ-1855 / SHQ16-1399
|
335 |
+
if ($productType!= Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL &&
|
336 |
+
$productType!= Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE &&
|
337 |
+
Mage::helper('shipperhq_shipper')->isDebug()) {
|
338 |
+
Mage::helper('wsalogger/log')->postCritical('ShipperHQ','Item weight is null, using default weight set in SHQ',
|
339 |
'Please review the product configuration for Sku ' .$magentoItem->getSku() .' as product has NULL weight');
|
340 |
+
$weight = null;
|
341 |
}
|
|
|
342 |
}
|
343 |
+
|
344 |
if(is_null($id)) {
|
345 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
346 |
+
Mage::helper('wsalogger/log')->postDebug('ShipperHQ','Item ID is null',
|
347 |
+
$magentoItem->getSku());
|
348 |
}
|
349 |
}
|
350 |
+
|
351 |
$formattedItem = array(
|
352 |
'id' => $id,
|
353 |
'sku' => $magentoItem->getSku(),
|
364 |
'discountPercent' => $magentoItem->getDiscountPercent(),
|
365 |
'discountedBasePrice' => $magentoItem->getBasePrice() - ($magentoItem->getBaseDiscountAmount()/$magentoItem->getQty()),
|
366 |
'discountedStorePrice' => $magentoItem->getPrice() - ($magentoItem->getDiscountAmount()/$magentoItem->getQty()),
|
367 |
+
'discountedTaxInclBasePrice' => $magentoItem->getBasePriceInclTax() - ($magentoItem->getBaseDiscountAmount()/$magentoItem->getQty()),//SHQ16-1893
|
368 |
+
'discountedTaxInclStorePrice' => $magentoItem->getPriceInclTax() - ($magentoItem->getDiscountAmount()/$magentoItem->getQty()),//SHQ16-1893
|
369 |
'attributes' => $options? array_merge(self::populateAttributes($stdAttributes, $magentoItem), $options) : self::populateAttributes($stdAttributes, $magentoItem),
|
|
|
370 |
'baseCurrency' => $request->getBaseCurrency()->getCurrencyCode(),
|
371 |
+
'packageCurrency' => is_object($request->getPackageCurrency()) ? $request->getPackageCurrency()->getCurrencyCode() : $request->getPackageCurrency(), // Custom patch here for support with IWD_OrderManager and getting rates for orders from admin order view
|
372 |
'storeBaseCurrency' => Mage::app()->getBaseCurrencyCode(),
|
373 |
'storeCurrentCurrency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
374 |
'taxPercentage' => $taxPercentage,
|
378 |
'fixedWeight' => $fixedWeight,
|
379 |
);
|
380 |
|
381 |
+
$formattedItem['discountedBasePrice'] = self::checkPricePositiveValue($formattedItem['discountedBasePrice']);
|
382 |
+
$formattedItem['discountedStorePrice'] = self::checkPricePositiveValue($formattedItem['discountedStorePrice']);
|
383 |
+
$formattedItem['discountedTaxInclBasePrice'] = self::checkPricePositiveValue($formattedItem['discountedTaxInclBasePrice']);
|
384 |
+
$formattedItem['discountedTaxInclStorePrice'] = self::checkPricePositiveValue($formattedItem['discountedTaxInclStorePrice']);
|
385 |
+
|
386 |
+
|
387 |
if (!$childItems) {
|
388 |
$formattedItem['items'] = self::getFormattedItems(
|
389 |
$request, $magentoItem->getChildren(), true, null );
|
419 |
$formattedItem['discountedTaxInclStorePrice'] = $childPrices['taxInclStorePrice'] * $discountDifference;
|
420 |
}
|
421 |
}
|
|
|
422 |
$formattedItems[] = $formattedItem;
|
423 |
|
424 |
}
|
425 |
return $formattedItems;
|
426 |
}
|
427 |
|
428 |
+
|
429 |
+
protected static function checkPricePositiveValue($price) {
|
430 |
+
return $price<0 ? 0 : $price;
|
431 |
+
|
432 |
+
}
|
433 |
+
|
434 |
private static function getBundleChildPrices($magentoItem)
|
435 |
{
|
436 |
$parentProduct = $magentoItem->getParentItem()->getProduct();
|
475 |
protected static function getCustomerGroupId($items)
|
476 |
{
|
477 |
if(count($items) > 0) {
|
478 |
+
// Custom patch here for support with IWD_OrderManager and getting rates for orders from admin order view
|
479 |
+
if ($items[0] instanceof Mage_Sales_Model_Order_Item) {
|
480 |
+
return $items[0]->getOrder()->getCustomerGroupId();
|
481 |
+
} else {
|
482 |
+
return $items[0]->getQuote()->getCustomerGroupId();
|
483 |
+
}
|
484 |
}
|
485 |
+
|
486 |
return null;
|
487 |
}
|
488 |
|
618 |
protected static function populateCustomOptions($item)
|
619 |
{
|
620 |
$option_labels = array();
|
621 |
+
|
622 |
+
// Custom patch here for support with IWD_OrderManager and getting rates for orders from admin order view
|
623 |
+
if($item instanceof Mage_Sales_Model_Order_Item) {
|
624 |
+
$options = $item->getProduct()->getCustomOptions();
|
625 |
+
} else {
|
626 |
+
$options = Mage::helper('catalog/product_configuration')->getCustomOptions($item);
|
627 |
+
}
|
628 |
+
|
629 |
$label = '';
|
630 |
foreach($options as $customOption) {
|
631 |
$label .= $customOption['label'];
|
670 |
{
|
671 |
$shippingOptions = array();
|
672 |
if($request->getQuote() && $shippingAddress = $request->getQuote()->getShippingAddress()) {
|
673 |
+
$selectedFreightOptions = Mage::helper('shipperhq_shipper')->getQuoteStorage()->getSelectedFreightCarrier();
|
674 |
foreach(self::$_shippingOptions as $option) {
|
675 |
//destination type is case sensitive in SHQ
|
676 |
+
if(isset($selectedFreightOptions[$option]) && $selectedFreightOptions[$option] != '') {
|
677 |
+
//SHQ16-1605
|
678 |
+
$shippingOptions[] = array('name'=> $option, 'value' => strtolower($selectedFreightOptions[$option]));
|
679 |
}
|
680 |
elseif($option == 'destination_type') {
|
681 |
$destType = Mage::registry('Shipperhq_Destination_Type');
|
685 |
}
|
686 |
}
|
687 |
}
|
|
|
688 |
$selectedOptions = new \ShipperHQ\Shipping\SelectedOptions(
|
689 |
$shippingOptions
|
690 |
);
|
app/code/community/Shipperhq/Shipper/Model/Carrier/Shipper.php
CHANGED
@@ -113,7 +113,6 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
113 |
*/
|
114 |
protected $_modName = 'Shipperhq_Shipper';
|
115 |
|
116 |
-
|
117 |
/**
|
118 |
* Retrieve sort order of current carrier
|
119 |
*
|
@@ -134,9 +133,14 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
134 |
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
|
135 |
{
|
136 |
if (!$this->getConfigFlag($this->_activeFlag)) {
|
137 |
-
|
138 |
return false;
|
139 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
$initVal = microtime(true);
|
141 |
|
142 |
$this->_cacheEnabled = Mage::app()->useCache('collections');
|
@@ -185,13 +189,13 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
185 |
$cartType = 'MAC';
|
186 |
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Pickup')&&
|
187 |
Mage::helper('shipperhq_pickup')->pickupPreselected($request)) {
|
188 |
-
|
189 |
}
|
190 |
}
|
191 |
$request->setCartType($cartType);
|
192 |
$request->setStore($this->getStore());
|
193 |
$this->_shipperRequest = Mage::getSingleton('Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper')->
|
194 |
-
|
195 |
$this->_rawRequest = $request;
|
196 |
return $this;
|
197 |
|
@@ -210,11 +214,11 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
210 |
|
211 |
public function refreshCarriers()
|
212 |
{
|
213 |
-
$allowedMethods = $this->
|
214 |
if(count($allowedMethods) == 0 ) {
|
215 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
216 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'refresh carriers',
|
217 |
-
|
218 |
}
|
219 |
$result['result'] = false;
|
220 |
$result['error'] = 'ShipperHQ Error: No shipping methods for carrier setup in your ShipperHQ account';
|
@@ -229,28 +233,39 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
229 |
*
|
230 |
* @return array
|
231 |
*/
|
232 |
-
public function
|
233 |
{
|
|
|
|
|
|
|
|
|
234 |
$ourCarrierCode = $this->getId();
|
235 |
$result = array();
|
236 |
$allowedMethods = array();
|
237 |
$allowedMethodUrl = Mage::helper('shipperhq_shipper')->getAllowedMethodGatewayUrl();
|
238 |
$timeout = Mage::helper('shipperhq_shipper')->getWebserviceTimeout();
|
239 |
$shipperMapper = Mage::getSingleton('Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper');
|
240 |
-
$
|
241 |
-
|
242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
$allowedMethodResponse = $resultSet['result'];
|
244 |
|
245 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
246 |
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Allowed methods response:',
|
247 |
-
|
248 |
}
|
249 |
if (!is_object($allowedMethodResponse)) {
|
250 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
251 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper',
|
252 |
-
|
253 |
-
|
254 |
}
|
255 |
|
256 |
$shipperHQ = "<a href=https://shipperhq.com/ratesmgr/websites>ShipperHQ</a> ";
|
@@ -261,7 +276,7 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
261 |
else if (count($allowedMethodResponse->errors)){
|
262 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
263 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Allowed methods: response contained following errors',
|
264 |
-
|
265 |
|
266 |
}
|
267 |
$error = 'ShipperHQ Error: ';
|
@@ -272,6 +287,13 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
272 |
elseif(isset($anError->externalErrorMessage) && $anError->externalErrorMessage != '') {
|
273 |
$error .= ' ' .$anError->externalErrorMessage;
|
274 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
}
|
276 |
$result['result'] = false;
|
277 |
$result['error'] = $error;
|
@@ -280,35 +302,35 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
280 |
else if ( !count($allowedMethodResponse->carrierMethods)) {
|
281 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
282 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper',
|
283 |
-
|
284 |
-
|
285 |
}
|
286 |
$result['result'] = false;
|
287 |
$result['warning'] = 'ShipperHQ Warning: No carriers setup, log in to ShipperHQ Dashboard and create carriers';
|
288 |
return $result;
|
289 |
}
|
290 |
|
291 |
-
$
|
292 |
|
293 |
$carrierConfig = array();
|
294 |
|
295 |
-
foreach ($
|
296 |
|
297 |
-
$
|
298 |
-
|
299 |
-
foreach ($
|
300 |
if(!is_null($ourCarrierCode) && $carrierMethod->carrierCode != $ourCarrierCode) {
|
301 |
continue;
|
302 |
}
|
303 |
|
304 |
-
$allowedMethodCode = /*$carrierMethod->carrierCode . '
|
305 |
$allowedMethodCode = preg_replace('/&|;| /', "_", $allowedMethodCode);
|
306 |
|
307 |
if (!array_key_exists($allowedMethodCode, $allowedMethods)) {
|
308 |
-
$
|
309 |
}
|
310 |
}
|
311 |
-
|
312 |
$carrierConfig[$carrierMethod->carrierCode]['title'] = $carrierMethod->title;
|
313 |
if(isset($carrierMethod->sortOrder)) {
|
314 |
$carrierConfig[$carrierMethod->carrierCode]['sortOrder'] = $carrierMethod->sortOrder;
|
@@ -320,10 +342,49 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
320 |
}
|
321 |
// go set carrier titles
|
322 |
$this->setCarrierConfig($carrierConfig);
|
323 |
-
|
324 |
return $allowedMethods;
|
325 |
}
|
326 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
public function createMergedRate($ratesToAdd)
|
328 |
{
|
329 |
$result = Mage::getModel('shipping/rate_result');
|
@@ -338,8 +399,8 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
338 |
$method->setFreightQuoteId($rateToAdd['freight_quote_id']);
|
339 |
$method->setMethodDescription($rateToAdd['mergedDescription']);
|
340 |
$method->setCarrierType(Mage::helper('shipperhq_shipper')->__('multiple_shipments'));
|
341 |
-
|
342 |
-
|
343 |
$result->append($method);
|
344 |
}
|
345 |
return $result;
|
@@ -353,7 +414,7 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
353 |
'title' => $carrierRate->carrierTitle);
|
354 |
|
355 |
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Calendar')) {
|
356 |
-
Mage::helper('shipperhq_calendar')->cleanUpCalendarsInSession($carrierRate->carrierCode, $carrierGroupId);
|
357 |
}
|
358 |
if(isset($carrierRate->error)) {
|
359 |
$carrierResultWithRates['error'] = (array)$carrierRate->error;
|
@@ -374,21 +435,19 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
374 |
$hideNotify = Mage::getStoreConfig('carriers/shipper/hide_notify');
|
375 |
$locale = $this->getLocaleInGlobals();
|
376 |
$dateOption = $carrierRate->dateOption;
|
377 |
-
|
378 |
-
Mage::helper('shipperhq_shipper')->__($carrierRate->deliveryDateMessage) : '';
|
379 |
-
if(is_null($deliveryMessage) || $deliveryMessage == '') {
|
380 |
-
$deliveryMessage = $dateOption == Shipperhq_Shipper_Helper_Data::TIME_IN_TRANSIT ? 'business day(s)' :
|
381 |
-
Mage::helper('shipperhq_shipper')->__('Delivers :');
|
382 |
-
}
|
383 |
$customDescription = isset($carrierRate->customDescription) ?
|
384 |
Mage::helper('shipperhq_shipper')->__($carrierRate->customDescription) : false;
|
385 |
-
$freightRate = isset($carrierRate->availableOptions) && !empty($carrierRate->availableOptions);
|
386 |
$baseRate = 1;
|
387 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrency()->getCode();
|
388 |
$dateFormat = isset($carrierRate->deliveryDateFormat) ?
|
389 |
-
|
390 |
-
|
391 |
foreach($carrierRate->rates as $oneRate) {
|
|
|
|
|
|
|
392 |
$methodDescription = false;
|
393 |
$title = Mage::helper('shipperhq_shipper')->isTransactionIdEnabled() ?
|
394 |
Mage::helper('shipperhq_shipper')->__($oneRate->name).' (' .$carrierGroupDetail['transaction'] .')'
|
@@ -400,12 +459,12 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
400 |
if(!$baseRate) {
|
401 |
$carrierResultWithRates['error'] = Mage::helper('directory')
|
402 |
->__('Can\'t convert rate from "%s".',
|
403 |
-
|
404 |
$carrierResultWithRates['carriergroup_detail']['carrierGroupId'] = $carrierGroupId;
|
405 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
406 |
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Shipper', 'Currency rate missing ',
|
407 |
-
|
408 |
-
|
409 |
}
|
410 |
continue;
|
411 |
}
|
@@ -413,27 +472,13 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
413 |
}
|
414 |
}
|
415 |
Mage::helper('shipperhq_shipper')->populateRateLevelDetails((array)$oneRate, $carrierGroupDetail, $baseRate);
|
|
|
|
|
|
|
|
|
|
|
416 |
if($oneRate->deliveryDate && is_numeric($oneRate->deliveryDate)) {
|
417 |
$deliveryDate = Mage::app()->getLocale()->date($oneRate->deliveryDate/1000, null, null, true)->toString($dateFormat);
|
418 |
-
if($dateOption == Shipperhq_Shipper_Helper_Data::DELIVERY_DATE_OPTION && isset($oneRate->deliveryDate)) {
|
419 |
-
$methodDescription = Mage::helper('shipperhq_shipper')->__(' %s %s',$deliveryMessage, $deliveryDate);
|
420 |
-
if($oneRate->latestDeliveryDate && is_numeric($oneRate->latestDeliveryDate)) {
|
421 |
-
$latestDeliveryDate = Mage::app()->getLocale()->date($oneRate->latestDeliveryDate/1000, null, null, true)->toString($dateFormat);
|
422 |
-
$methodDescription.= ' - ' .$latestDeliveryDate;
|
423 |
-
}
|
424 |
-
}
|
425 |
-
else if($dateOption == Shipperhq_Shipper_Helper_Data::TIME_IN_TRANSIT
|
426 |
-
&& isset($oneRate->dispatchDate)) {
|
427 |
-
$deliveryMessage = Mage::helper('shipperhq_shipper')->__('business days');
|
428 |
-
$numDays = floor(abs($oneRate->deliveryDate/1000 - $oneRate->dispatchDate/1000)/60/60/24);
|
429 |
-
if($oneRate->latestDeliveryDate && is_numeric($oneRate->latestDeliveryDate)) {
|
430 |
-
$maxNumDays = floor(abs($oneRate->latestDeliveryDate/1000 - $oneRate->dispatchDate/1000)/60/60/24);
|
431 |
-
$methodDescription = Mage::helper('shipperhq_shipper')->__(' (%s - %s %s)',$numDays, $maxNumDays, $deliveryMessage);
|
432 |
-
}
|
433 |
-
else {
|
434 |
-
$methodDescription = Mage::helper('shipperhq_shipper')->__(' (%s %s)',$numDays, $deliveryMessage);
|
435 |
-
}
|
436 |
-
}
|
437 |
}
|
438 |
if($oneRate->dispatchDate && is_numeric($oneRate->dispatchDate)) {
|
439 |
$dispatchDate = Mage::app()->getLocale()->date($oneRate->dispatchDate/1000, null, null, true)->toString($dateFormat);
|
@@ -444,6 +489,10 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
444 |
}
|
445 |
if($carrierRate->carrierType == 'shqshared') {
|
446 |
$carrierType = $carrierRate->carrierType .'_' .$oneRate->carrierType;
|
|
|
|
|
|
|
|
|
447 |
}
|
448 |
else {
|
449 |
$carrierType = $oneRate->carrierType;
|
@@ -491,6 +540,10 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
491 |
$rateToAdd['custom_description'] = $customDescription;
|
492 |
}
|
493 |
|
|
|
|
|
|
|
|
|
494 |
$thisCarriersRates[] = $rateToAdd;
|
495 |
}
|
496 |
return $thisCarriersRates;
|
@@ -516,13 +569,13 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
516 |
{
|
517 |
$codes = array(
|
518 |
'date_format' =>array(
|
519 |
-
'dd-mm-yyyy'
|
520 |
-
'mm/dd/yyyy'
|
521 |
'EEE dd-MM-yyyy' => 'D d-m-Y'
|
522 |
),
|
523 |
'short_date_format' =>array(
|
524 |
-
'dd-mm-yyyy'
|
525 |
-
'mm/dd/yyyy'
|
526 |
'EEE dd-MM-yyyy' => 'D d-m-Y'
|
527 |
),
|
528 |
'datepicker_format' => array(
|
@@ -553,15 +606,15 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
553 |
'Ed' => 'd EEE',
|
554 |
),
|
555 |
'en-GB' => array(
|
556 |
-
'yMd' => 'dd
|
557 |
'yMMMd' => 'd MMM Y',
|
558 |
'yMMMEd' => 'EEE, d MMM Y',
|
559 |
-
'yMEd' => 'EEE, d
|
560 |
'MMMd' => 'd MMM',
|
561 |
'MMMEd' => 'EEE, d MMM',
|
562 |
-
'MEd' => 'EEE, d
|
563 |
-
'Md' => 'd
|
564 |
-
'yM' => 'M
|
565 |
'yMMM' => 'MMM Y',
|
566 |
'MMM' => 'MMM',
|
567 |
'E' => 'EEE',
|
@@ -608,7 +661,7 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
608 |
if (!$resultSet) {
|
609 |
$initVal = microtime(true);
|
610 |
$resultSet = $this->_getShipperInstance()->sendAndReceive($this->_shipperRequest,
|
611 |
-
|
612 |
$elapsed = microtime(true) - $initVal;
|
613 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
614 |
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Short lapse',$elapsed );
|
@@ -630,10 +683,13 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
630 |
*/
|
631 |
/**
|
632 |
* if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
633 |
-
|
634 |
-
|
|
|
|
|
|
|
|
|
635 |
}
|
636 |
-
**/
|
637 |
return $this->_parseShipperResponse($resultSet['result']);
|
638 |
|
639 |
}
|
@@ -657,32 +713,38 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
657 |
Mage::helper('shipperhq_shipper')->getQuoteStorage()->setShipperGlobal($globals);
|
658 |
}
|
659 |
|
660 |
-
|
661 |
-
$result = Mage::getModel('shipping/rate_result');
|
662 |
-
}
|
663 |
-
else {
|
664 |
-
$result = Mage::getModel('shipperhq_shipper/rate_result');
|
665 |
-
}
|
666 |
// If no rates are found return error message
|
667 |
if (!is_object($shipperResponse)) {
|
668 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
669 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Shipper HQ did not return a response',
|
670 |
-
|
671 |
}
|
672 |
$message = $this->getCode('error', 1550);
|
673 |
|
|
|
|
|
|
|
|
|
|
|
674 |
return $this->returnGeneralError($message);
|
675 |
}
|
676 |
elseif(!empty($shipperResponse->errors)) {
|
677 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
678 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Shipper HQ returned an error',
|
679 |
-
|
680 |
}
|
681 |
if(isset($shipperResponse->errors)) {
|
682 |
foreach($shipperResponse->errors as $error) {
|
683 |
$this->appendError($result, $error, $this->_code, $this->getConfigData('title'));
|
684 |
}
|
685 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
return $result;
|
687 |
}
|
688 |
elseif(!isset($shipperResponse->carrierGroups)) {
|
@@ -691,10 +753,10 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
691 |
|
692 |
if(isset($shipperResponse->carrierGroups)) {
|
693 |
if(count($shipperResponse->carrierGroups) > 1 && !isset($shipperResponse->mergedRateResponse )) {
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
}
|
699 |
$carrierRates = $this->_processRatesResponse($shipperResponse);
|
700 |
}
|
@@ -705,6 +767,12 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
705 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
706 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Shipper HQ did not return any carrier rates',$debugData);
|
707 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
708 |
return $result;
|
709 |
}
|
710 |
|
@@ -720,14 +788,14 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
720 |
$carrierGroupDetail = $carrierRate['carriergroup_detail'];
|
721 |
}
|
722 |
$this->appendError($result, $carrierRate['error'], $carrierRate['code'], $carrierRate['title'],
|
723 |
-
|
724 |
continue;
|
725 |
}
|
726 |
|
727 |
if (!array_key_exists('rates', $carrierRate)) {
|
728 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
729 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper',
|
730 |
-
|
731 |
,$debugData);
|
732 |
}
|
733 |
} else {
|
@@ -788,14 +856,22 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
788 |
$rate->setCustomDescription($rateDetails['custom_description']);
|
789 |
}
|
790 |
|
|
|
|
|
|
|
|
|
791 |
$result->append($rate);
|
792 |
}
|
793 |
}
|
794 |
}
|
795 |
|
796 |
-
if
|
797 |
-
|
|
|
|
|
|
|
798 |
}
|
|
|
799 |
return $result;
|
800 |
|
801 |
}
|
@@ -845,7 +921,7 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
845 |
$carriergroupDescriber = $shipperResponse->globalSettings->carrierGroupDescription;
|
846 |
if($carriergroupDescriber != '') {
|
847 |
Mage::helper('shipperhq_shipper')->saveConfig(Shipperhq_Shipper_Helper_Data::SHIPPERHQ_SHIPPER_CARRIERGROUP_DESC_PATH,
|
848 |
-
|
849 |
}
|
850 |
|
851 |
Mage::helper('shipperhq_shipper')->refreshConfig();
|
@@ -865,10 +941,16 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
865 |
if($item->getSku() == $sku && (!$itemId || $item->getId() == $itemId)) {
|
866 |
$item->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
867 |
$item->setCarriergroup($carriergroupDetails['name']);
|
|
|
868 |
if($parentItem = $item->getParentItem()) {
|
869 |
$parentItem->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
870 |
$parentItem->setCarriergroup($carriergroupDetails['name']);
|
871 |
|
|
|
|
|
|
|
|
|
|
|
872 |
}
|
873 |
}
|
874 |
}
|
@@ -878,9 +960,15 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
878 |
if($quoteItem->getSku() == $sku && (!$itemId || $quoteItem->getQuoteItemId() == $itemId)) {
|
879 |
$quoteItem->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
880 |
$quoteItem->setCarriergroup($carriergroupDetails['name']);
|
|
|
881 |
if($parentItem = $quoteItem->getParentItem()) {
|
882 |
$parentItem->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
883 |
$parentItem->setCarriergroup($carriergroupDetails['name']);
|
|
|
|
|
|
|
|
|
|
|
884 |
}
|
885 |
}
|
886 |
}
|
@@ -909,7 +997,7 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
909 |
$error->setCarrier($this->_code);
|
910 |
$error->setCarrierTitle($this->getConfigData('title'));
|
911 |
$error->setCarriergroupId('');
|
912 |
-
if($message && Mage::helper('
|
913 |
$error->setErrorMessage($message);
|
914 |
}
|
915 |
else {
|
@@ -934,7 +1022,7 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
934 |
$errorDetails = get_object_vars($errorDetails);
|
935 |
}
|
936 |
if ((array_key_exists('internalErrorMessage', $errorDetails) && $errorDetails['internalErrorMessage'] != '')
|
937 |
-
|
938 |
{
|
939 |
$errorMessage = false;
|
940 |
if (Mage::helper('wsalogger')->isDebugError() && array_key_exists('internalErrorMessage', $errorDetails)
|
@@ -951,7 +1039,7 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
951 |
$error->setCarrierTitle($carrierTitle);
|
952 |
$error->setErrorMessage(Mage::helper('shipperhq_shipper')->__($errorMessage));
|
953 |
if(!is_null($carrierGroupId)) {
|
954 |
-
|
955 |
}
|
956 |
if(is_array($carrierGroupDetail) && array_key_exists('checkoutDescription', $carrierGroupDetail)) {
|
957 |
$error->setCarriergroup($carrierGroupDetail['checkoutDescription']);
|
@@ -982,10 +1070,10 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
982 |
|
983 |
}
|
984 |
|
985 |
-
protected function _getBackupCarrierRates()
|
986 |
{
|
987 |
$backupHandler = Mage::getModel('shipperhq_shipper/carrier_backup');
|
988 |
-
return $backupHandler->getBackupCarrierRates($this->_rawRequest);
|
989 |
}
|
990 |
|
991 |
/**
|
@@ -1025,9 +1113,9 @@ class Shipperhq_Shipper_Model_Carrier_Shipper
|
|
1025 |
|
1026 |
if (is_array($requestParams)) {
|
1027 |
$requestParams = implode(',', array_merge(
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
);
|
1032 |
|
1033 |
}
|
113 |
*/
|
114 |
protected $_modName = 'Shipperhq_Shipper';
|
115 |
|
|
|
116 |
/**
|
117 |
* Retrieve sort order of current carrier
|
118 |
*
|
133 |
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
|
134 |
{
|
135 |
if (!$this->getConfigFlag($this->_activeFlag)) {
|
|
|
136 |
return false;
|
137 |
}
|
138 |
+
foreach($request->getAllItems() as $item) {
|
139 |
+
if(is_null($item->getId()) && is_null($item->getQuoteItemId())) {
|
140 |
+
return false;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
$initVal = microtime(true);
|
145 |
|
146 |
$this->_cacheEnabled = Mage::app()->useCache('collections');
|
189 |
$cartType = 'MAC';
|
190 |
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Pickup')&&
|
191 |
Mage::helper('shipperhq_pickup')->pickupPreselected($request)) {
|
192 |
+
$cartType = 'MAC_PICKUP';
|
193 |
}
|
194 |
}
|
195 |
$request->setCartType($cartType);
|
196 |
$request->setStore($this->getStore());
|
197 |
$this->_shipperRequest = Mage::getSingleton('Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper')->
|
198 |
+
getShipperTranslation($request);
|
199 |
$this->_rawRequest = $request;
|
200 |
return $this;
|
201 |
|
214 |
|
215 |
public function refreshCarriers()
|
216 |
{
|
217 |
+
$allowedMethods = $this->getAllShippingMethods();
|
218 |
if(count($allowedMethods) == 0 ) {
|
219 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
220 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'refresh carriers',
|
221 |
+
'Allowed methods web service did not contain any shipping methods for carriers');
|
222 |
}
|
223 |
$result['result'] = false;
|
224 |
$result['error'] = 'ShipperHQ Error: No shipping methods for carrier setup in your ShipperHQ account';
|
233 |
*
|
234 |
* @return array
|
235 |
*/
|
236 |
+
public function getAllShippingMethods()
|
237 |
{
|
238 |
+
//SHQ16-1708
|
239 |
+
Mage::helper('shipperhq_shipper')->saveConfig(
|
240 |
+
Shipperhq_Shipper_Helper_Data::SHIPPERHQ_INVALID_CREDENTIALS_SUPPLIED,
|
241 |
+
0);
|
242 |
$ourCarrierCode = $this->getId();
|
243 |
$result = array();
|
244 |
$allowedMethods = array();
|
245 |
$allowedMethodUrl = Mage::helper('shipperhq_shipper')->getAllowedMethodGatewayUrl();
|
246 |
$timeout = Mage::helper('shipperhq_shipper')->getWebserviceTimeout();
|
247 |
$shipperMapper = Mage::getSingleton('Shipperhq_Shipper_Model_Carrier_Convert_ShipperMapper');
|
248 |
+
$allMethodsRequest = $shipperMapper->getCredentialsTranslation();
|
249 |
+
$requestString = serialize($allMethodsRequest);
|
250 |
+
$resultSet = $this->_getCachedQuotes($requestString);
|
251 |
+
$timeout = Mage::helper('shipperhq_shipper')->getWebserviceTimeout();
|
252 |
+
if (!$resultSet) {
|
253 |
+
$resultSet = $this->_getShipperInstance()->sendAndReceive($allMethodsRequest, $allowedMethodUrl, $timeout);
|
254 |
+
if(is_object($resultSet['result'])) {
|
255 |
+
$this->_setCachedQuotes($requestString, $resultSet);
|
256 |
+
}
|
257 |
+
}
|
258 |
$allowedMethodResponse = $resultSet['result'];
|
259 |
|
260 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
261 |
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Allowed methods response:',
|
262 |
+
$resultSet['debug']);
|
263 |
}
|
264 |
if (!is_object($allowedMethodResponse)) {
|
265 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
266 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper',
|
267 |
+
'Allowed Methods: No or invalid response received from Shipper HQ',
|
268 |
+
$allowedMethodResponse);
|
269 |
}
|
270 |
|
271 |
$shipperHQ = "<a href=https://shipperhq.com/ratesmgr/websites>ShipperHQ</a> ";
|
276 |
else if (count($allowedMethodResponse->errors)){
|
277 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
278 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Allowed methods: response contained following errors',
|
279 |
+
$allowedMethodResponse);
|
280 |
|
281 |
}
|
282 |
$error = 'ShipperHQ Error: ';
|
287 |
elseif(isset($anError->externalErrorMessage) && $anError->externalErrorMessage != '') {
|
288 |
$error .= ' ' .$anError->externalErrorMessage;
|
289 |
}
|
290 |
+
|
291 |
+
//SHQ16-1708
|
292 |
+
if(isset($anError->errorCode) && $anError->errorCode == '3') {
|
293 |
+
Mage::helper('shipperhq_shipper')->saveConfig(
|
294 |
+
Shipperhq_Shipper_Helper_Data::SHIPPERHQ_INVALID_CREDENTIALS_SUPPLIED,
|
295 |
+
1);
|
296 |
+
}
|
297 |
}
|
298 |
$result['result'] = false;
|
299 |
$result['error'] = $error;
|
302 |
else if ( !count($allowedMethodResponse->carrierMethods)) {
|
303 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
304 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper',
|
305 |
+
'Allowed methods web service did not return any carriers or shipping methods',
|
306 |
+
$allowedMethodResponse);
|
307 |
}
|
308 |
$result['result'] = false;
|
309 |
$result['warning'] = 'ShipperHQ Warning: No carriers setup, log in to ShipperHQ Dashboard and create carriers';
|
310 |
return $result;
|
311 |
}
|
312 |
|
313 |
+
$carriers = $allowedMethodResponse->carrierMethods;
|
314 |
|
315 |
$carrierConfig = array();
|
316 |
|
317 |
+
foreach ($carriers as $carrierMethod) {
|
318 |
|
319 |
+
$methodList = $carrierMethod->methods;
|
320 |
+
$methodCodeArray = array();
|
321 |
+
foreach ($methodList as $method) {
|
322 |
if(!is_null($ourCarrierCode) && $carrierMethod->carrierCode != $ourCarrierCode) {
|
323 |
continue;
|
324 |
}
|
325 |
|
326 |
+
$allowedMethodCode = /*$carrierMethod->carrierCode . '==' .*/ $method->methodCode;
|
327 |
$allowedMethodCode = preg_replace('/&|;| /', "_", $allowedMethodCode);
|
328 |
|
329 |
if (!array_key_exists($allowedMethodCode, $allowedMethods)) {
|
330 |
+
$methodCodeArray[$allowedMethodCode] = $method->name;
|
331 |
}
|
332 |
}
|
333 |
+
$allowedMethods[$carrierMethod->carrierCode] = $methodCodeArray;
|
334 |
$carrierConfig[$carrierMethod->carrierCode]['title'] = $carrierMethod->title;
|
335 |
if(isset($carrierMethod->sortOrder)) {
|
336 |
$carrierConfig[$carrierMethod->carrierCode]['sortOrder'] = $carrierMethod->sortOrder;
|
342 |
}
|
343 |
// go set carrier titles
|
344 |
$this->setCarrierConfig($carrierConfig);
|
345 |
+
$this->saveAllowedMethods($allowedMethods);
|
346 |
return $allowedMethods;
|
347 |
}
|
348 |
|
349 |
+
/**
|
350 |
+
* Get allowed shipping methods
|
351 |
+
*
|
352 |
+
* @return array
|
353 |
+
*/
|
354 |
+
public function getAllowedMethods($requestedCode = null)
|
355 |
+
{
|
356 |
+
$arr = array();
|
357 |
+
$allowedConfigValue = Mage::getStoreConfig(Shipperhq_Shipper_Helper_Data::SHIPPERHQ_SHIPPER_ALLOWED_METHODS_PATH);
|
358 |
+
$allowed = json_decode($allowedConfigValue);
|
359 |
+
if(is_null($allowed)) {
|
360 |
+
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
361 |
+
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Shipper', 'Allowed methods config is empty',
|
362 |
+
'Please refresh your carriers from the System > Configuration > Shipping Methods > ShipperHQ screen using Refresh Carriers button');
|
363 |
+
}
|
364 |
+
return $arr;
|
365 |
+
}
|
366 |
+
foreach ($allowed as $carrierCode => $allowedMethodArray) {
|
367 |
+
if(is_null($requestedCode) || $carrierCode == $requestedCode) {
|
368 |
+
foreach($allowedMethodArray as $methodCode => $allowedMethod) {
|
369 |
+
$arr[$methodCode] = $allowedMethod;
|
370 |
+
}
|
371 |
+
}
|
372 |
+
}
|
373 |
+
if (count($arr) < 1 && Mage::helper('shipperhq_shipper')->isDebug()
|
374 |
+
&& Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Shipper', 'carriers/shipper/active')) {
|
375 |
+
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'No saved allowed methods for ' .$requestedCode,
|
376 |
+
'Please refresh your carriers from the System > Configuration > Shipping Methods > ShipperHQ screen using Refresh Carriers button');
|
377 |
+
}
|
378 |
+
return $arr;
|
379 |
+
}
|
380 |
+
|
381 |
+
public function saveAllowedMethods($allowedMethodsArray)
|
382 |
+
{
|
383 |
+
$carriersCodesString = json_encode($allowedMethodsArray);
|
384 |
+
Mage::helper('shipperhq_shipper')->saveConfig(Shipperhq_Shipper_Helper_Data::SHIPPERHQ_SHIPPER_ALLOWED_METHODS_PATH,
|
385 |
+
$carriersCodesString);
|
386 |
+
}
|
387 |
+
|
388 |
public function createMergedRate($ratesToAdd)
|
389 |
{
|
390 |
$result = Mage::getModel('shipping/rate_result');
|
399 |
$method->setFreightQuoteId($rateToAdd['freight_quote_id']);
|
400 |
$method->setMethodDescription($rateToAdd['mergedDescription']);
|
401 |
$method->setCarrierType(Mage::helper('shipperhq_shipper')->__('multiple_shipments'));
|
402 |
+
// $method->setExpectedDelivery($rateToAdd['expected_delivery']);
|
403 |
+
// $method->setDispatchDate($rateToAdd['dispatch_date']);
|
404 |
$result->append($method);
|
405 |
}
|
406 |
return $result;
|
414 |
'title' => $carrierRate->carrierTitle);
|
415 |
|
416 |
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Calendar')) {
|
417 |
+
Mage::helper('shipperhq_calendar')->cleanUpCalendarsInSession($carrierRate->carrierCode, $carrierGroupId, $isSplit);
|
418 |
}
|
419 |
if(isset($carrierRate->error)) {
|
420 |
$carrierResultWithRates['error'] = (array)$carrierRate->error;
|
435 |
$hideNotify = Mage::getStoreConfig('carriers/shipper/hide_notify');
|
436 |
$locale = $this->getLocaleInGlobals();
|
437 |
$dateOption = $carrierRate->dateOption;
|
438 |
+
|
|
|
|
|
|
|
|
|
|
|
439 |
$customDescription = isset($carrierRate->customDescription) ?
|
440 |
Mage::helper('shipperhq_shipper')->__($carrierRate->customDescription) : false;
|
441 |
+
$freightRate = isset($carrierRate->availableOptions) && !empty($carrierRate->availableOptions) || $carrierRate->carrierType == 'customerAccount';
|
442 |
$baseRate = 1;
|
443 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrency()->getCode();
|
444 |
$dateFormat = isset($carrierRate->deliveryDateFormat) ?
|
445 |
+
$this->getCldrDateFormat($locale, $carrierRate->deliveryDateFormat) : Mage::helper('shipperhq_shipper')->getDateFormat();
|
446 |
+
$carrierGroupDetail['dateFormat'] = $dateFormat;
|
447 |
foreach($carrierRate->rates as $oneRate) {
|
448 |
+
//SHQ16-1118 reset so not carried over from previous rates
|
449 |
+
$carrierGroupDetail['delivery_date'] = '';
|
450 |
+
$carrierGroupDetail['dispatch_date'] = '';
|
451 |
$methodDescription = false;
|
452 |
$title = Mage::helper('shipperhq_shipper')->isTransactionIdEnabled() ?
|
453 |
Mage::helper('shipperhq_shipper')->__($oneRate->name).' (' .$carrierGroupDetail['transaction'] .')'
|
459 |
if(!$baseRate) {
|
460 |
$carrierResultWithRates['error'] = Mage::helper('directory')
|
461 |
->__('Can\'t convert rate from "%s".',
|
462 |
+
$oneRate->currency);
|
463 |
$carrierResultWithRates['carriergroup_detail']['carrierGroupId'] = $carrierGroupId;
|
464 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
465 |
Mage::helper('wsalogger/log')->postWarning('Shipperhq_Shipper', 'Currency rate missing ',
|
466 |
+
'Currency code in shipping rate is ' .$oneRate->currency
|
467 |
+
.' but there is no currency conversion rate configured so we cannot display this shipping rate');
|
468 |
}
|
469 |
continue;
|
470 |
}
|
472 |
}
|
473 |
}
|
474 |
Mage::helper('shipperhq_shipper')->populateRateLevelDetails((array)$oneRate, $carrierGroupDetail, $baseRate);
|
475 |
+
if($oneRate->deliveryMessage && !is_null($oneRate->deliveryMessage)) {
|
476 |
+
|
477 |
+
$methodDescription = $dateOption == Shipperhq_Shipper_Helper_Data::TIME_IN_TRANSIT ?
|
478 |
+
'(' .$oneRate->deliveryMessage .')' : $oneRate->deliveryMessage;
|
479 |
+
}
|
480 |
if($oneRate->deliveryDate && is_numeric($oneRate->deliveryDate)) {
|
481 |
$deliveryDate = Mage::app()->getLocale()->date($oneRate->deliveryDate/1000, null, null, true)->toString($dateFormat);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
}
|
483 |
if($oneRate->dispatchDate && is_numeric($oneRate->dispatchDate)) {
|
484 |
$dispatchDate = Mage::app()->getLocale()->date($oneRate->dispatchDate/1000, null, null, true)->toString($dateFormat);
|
489 |
}
|
490 |
if($carrierRate->carrierType == 'shqshared') {
|
491 |
$carrierType = $carrierRate->carrierType .'_' .$oneRate->carrierType;
|
492 |
+
$carrierGroupDetail['carrierType'] = $carrierType;
|
493 |
+
if(isset($oneRate->carrierTitle)) {
|
494 |
+
$carrierGroupDetail['carrierTitle'] = $oneRate->carrierTitle;
|
495 |
+
}
|
496 |
}
|
497 |
else {
|
498 |
$carrierType = $oneRate->carrierType;
|
540 |
$rateToAdd['custom_description'] = $customDescription;
|
541 |
}
|
542 |
|
543 |
+
if(!empty($oneRate->description) && $oneRate->description != "") {
|
544 |
+
$rateToAdd['tooltip'] = $oneRate->description;
|
545 |
+
}
|
546 |
+
|
547 |
$thisCarriersRates[] = $rateToAdd;
|
548 |
}
|
549 |
return $thisCarriersRates;
|
569 |
{
|
570 |
$codes = array(
|
571 |
'date_format' =>array(
|
572 |
+
'dd-mm-yyyy' => 'd-m-Y',
|
573 |
+
'mm/dd/yyyy' => 'm/d/Y',
|
574 |
'EEE dd-MM-yyyy' => 'D d-m-Y'
|
575 |
),
|
576 |
'short_date_format' =>array(
|
577 |
+
'dd-mm-yyyy' => 'd-m-Y',
|
578 |
+
'mm/dd/yyyy' => 'm/d/Y',
|
579 |
'EEE dd-MM-yyyy' => 'D d-m-Y'
|
580 |
),
|
581 |
'datepicker_format' => array(
|
606 |
'Ed' => 'd EEE',
|
607 |
),
|
608 |
'en-GB' => array(
|
609 |
+
'yMd' => 'dd-MM-Y',
|
610 |
'yMMMd' => 'd MMM Y',
|
611 |
'yMMMEd' => 'EEE, d MMM Y',
|
612 |
+
'yMEd' => 'EEE, d-M-Y',
|
613 |
'MMMd' => 'd MMM',
|
614 |
'MMMEd' => 'EEE, d MMM',
|
615 |
+
'MEd' => 'EEE, d-M',
|
616 |
+
'Md' => 'd-M',
|
617 |
+
'yM' => 'M-Y',
|
618 |
'yMMM' => 'MMM Y',
|
619 |
'MMM' => 'MMM',
|
620 |
'E' => 'EEE',
|
661 |
if (!$resultSet) {
|
662 |
$initVal = microtime(true);
|
663 |
$resultSet = $this->_getShipperInstance()->sendAndReceive($this->_shipperRequest,
|
664 |
+
Mage::helper('shipperhq_shipper')->getRateGatewayUrl(), $timeout);
|
665 |
$elapsed = microtime(true) - $initVal;
|
666 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
667 |
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Short lapse',$elapsed );
|
683 |
*/
|
684 |
/**
|
685 |
* if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
686 |
+
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Request/Response',
|
687 |
+
$resultSet);
|
688 |
+
}
|
689 |
+
**/
|
690 |
+
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
691 |
+
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Rate request and result', $resultSet['debug']);
|
692 |
}
|
|
|
693 |
return $this->_parseShipperResponse($resultSet['result']);
|
694 |
|
695 |
}
|
713 |
Mage::helper('shipperhq_shipper')->getQuoteStorage()->setShipperGlobal($globals);
|
714 |
}
|
715 |
|
716 |
+
$result = Mage::getModel('shipperhq_shipper/rate_result');
|
|
|
|
|
|
|
|
|
|
|
717 |
// If no rates are found return error message
|
718 |
if (!is_object($shipperResponse)) {
|
719 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
720 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Shipper HQ did not return a response',
|
721 |
+
$debugData);
|
722 |
}
|
723 |
$message = $this->getCode('error', 1550);
|
724 |
|
725 |
+
$backupRates = $this->_getBackupCarrierRates();
|
726 |
+
if ($backupRates) {
|
727 |
+
return $backupRates;
|
728 |
+
}
|
729 |
+
|
730 |
return $this->returnGeneralError($message);
|
731 |
}
|
732 |
elseif(!empty($shipperResponse->errors)) {
|
733 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
734 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Shipper HQ returned an error',
|
735 |
+
$debugData);
|
736 |
}
|
737 |
if(isset($shipperResponse->errors)) {
|
738 |
foreach($shipperResponse->errors as $error) {
|
739 |
$this->appendError($result, $error, $this->_code, $this->getConfigData('title'));
|
740 |
}
|
741 |
}
|
742 |
+
|
743 |
+
$backupRates = $this->_getBackupCarrierRates();
|
744 |
+
if ($backupRates) {
|
745 |
+
return $backupRates;
|
746 |
+
}
|
747 |
+
|
748 |
return $result;
|
749 |
}
|
750 |
elseif(!isset($shipperResponse->carrierGroups)) {
|
753 |
|
754 |
if(isset($shipperResponse->carrierGroups)) {
|
755 |
if(count($shipperResponse->carrierGroups) > 1 && !isset($shipperResponse->mergedRateResponse )) {
|
756 |
+
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
757 |
+
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper',
|
758 |
+
'Shipper HQ returned multi origin/group rates without any merged rate details',$debugData);
|
759 |
+
}
|
760 |
}
|
761 |
$carrierRates = $this->_processRatesResponse($shipperResponse);
|
762 |
}
|
767 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
768 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Shipper HQ did not return any carrier rates',$debugData);
|
769 |
}
|
770 |
+
|
771 |
+
$backupRates = $this->_getBackupCarrierRates();
|
772 |
+
if ($backupRates) {
|
773 |
+
return $backupRates;
|
774 |
+
}
|
775 |
+
|
776 |
return $result;
|
777 |
}
|
778 |
|
788 |
$carrierGroupDetail = $carrierRate['carriergroup_detail'];
|
789 |
}
|
790 |
$this->appendError($result, $carrierRate['error'], $carrierRate['code'], $carrierRate['title'],
|
791 |
+
$carriergroupId,$carrierGroupDetail);
|
792 |
continue;
|
793 |
}
|
794 |
|
795 |
if (!array_key_exists('rates', $carrierRate)) {
|
796 |
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
797 |
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper',
|
798 |
+
'Shipper HQ did not return any rates for '. $carrierRate['code'] .' ' .$carrierRate['title']
|
799 |
,$debugData);
|
800 |
}
|
801 |
} else {
|
856 |
$rate->setCustomDescription($rateDetails['custom_description']);
|
857 |
}
|
858 |
|
859 |
+
if(array_key_exists('tooltip', $rateDetails)) {
|
860 |
+
$rate->setTooltip($rateDetails['tooltip']);
|
861 |
+
}
|
862 |
+
|
863 |
$result->append($rate);
|
864 |
}
|
865 |
}
|
866 |
}
|
867 |
|
868 |
+
if(!count($result->getAllRates())) {
|
869 |
+
$backupRates = $this->_getBackupCarrierRates(true);
|
870 |
+
if ($backupRates) {
|
871 |
+
return $backupRates;
|
872 |
+
}
|
873 |
}
|
874 |
+
|
875 |
return $result;
|
876 |
|
877 |
}
|
921 |
$carriergroupDescriber = $shipperResponse->globalSettings->carrierGroupDescription;
|
922 |
if($carriergroupDescriber != '') {
|
923 |
Mage::helper('shipperhq_shipper')->saveConfig(Shipperhq_Shipper_Helper_Data::SHIPPERHQ_SHIPPER_CARRIERGROUP_DESC_PATH,
|
924 |
+
$carriergroupDescriber);
|
925 |
}
|
926 |
|
927 |
Mage::helper('shipperhq_shipper')->refreshConfig();
|
941 |
if($item->getSku() == $sku && (!$itemId || $item->getId() == $itemId)) {
|
942 |
$item->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
943 |
$item->setCarriergroup($carriergroupDetails['name']);
|
944 |
+
|
945 |
if($parentItem = $item->getParentItem()) {
|
946 |
$parentItem->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
947 |
$parentItem->setCarriergroup($carriergroupDetails['name']);
|
948 |
|
949 |
+
} else if ($childItems = $item->getChildren()) {
|
950 |
+
foreach ($childItems as $child) {
|
951 |
+
$child->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
952 |
+
$child->setCarriergroup($carriergroupDetails['name']);
|
953 |
+
}
|
954 |
}
|
955 |
}
|
956 |
}
|
960 |
if($quoteItem->getSku() == $sku && (!$itemId || $quoteItem->getQuoteItemId() == $itemId)) {
|
961 |
$quoteItem->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
962 |
$quoteItem->setCarriergroup($carriergroupDetails['name']);
|
963 |
+
|
964 |
if($parentItem = $quoteItem->getParentItem()) {
|
965 |
$parentItem->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
966 |
$parentItem->setCarriergroup($carriergroupDetails['name']);
|
967 |
+
} else if ($childItems = $item->getChildren()) {
|
968 |
+
foreach ($childItems as $child) {
|
969 |
+
$child->setCarriergroupId($carriergroupDetails['carrierGroupId']);
|
970 |
+
$child->setCarriergroup($carriergroupDetails['name']);
|
971 |
+
}
|
972 |
}
|
973 |
}
|
974 |
}
|
997 |
$error->setCarrier($this->_code);
|
998 |
$error->setCarrierTitle($this->getConfigData('title'));
|
999 |
$error->setCarriergroupId('');
|
1000 |
+
if($message && Mage::helper('wsalogger')->isDebugError()) {
|
1001 |
$error->setErrorMessage($message);
|
1002 |
}
|
1003 |
else {
|
1022 |
$errorDetails = get_object_vars($errorDetails);
|
1023 |
}
|
1024 |
if ((array_key_exists('internalErrorMessage', $errorDetails) && $errorDetails['internalErrorMessage'] != '')
|
1025 |
+
|| (array_key_exists('externalErrorMessage', $errorDetails) && $errorDetails['externalErrorMessage'] != ''))
|
1026 |
{
|
1027 |
$errorMessage = false;
|
1028 |
if (Mage::helper('wsalogger')->isDebugError() && array_key_exists('internalErrorMessage', $errorDetails)
|
1039 |
$error->setCarrierTitle($carrierTitle);
|
1040 |
$error->setErrorMessage(Mage::helper('shipperhq_shipper')->__($errorMessage));
|
1041 |
if(!is_null($carrierGroupId)) {
|
1042 |
+
$error->setCarriergroupId($carrierGroupId);
|
1043 |
}
|
1044 |
if(is_array($carrierGroupDetail) && array_key_exists('checkoutDescription', $carrierGroupDetail)) {
|
1045 |
$error->setCarriergroup($carrierGroupDetail['checkoutDescription']);
|
1070 |
|
1071 |
}
|
1072 |
|
1073 |
+
protected function _getBackupCarrierRates($lastCheck = false)
|
1074 |
{
|
1075 |
$backupHandler = Mage::getModel('shipperhq_shipper/carrier_backup');
|
1076 |
+
return $backupHandler->getBackupCarrierRates($this->_rawRequest, $lastCheck);
|
1077 |
}
|
1078 |
|
1079 |
/**
|
1113 |
|
1114 |
if (is_array($requestParams)) {
|
1115 |
$requestParams = implode(',', array_merge(
|
1116 |
+
array($this->getCarrierCode()),
|
1117 |
+
array_keys($requestParams),
|
1118 |
+
$requestParams)
|
1119 |
);
|
1120 |
|
1121 |
}
|
app/code/community/Shipperhq/Shipper/Model/Checkout/Helper.php
CHANGED
@@ -64,9 +64,15 @@ class Shipperhq_Shipper_Model_Checkout_Helper
|
|
64 |
->setCarrierType($foundRate->getCarrierType())
|
65 |
->setCarriergroupShippingDetails($encodedShipDetails)
|
66 |
->setCarriergroupShippingHtml(Mage::helper('shipperhq_shipper')->getCarriergroupShippingHtml(
|
67 |
-
$encodedShipDetails))
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
Mage::helper('shipperhq_shipper')->setShippingOnItems($shipDetails, $shippingAddress);
|
71 |
|
72 |
}
|
64 |
->setCarrierType($foundRate->getCarrierType())
|
65 |
->setCarriergroupShippingDetails($encodedShipDetails)
|
66 |
->setCarriergroupShippingHtml(Mage::helper('shipperhq_shipper')->getCarriergroupShippingHtml(
|
67 |
+
$encodedShipDetails));
|
68 |
+
foreach($shipDetails as $detail) {
|
69 |
+
//records destination type returned on rate - not type from address validation or user selection
|
70 |
+
if(isset($detail['destination_type'])) {
|
71 |
+
$shippingAddress->setDestinationType($detail['destination_type']);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
$shippingAddress->save();
|
76 |
Mage::helper('shipperhq_shipper')->setShippingOnItems($shipDetails, $shippingAddress);
|
77 |
|
78 |
}
|
app/code/community/Shipperhq/Shipper/Model/Observer.php
CHANGED
@@ -64,6 +64,23 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
64 |
}
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
/*
|
68 |
* Set renderer for dimensional shipping product attributes
|
69 |
*
|
@@ -154,6 +171,11 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
154 |
$quote = Mage::helper('shipperhq_shipper')->getQuote();
|
155 |
$quoteStorage = Mage::helper('shipperhq_shipper')->getQuoteStorage($quote);
|
156 |
$shipping = $quote->getShippingAddress();
|
|
|
|
|
|
|
|
|
|
|
157 |
$shipping->setIsCheckout(1);
|
158 |
$billing = $quote->getBillingAddress();
|
159 |
$billing->setIsCheckout(1);
|
@@ -161,15 +183,23 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
161 |
$quoteStorage->setSelectedDeliveryArray(null);
|
162 |
$quoteStorage->setPickupArray(null);
|
163 |
|
164 |
-
|
165 |
-
&& Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Splitrates')) {
|
166 |
-
// Mage::getSingleton('checkout/session')->setCarriergroupSelected(null);
|
167 |
-
$shipping->setCollectShippingRates(true);
|
168 |
-
}
|
169 |
}
|
170 |
|
171 |
public function saveOrderAfter($observer)
|
172 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
try
|
174 |
{
|
175 |
// $recordOrderPackages = Mage::helper('shipperhq_shipper')->recordOrderPackages();
|
@@ -177,55 +207,64 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
177 |
|
178 |
if ($recordOrderPackages)
|
179 |
{
|
180 |
-
$order = $observer->getOrder();
|
181 |
$quote = $order->getQuote();
|
182 |
|
183 |
$shippingAddress = $quote->getShippingAddress();
|
184 |
$orderId = $order->getId();
|
185 |
-
|
|
|
|
|
|
|
|
|
186 |
if(is_array($carrierGroupDetail)){
|
187 |
-
foreach($carrierGroupDetail as $
|
188 |
-
if(!isset($
|
189 |
continue;
|
190 |
}
|
191 |
-
$carrierGroupId = $
|
192 |
-
$carrier_code = $
|
193 |
-
$shippingMethodCode = $
|
194 |
-
$
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
}
|
200 |
-
|
201 |
-
|
202 |
-
$
|
203 |
-
|
204 |
-
->
|
205 |
-
|
206 |
-
|
207 |
-
->
|
208 |
-
|
209 |
-
->setSurchargePrice($box->getSurchargePrice())
|
210 |
-
->setItems($box->getItems());
|
211 |
-
$package->save();
|
212 |
-
}
|
213 |
-
if($recordOrderPackages && count($packagesColl) > 0)
|
214 |
-
{
|
215 |
-
$boxText = Mage::helper('shipperhq_shipper')->getPackageBreakdownText($packagesColl);
|
216 |
-
$order->addStatusToHistory($order->getStatus(), $boxText, false);
|
217 |
}
|
218 |
-
$order->addStatusToHistory($order->getStatus(), 'ShipperHQ Transaction ID: ' .$carrier_group->transaction, false);
|
219 |
-
$order->save();
|
220 |
|
|
|
|
|
|
|
221 |
}
|
222 |
-
}
|
223 |
-
else {
|
224 |
$shippingMethod = $order->getShippingMethod();
|
225 |
if($rate = $quote->getShippingAddress()->getShippingRateByCode($shippingMethod)) {
|
226 |
-
$packagesColl= Mage::
|
227 |
-
|
|
|
228 |
foreach ($packagesColl as $box) {
|
|
|
|
|
|
|
|
|
229 |
$package = Mage::getModel('shipperhq_shipper/order_packages');
|
230 |
$package->setOrderId($orderId);
|
231 |
$package->setLength($box->getLength())
|
@@ -235,10 +274,12 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
235 |
->setPackageName($box->getPackageName())
|
236 |
->setDeclaredValue($box->getDeclaredValue())
|
237 |
->setSurchargePrice($box->getSurchargePrice())
|
|
|
238 |
->setItems($box->getItems());
|
239 |
$package->save();
|
240 |
}
|
241 |
-
if(
|
|
|
242 |
{
|
243 |
$boxText = Mage::helper('shipperhq_shipper')->getPackageBreakdownText($packagesColl);
|
244 |
$order->addStatusToHistory($order->getStatus(), $boxText, false);
|
@@ -254,6 +295,21 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
254 |
}
|
255 |
}
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
/*
|
258 |
* Process admin shipping
|
259 |
*/
|
@@ -263,22 +319,23 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
263 |
$post = $observer->getRequestModel()->getPost();
|
264 |
if(isset($post['order'])) {
|
265 |
$data = $post['order'];
|
|
|
266 |
$found = false;
|
267 |
$customCarrierGroupData = array();
|
268 |
-
|
269 |
if (isset($data['shipping_amount'])) {
|
270 |
-
$customCarrierGroupData[
|
271 |
$found = true;
|
272 |
}
|
273 |
|
274 |
if (isset($data['shipping_description'])) {
|
275 |
-
if(array_key_exists(
|
276 |
-
$shipArray = $customCarrierGroupData[
|
277 |
$shipArray['customCarrier'] = $data['shipping_description'];
|
278 |
-
$customCarrierGroupData[
|
279 |
}
|
280 |
else {
|
281 |
-
$customCarrierGroupData[
|
282 |
}
|
283 |
$found = true;
|
284 |
}
|
@@ -320,7 +377,7 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
320 |
{
|
321 |
return Mage::getSingleton('checkout/session');
|
322 |
}
|
323 |
-
|
324 |
public function setCurrentQuoteObjectInAdmin(Varien_Event_Observer $observer)
|
325 |
{
|
326 |
Mage::helper('shipperhq_shipper')->setQuote(
|
@@ -340,7 +397,7 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
340 |
$request = $observer->getRequestModel();
|
341 |
if ($request->getActionName() === 'save') {
|
342 |
$orderData = $request->getPost('order');
|
343 |
-
|
344 |
if (isset($orderData['shipping_address'])) {
|
345 |
unset($orderData['shipping_address']);
|
346 |
}
|
@@ -348,7 +405,7 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
348 |
if (isset($orderData['billing_address'])) {
|
349 |
unset($orderData['billing_address']);
|
350 |
}
|
351 |
-
|
352 |
if (isset($orderData['shipping_method'])) {
|
353 |
unset($orderData['shipping_method']);
|
354 |
}
|
@@ -356,13 +413,13 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
356 |
$request->setPost('order', $orderData);
|
357 |
$request->setPost('shipping_as_billing', 0);
|
358 |
}
|
359 |
-
|
360 |
Mage::helper('shipperhq_shipper')->setQuote($observer->getOrderCreateModel()->getQuote());
|
361 |
}
|
362 |
|
363 |
/**
|
364 |
* Loads storage data for quote if it was not loaded
|
365 |
-
*
|
366 |
* @param Varien_Event_Observer $observer
|
367 |
*/
|
368 |
public function onQuoteAfterLoad(Varien_Event_Observer $observer)
|
@@ -372,8 +429,8 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
372 |
}
|
373 |
|
374 |
/**
|
375 |
-
* Saves storage data if quote is saved
|
376 |
-
*
|
377 |
* @param Varien_Event_Observer $observer
|
378 |
* @return $this
|
379 |
* @throws Exception
|
@@ -387,10 +444,10 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
387 |
}
|
388 |
|
389 |
/**
|
390 |
-
* Saves modified data objects on post dispatch,
|
391 |
* if modifications has been done after quote has been saved
|
392 |
-
*
|
393 |
-
*
|
394 |
*/
|
395 |
public function onPostDispatch()
|
396 |
{
|
@@ -402,10 +459,44 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
402 |
}
|
403 |
}
|
404 |
}
|
405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
/**
|
407 |
* Saves storage instance
|
408 |
-
*
|
409 |
* @param Shipperhq_Shipper_Model_Storage $storage
|
410 |
* @return $this
|
411 |
* @throws Exception
|
@@ -426,14 +517,14 @@ class Shipperhq_Shipper_Model_Observer extends Mage_Core_Model_Abstract
|
|
426 |
if (!$storage->isValid(true)) {
|
427 |
return $this;
|
428 |
}
|
429 |
-
|
430 |
try {
|
431 |
$storage->save();
|
432 |
} catch (Exception $e) {
|
433 |
Mage::logException($e);
|
434 |
// Do not break quote save process
|
435 |
}
|
436 |
-
|
437 |
return $this;
|
438 |
}
|
439 |
}
|
64 |
}
|
65 |
}
|
66 |
|
67 |
+
public function oscUpdateCart($observer)
|
68 |
+
{
|
69 |
+
$body = $observer->getControllerAction()->getResponse()->getBody();
|
70 |
+
$decodedBody = json_decode($body);
|
71 |
+
|
72 |
+
$shqMethodHtml = Mage::app()->getLayout()
|
73 |
+
->createBlock('shipperhq_pickup/checkout_onepage_shipping_method_available')
|
74 |
+
->setTemplate('shipperhq/checkout/onestepcheckout/shipping_method_osc_shq_radio.phtml')
|
75 |
+
->toHtml();
|
76 |
+
|
77 |
+
$decodedBody->shipping_method = $shqMethodHtml;
|
78 |
+
|
79 |
+
$encodedBody = json_encode($decodedBody);
|
80 |
+
|
81 |
+
$observer->getControllerAction()->getResponse()->setBody($encodedBody);
|
82 |
+
}
|
83 |
+
|
84 |
/*
|
85 |
* Set renderer for dimensional shipping product attributes
|
86 |
*
|
171 |
$quote = Mage::helper('shipperhq_shipper')->getQuote();
|
172 |
$quoteStorage = Mage::helper('shipperhq_shipper')->getQuoteStorage($quote);
|
173 |
$shipping = $quote->getShippingAddress();
|
174 |
+
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Shipper', 'carriers/shipper/active')
|
175 |
+
&& Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Splitrates')
|
176 |
+
&& !$shipping->getIsCheckout()) {
|
177 |
+
$shipping->setCollectShippingRates(true);
|
178 |
+
} //SHQ16-1134
|
179 |
$shipping->setIsCheckout(1);
|
180 |
$billing = $quote->getBillingAddress();
|
181 |
$billing->setIsCheckout(1);
|
183 |
$quoteStorage->setSelectedDeliveryArray(null);
|
184 |
$quoteStorage->setPickupArray(null);
|
185 |
|
186 |
+
|
|
|
|
|
|
|
|
|
187 |
}
|
188 |
|
189 |
public function saveOrderAfter($observer)
|
190 |
{
|
191 |
+
$order = $observer->getOrder();
|
192 |
+
$shippingMethod = $order->getShippingMethod();
|
193 |
+
|
194 |
+
if(substr($shippingMethod, 0, 3) != "shq" && substr($shippingMethod,0,8) != "shipper_") {//SHQ16-1932
|
195 |
+
$this->removeShqDetailsFromOrder($order);
|
196 |
+
}
|
197 |
+
|
198 |
+
if(Mage::getStoreConfig('carriers/shipper/active'))
|
199 |
+
{
|
200 |
+
$this->processSharedCarrier($order);
|
201 |
+
}
|
202 |
+
|
203 |
try
|
204 |
{
|
205 |
// $recordOrderPackages = Mage::helper('shipperhq_shipper')->recordOrderPackages();
|
207 |
|
208 |
if ($recordOrderPackages)
|
209 |
{
|
|
|
210 |
$quote = $order->getQuote();
|
211 |
|
212 |
$shippingAddress = $quote->getShippingAddress();
|
213 |
$orderId = $order->getId();
|
214 |
+
if(is_null($orderId)) {
|
215 |
+
return;
|
216 |
+
}
|
217 |
+
$carrierGroupDetail = Mage::helper('shipperhq_shipper')->decodeShippingDetails(
|
218 |
+
$shippingAddress->getCarriergroupShippingDetails());
|
219 |
if(is_array($carrierGroupDetail)){
|
220 |
+
foreach($carrierGroupDetail as $carrierGroup) {
|
221 |
+
if(!isset($carrierGroup['carrierGroupId'])) {
|
222 |
continue;
|
223 |
}
|
224 |
+
$carrierGroupId = $carrierGroup['carrierGroupId'];
|
225 |
+
$carrier_code = $carrierGroup['carrier_code'];
|
226 |
+
$shippingMethodCode = $carrierGroup['code'];
|
227 |
+
$sessionPackages = Mage::helper('shipperhq_shipper')->loadSessionPackagesByCarrier($shippingAddress->getAddressId(),
|
228 |
+
$carrierGroupId, $carrier_code, $shippingMethodCode);
|
229 |
+
|
230 |
+
foreach ($sessionPackages as $box) {
|
231 |
+
|
232 |
+
$quotePackage = Mage::getModel('shipperhq_shipper/quote_packages');
|
233 |
+
$quotePackage->setData($box);
|
234 |
+
$quotePackage->save();
|
235 |
+
|
236 |
+
$orderPackage = Mage::getModel('shipperhq_shipper/order_packages');
|
237 |
+
unset($box['address_id']);
|
238 |
+
$orderPackage->setData($box);
|
239 |
+
$orderPackage->setOrderId($orderId);
|
240 |
+
$orderPackage->save();
|
241 |
}
|
242 |
+
|
243 |
+
if (Mage::helper('shipperhq_shipper')->storeDimComments()) {
|
244 |
+
if ($recordOrderPackages && count($sessionPackages) > 0) {
|
245 |
+
$boxText = Mage::helper('shipperhq_shipper')->getPackageBreakdownText($sessionPackages, $carrierGroup['name']);
|
246 |
+
$order->addStatusToHistory($order->getStatus(), $boxText, false);
|
247 |
+
|
248 |
+
$carrierGroupText = strip_tags($order->getCarriergroupShippingHtml(), "<br><b><strong>");
|
249 |
+
$order->addStatusToHistory($order->getStatus(), $carrierGroupText, false);
|
250 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
}
|
|
|
|
|
252 |
|
253 |
+
//SHIPPERHQ-1635
|
254 |
+
$order->addStatusToHistory($order->getStatus(), 'ShipperHQ Transaction ID: ' . $carrierGroup['transaction'], false);
|
255 |
+
$order->save();
|
256 |
}
|
257 |
+
} else {
|
|
|
258 |
$shippingMethod = $order->getShippingMethod();
|
259 |
if($rate = $quote->getShippingAddress()->getShippingRateByCode($shippingMethod)) {
|
260 |
+
$packagesColl = Mage::helper('shipperhq_shipper')->loadSessionPackagesByCarrier($shippingAddress->getAddressId(),
|
261 |
+
null, $rate->getCarrier(), '');
|
262 |
+
|
263 |
foreach ($packagesColl as $box) {
|
264 |
+
$quotePackage = Mage::getModel('shipperhq_shipper/quote_packages');
|
265 |
+
$quotePackage->setData($box);
|
266 |
+
$quotePackage->save();
|
267 |
+
|
268 |
$package = Mage::getModel('shipperhq_shipper/order_packages');
|
269 |
$package->setOrderId($orderId);
|
270 |
$package->setLength($box->getLength())
|
274 |
->setPackageName($box->getPackageName())
|
275 |
->setDeclaredValue($box->getDeclaredValue())
|
276 |
->setSurchargePrice($box->getSurchargePrice())
|
277 |
+
->setCarrierGroupId($box->getCarrierGroupId())
|
278 |
->setItems($box->getItems());
|
279 |
$package->save();
|
280 |
}
|
281 |
+
if(Mage::helper('shipperhq_shipper')->storeDimComments() &&
|
282 |
+
$recordOrderPackages && count($packagesColl) > 0)
|
283 |
{
|
284 |
$boxText = Mage::helper('shipperhq_shipper')->getPackageBreakdownText($packagesColl);
|
285 |
$order->addStatusToHistory($order->getStatus(), $boxText, false);
|
295 |
}
|
296 |
}
|
297 |
|
298 |
+
/**
|
299 |
+
* Called when shipping method is not from SHQ
|
300 |
+
* Will remove SHQ elements from order to stop them being displayed
|
301 |
+
*
|
302 |
+
* @param $order
|
303 |
+
*/
|
304 |
+
protected function removeShqDetailsFromOrder($order)
|
305 |
+
{
|
306 |
+
$order->setDispatchDate(null);
|
307 |
+
$order->setDeliveryDate(null);
|
308 |
+
$order->setCarriergroupShippingDetails(null);
|
309 |
+
$order->setCarriergroupShippingHtml(null);
|
310 |
+
$order->save();
|
311 |
+
}
|
312 |
+
|
313 |
/*
|
314 |
* Process admin shipping
|
315 |
*/
|
319 |
$post = $observer->getRequestModel()->getPost();
|
320 |
if(isset($post['order'])) {
|
321 |
$data = $post['order'];
|
322 |
+
|
323 |
$found = false;
|
324 |
$customCarrierGroupData = array();
|
325 |
+
$carriergroupId = isset($data['carriergroup_id']) ? $data['carriergroup_id'] : '';
|
326 |
if (isset($data['shipping_amount'])) {
|
327 |
+
$customCarrierGroupData[$carriergroupId] = array('customPrice' => $data['shipping_amount'], 'carriergroup' => $carriergroupId);
|
328 |
$found = true;
|
329 |
}
|
330 |
|
331 |
if (isset($data['shipping_description'])) {
|
332 |
+
if(array_key_exists($carriergroupId, $customCarrierGroupData)) {
|
333 |
+
$shipArray = $customCarrierGroupData[$carriergroupId];
|
334 |
$shipArray['customCarrier'] = $data['shipping_description'];
|
335 |
+
$customCarrierGroupData[$carriergroupId] = $shipArray;
|
336 |
}
|
337 |
else {
|
338 |
+
$customCarrierGroupData[$carriergroupId] = array('customCarrier' => $data['shipping_description'], 'carriergroup' => $carriergroupId);
|
339 |
}
|
340 |
$found = true;
|
341 |
}
|
377 |
{
|
378 |
return Mage::getSingleton('checkout/session');
|
379 |
}
|
380 |
+
|
381 |
public function setCurrentQuoteObjectInAdmin(Varien_Event_Observer $observer)
|
382 |
{
|
383 |
Mage::helper('shipperhq_shipper')->setQuote(
|
397 |
$request = $observer->getRequestModel();
|
398 |
if ($request->getActionName() === 'save') {
|
399 |
$orderData = $request->getPost('order');
|
400 |
+
|
401 |
if (isset($orderData['shipping_address'])) {
|
402 |
unset($orderData['shipping_address']);
|
403 |
}
|
405 |
if (isset($orderData['billing_address'])) {
|
406 |
unset($orderData['billing_address']);
|
407 |
}
|
408 |
+
|
409 |
if (isset($orderData['shipping_method'])) {
|
410 |
unset($orderData['shipping_method']);
|
411 |
}
|
413 |
$request->setPost('order', $orderData);
|
414 |
$request->setPost('shipping_as_billing', 0);
|
415 |
}
|
416 |
+
|
417 |
Mage::helper('shipperhq_shipper')->setQuote($observer->getOrderCreateModel()->getQuote());
|
418 |
}
|
419 |
|
420 |
/**
|
421 |
* Loads storage data for quote if it was not loaded
|
422 |
+
*
|
423 |
* @param Varien_Event_Observer $observer
|
424 |
*/
|
425 |
public function onQuoteAfterLoad(Varien_Event_Observer $observer)
|
429 |
}
|
430 |
|
431 |
/**
|
432 |
+
* Saves storage data if quote is saved
|
433 |
+
*
|
434 |
* @param Varien_Event_Observer $observer
|
435 |
* @return $this
|
436 |
* @throws Exception
|
444 |
}
|
445 |
|
446 |
/**
|
447 |
+
* Saves modified data objects on post dispatch,
|
448 |
* if modifications has been done after quote has been saved
|
449 |
+
*
|
450 |
+
*
|
451 |
*/
|
452 |
public function onPostDispatch()
|
453 |
{
|
459 |
}
|
460 |
}
|
461 |
}
|
462 |
+
|
463 |
+
protected function processSharedCarrier($order)
|
464 |
+
{
|
465 |
+
if(strstr($order->getCarrierType(), 'shqshared_')) {
|
466 |
+
$original = $order->getCarrierType();
|
467 |
+
$carrierTypeArray = explode('_', $order->getCarrierType());
|
468 |
+
|
469 |
+
if(is_array($carrierTypeArray)) {
|
470 |
+
$order->setCarrierType($carrierTypeArray[1]);
|
471 |
+
//SHQ16-1026
|
472 |
+
$carrierGroupDetail = $order->getCarriergroupShippingDetails();
|
473 |
+
$currentShipDescription = $order->getShippingDescription();
|
474 |
+
$shipDescriptionArray = explode('-', $currentShipDescription);
|
475 |
+
$cgArray = Mage::helper('shipperhq_shipper')->decodeShippingDetails($carrierGroupDetail);
|
476 |
+
foreach($cgArray as $key => $cgDetail) {
|
477 |
+
if(isset($cgDetail['carrierType']) && $cgDetail['carrierType'] == $original) {
|
478 |
+
$cgDetail['carrierType'] = $carrierTypeArray[1];
|
479 |
+
}
|
480 |
+
if(is_array($shipDescriptionArray) && isset($cgDetail['carrierTitle'])) {
|
481 |
+
$shipDescriptionArray[0] = $cgDetail['carrierTitle'] .' ';
|
482 |
+
$newShipDescription = implode('-', $shipDescriptionArray);
|
483 |
+
$order->setShippingDescription($newShipDescription);
|
484 |
+
}
|
485 |
+
$cgArray[$key] = $cgDetail;
|
486 |
+
}
|
487 |
+
$order->setCarriergroupShippingDetails(Mage::helper('shipperhq_shipper')->encodeShippingDetails($cgArray));
|
488 |
+
$order->save();
|
489 |
+
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
490 |
+
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Rates displayed as single carrier',
|
491 |
+
'Resetting carrier type on order to be ' .$carrierTypeArray[1]);
|
492 |
+
}
|
493 |
+
}
|
494 |
+
}
|
495 |
+
}
|
496 |
+
|
497 |
/**
|
498 |
* Saves storage instance
|
499 |
+
*
|
500 |
* @param Shipperhq_Shipper_Model_Storage $storage
|
501 |
* @return $this
|
502 |
* @throws Exception
|
517 |
if (!$storage->isValid(true)) {
|
518 |
return $this;
|
519 |
}
|
520 |
+
|
521 |
try {
|
522 |
$storage->save();
|
523 |
} catch (Exception $e) {
|
524 |
Mage::logException($e);
|
525 |
// Do not break quote save process
|
526 |
}
|
527 |
+
|
528 |
return $this;
|
529 |
}
|
530 |
}
|
app/code/community/Shipperhq/Shipper/Model/Observer/Order.php
CHANGED
@@ -52,6 +52,11 @@ class Shipperhq_Shipper_Model_Observer_Order extends Mage_Core_Model_Abstract
|
|
52 |
$quote = $observer->getEvent()->getQuote();
|
53 |
$helper = Mage::getSingleton('shipperhq_shipper/checkout_helper');
|
54 |
$helper->saveSingleShippingMethod($quote->getShippingAddress(), $shippingMethod);
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
$rate = $quote->getShippingAddress()->getShippingRateByCode($shippingMethod);
|
57 |
if(!$rate) {
|
@@ -62,6 +67,12 @@ class Shipperhq_Shipper_Model_Observer_Order extends Mage_Core_Model_Abstract
|
|
62 |
return;
|
63 |
}
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Pbint') &&
|
66 |
Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Shipper', 'carriers/shipper/active')) {
|
67 |
$quote = $observer->getQuote();
|
@@ -81,7 +92,6 @@ class Shipperhq_Shipper_Model_Observer_Order extends Mage_Core_Model_Abstract
|
|
81 |
return;
|
82 |
}
|
83 |
}
|
84 |
-
|
85 |
}
|
86 |
|
87 |
/*
|
@@ -309,6 +319,7 @@ class Shipperhq_Shipper_Model_Observer_Order extends Mage_Core_Model_Abstract
|
|
309 |
|
310 |
protected function confirmOrder($order)
|
311 |
{
|
|
|
312 |
$confirm = false;
|
313 |
$customOrderId = null;
|
314 |
$pitney = false;
|
@@ -360,17 +371,6 @@ class Shipperhq_Shipper_Model_Observer_Order extends Mage_Core_Model_Abstract
|
|
360 |
}
|
361 |
|
362 |
}
|
363 |
-
if(strstr($order->getCarrierType(), 'shqshared_')) {
|
364 |
-
$carrierTypeArray = explode('_', $order->getCarrierType());
|
365 |
-
if(is_array($carrierTypeArray)) {
|
366 |
-
$order->setCarrierType($carrierTypeArray[1]);
|
367 |
-
$order->save();
|
368 |
-
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
369 |
-
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Rates displayed as single carrier',
|
370 |
-
'Resetting carrier type on order to be ' .$carrierTypeArray[1]);
|
371 |
-
}
|
372 |
-
}
|
373 |
-
}
|
374 |
}
|
375 |
|
376 |
protected function reserveOrder($helper, $address, $carrierCode, $carriergroupId)
|
52 |
$quote = $observer->getEvent()->getQuote();
|
53 |
$helper = Mage::getSingleton('shipperhq_shipper/checkout_helper');
|
54 |
$helper->saveSingleShippingMethod($quote->getShippingAddress(), $shippingMethod);
|
55 |
+
$params = $observer->getEvent()->getRequest()->getParams();
|
56 |
+
Mage::dispatchEvent('shipperhq_save_shipping_method',
|
57 |
+
array('shipping_address'=>$quote->getShippingAddress(),
|
58 |
+
'shipping_method' => $shippingMethod,
|
59 |
+
'params' => $params));
|
60 |
|
61 |
$rate = $quote->getShippingAddress()->getShippingRateByCode($shippingMethod);
|
62 |
if(!$rate) {
|
67 |
return;
|
68 |
}
|
69 |
|
70 |
+
$deliveryComments = $request->getPost('delivery_comments', '');
|
71 |
+
|
72 |
+
if(!empty($deliveryComments)) {
|
73 |
+
$quote->getShippingAddress()->setShqDeliveryComments($deliveryComments);
|
74 |
+
}
|
75 |
+
|
76 |
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Pbint') &&
|
77 |
Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Shipper', 'carriers/shipper/active')) {
|
78 |
$quote = $observer->getQuote();
|
92 |
return;
|
93 |
}
|
94 |
}
|
|
|
95 |
}
|
96 |
|
97 |
/*
|
319 |
|
320 |
protected function confirmOrder($order)
|
321 |
{
|
322 |
+
|
323 |
$confirm = false;
|
324 |
$customOrderId = null;
|
325 |
$pitney = false;
|
371 |
}
|
372 |
|
373 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
}
|
375 |
|
376 |
protected function reserveOrder($helper, $address, $carrierCode, $carriergroupId)
|
app/code/community/Shipperhq/Shipper/Model/Resource/Order/Packages.php
CHANGED
@@ -57,11 +57,12 @@ class Shipperhq_Shipper_Model_Resource_Order_Packages extends Mage_Core_Model_My
|
|
57 |
$condition = $this->_getWriteAdapter()->quoteInto('package_id = ?', $object->getId());
|
58 |
$this->_getWriteAdapter()->delete($this->getTable('order_package_items'), $condition);
|
59 |
foreach ($object->getData('items') as $item) {
|
|
|
60 |
$itemInsert = new Varien_Object();
|
61 |
$itemInsert->setData('package_id',$object->getId());
|
62 |
$itemInsert->setSku($item['sku']);
|
63 |
-
$itemInsert->setWeightPacked($item['
|
64 |
-
$itemInsert->setQtyPacked($item['
|
65 |
$this->_getWriteAdapter()->insert($this->getTable('order_package_items'), $itemInsert->getData());
|
66 |
}
|
67 |
$this->_getWriteAdapter()->commit();
|
57 |
$condition = $this->_getWriteAdapter()->quoteInto('package_id = ?', $object->getId());
|
58 |
$this->_getWriteAdapter()->delete($this->getTable('order_package_items'), $condition);
|
59 |
foreach ($object->getData('items') as $item) {
|
60 |
+
|
61 |
$itemInsert = new Varien_Object();
|
62 |
$itemInsert->setData('package_id',$object->getId());
|
63 |
$itemInsert->setSku($item['sku']);
|
64 |
+
$itemInsert->setWeightPacked($item['weightPacked']);
|
65 |
+
$itemInsert->setQtyPacked($item['qtyPacked']);
|
66 |
$this->_getWriteAdapter()->insert($this->getTable('order_package_items'), $itemInsert->getData());
|
67 |
}
|
68 |
$this->_getWriteAdapter()->commit();
|
app/code/community/Shipperhq/Shipper/Model/Resource/Quote/Packages.php
CHANGED
@@ -57,11 +57,12 @@ class Shipperhq_Shipper_Model_Resource_Quote_Packages extends Mage_Core_Model_My
|
|
57 |
$condition = $this->_getWriteAdapter()->quoteInto('package_id = ?', $object->getId());
|
58 |
$this->_getWriteAdapter()->delete($this->getTable('quote_package_items'), $condition);
|
59 |
foreach ($object->getData('items') as $item) {
|
|
|
60 |
$itemInsert = new Varien_Object();
|
61 |
$itemInsert->setData('package_id',$object->getId());
|
62 |
-
$itemInsert->setSku($item->sku);
|
63 |
-
$itemInsert->setWeightPacked($item->weightPacked);
|
64 |
-
$itemInsert->setQtyPacked($item->qtyPacked);
|
65 |
$this->_getWriteAdapter()->insert($this->getTable('quote_package_items'), $itemInsert->getData());
|
66 |
}
|
67 |
$this->_getWriteAdapter()->commit();
|
57 |
$condition = $this->_getWriteAdapter()->quoteInto('package_id = ?', $object->getId());
|
58 |
$this->_getWriteAdapter()->delete($this->getTable('quote_package_items'), $condition);
|
59 |
foreach ($object->getData('items') as $item) {
|
60 |
+
$item = (array)$item;
|
61 |
$itemInsert = new Varien_Object();
|
62 |
$itemInsert->setData('package_id',$object->getId());
|
63 |
+
$itemInsert->setSku($item['sku']);//$itemInsert->setSku($item->sku);
|
64 |
+
$itemInsert->setWeightPacked($item['weightPacked']);//$itemInsert->setWeightPacked($item->weightPacked);
|
65 |
+
$itemInsert->setQtyPacked($item['qtyPacked']);//$itemInsert->setQtyPacked($item->qtyPacked);
|
66 |
$this->_getWriteAdapter()->insert($this->getTable('quote_package_items'), $itemInsert->getData());
|
67 |
}
|
68 |
$this->_getWriteAdapter()->commit();
|
app/code/community/Shipperhq/Shipper/Model/Sales/Quote/Address/Rate.php
CHANGED
@@ -63,11 +63,9 @@ class Shipperhq_Shipper_Model_Sales_Quote_Address_Rate extends Mage_Sales_Model_
|
|
63 |
->setFreightRate($rate->getFreightRate())
|
64 |
->setCustomDescription($rate->getCustomDescription())
|
65 |
->setCarrierId($rate->getCarrierId())
|
66 |
-
->setCustomDuties($rate->getCustomDuties())
|
67 |
-
|
68 |
-
;
|
69 |
}
|
70 |
return $this;
|
71 |
}
|
72 |
-
|
73 |
}
|
63 |
->setFreightRate($rate->getFreightRate())
|
64 |
->setCustomDescription($rate->getCustomDescription())
|
65 |
->setCarrierId($rate->getCarrierId())
|
66 |
+
->setCustomDuties($rate->getCustomDuties())
|
67 |
+
->setTooltip($rate->getTooltip());
|
|
|
68 |
}
|
69 |
return $this;
|
70 |
}
|
|
|
71 |
}
|
app/code/community/Shipperhq/Shipper/Model/Source/Freight/Freightclass.php
CHANGED
@@ -70,4 +70,24 @@ class Shipperhq_Shipper_Model_Source_Freight_Freightclass extends Mage_Eav_Model
|
|
70 |
array_unshift($arr, array('value'=>'', 'label'=>Mage::helper('shipping')->__('--- Use Default ---')));
|
71 |
return $arr;
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
70 |
array_unshift($arr, array('value'=>'', 'label'=>Mage::helper('shipping')->__('--- Use Default ---')));
|
71 |
return $arr;
|
72 |
}
|
73 |
+
|
74 |
+
public function getFlatColums()
|
75 |
+
{
|
76 |
+
$columns = array(
|
77 |
+
$this->getAttribute()->getAttributeCode() => array(
|
78 |
+
'type' => 'int',
|
79 |
+
'unsigned' => false,
|
80 |
+
'is_null' => true,
|
81 |
+
'default' => null,
|
82 |
+
'extra' => null
|
83 |
+
)
|
84 |
+
);
|
85 |
+
return $columns;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getFlatUpdateSelect($store)
|
89 |
+
{
|
90 |
+
return Mage::getResourceModel('eav/entity_attribute')
|
91 |
+
->getFlatUpdateSelect($this->getAttribute(), $store);
|
92 |
+
}
|
93 |
}
|
app/code/community/Shipperhq/Shipper/Model/Synchronize.php
CHANGED
@@ -78,6 +78,7 @@ class Shipperhq_Shipper_Model_Synchronize extends Mage_Core_Model_Abstract
|
|
78 |
$updateData = $this->_compareAttributeData($latestAttributes);
|
79 |
$updateResult = $this->_updateAll($updateData);
|
80 |
$result['result'] = $updateResult;
|
|
|
81 |
}
|
82 |
else{
|
83 |
$result['error']
|
@@ -87,8 +88,9 @@ class Shipperhq_Shipper_Model_Synchronize extends Mage_Core_Model_Abstract
|
|
87 |
return $result;
|
88 |
}
|
89 |
|
90 |
-
public function checkSynchStatus()
|
91 |
{
|
|
|
92 |
if(Mage::getStoreConfig('carriers/shipper/active')) {
|
93 |
|
94 |
$synchCheckUrl = Mage::helper('shipperhq_shipper')->getCheckSynchronizedUrl();
|
@@ -120,10 +122,15 @@ class Shipperhq_Shipper_Model_Synchronize extends Mage_Core_Model_Abstract
|
|
120 |
}
|
121 |
return false;
|
122 |
}
|
123 |
-
|
124 |
-
$
|
125 |
-
|
|
|
|
|
|
|
126 |
}
|
|
|
|
|
127 |
}
|
128 |
|
129 |
/**
|
@@ -259,10 +266,10 @@ class Shipperhq_Shipper_Model_Synchronize extends Mage_Core_Model_Abstract
|
|
259 |
$storeId = '';
|
260 |
//AUTO_REMOVE_ATTRIBUTE_OPTION
|
261 |
foreach($trackValues as $key => $option) {
|
262 |
-
$
|
263 |
-
$attribute->code, $option['value'],
|
264 |
$deleteFlag = self::AUTO_REMOVE_ATTRIBUTE_OPTION;
|
265 |
-
if($
|
266 |
$deleteFlag = self::REMOVE_ATTRIBUTE_OPTION;
|
267 |
}
|
268 |
|
@@ -344,6 +351,7 @@ class Shipperhq_Shipper_Model_Synchronize extends Mage_Core_Model_Abstract
|
|
344 |
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Saving synch data',
|
345 |
'No attribute changes required, 0 rows saved');
|
346 |
}
|
|
|
347 |
return $result;
|
348 |
}
|
349 |
|
@@ -355,6 +363,7 @@ class Shipperhq_Shipper_Model_Synchronize extends Mage_Core_Model_Abstract
|
|
355 |
$newUpdate->clearInstance();
|
356 |
$result++;
|
357 |
}
|
|
|
358 |
return $result;
|
359 |
|
360 |
}
|
@@ -417,15 +426,7 @@ class Shipperhq_Shipper_Model_Synchronize extends Mage_Core_Model_Abstract
|
|
417 |
|
418 |
|
419 |
if ($result >= 0) {
|
420 |
-
$
|
421 |
-
$timeout = Mage::helper('shipperhq_shipper')->getWebserviceTimeout();
|
422 |
-
$shipperMapper = $this->_getShipperMapper();
|
423 |
-
$request = $shipperMapper->getCredentialsTranslation();
|
424 |
-
$setSynchResult = $this->_getShipperInstance()->sendAndReceive($request, $synchSetUrl, $timeout);
|
425 |
-
if (Mage::helper('shipperhq_shipper')->isDebug()) {
|
426 |
-
Mage::helper('wsalogger/log')->postInfo('Shipperhq_Shipper', 'Setting synchronized status: ',
|
427 |
-
$setSynchResult['result']);
|
428 |
-
}
|
429 |
}
|
430 |
return $result;
|
431 |
}
|
78 |
$updateData = $this->_compareAttributeData($latestAttributes);
|
79 |
$updateResult = $this->_updateAll($updateData);
|
80 |
$result['result'] = $updateResult;
|
81 |
+
Mage::getSingleton('adminhtml/session')->setAlreadySynched('not_required');
|
82 |
}
|
83 |
else{
|
84 |
$result['error']
|
88 |
return $result;
|
89 |
}
|
90 |
|
91 |
+
public function checkSynchStatus($saveTime = false)
|
92 |
{
|
93 |
+
$result = false;
|
94 |
if(Mage::getStoreConfig('carriers/shipper/active')) {
|
95 |
|
96 |
$synchCheckUrl = Mage::helper('shipperhq_shipper')->getCheckSynchronizedUrl();
|
122 |
}
|
123 |
return false;
|
124 |
}
|
125 |
+
$currentVal = Mage::getStoreConfig(Shipperhq_Shipper_Helper_Data::SHIPPERHQ_LAST_SYNC);
|
126 |
+
$latestSync = $synchResult->lastSynchronization;
|
127 |
+
$result = $latestSync == $currentVal ? '1' : "Required";
|
128 |
+
if($saveTime) {
|
129 |
+
Mage::helper('shipperhq_shipper')->saveConfig(Shipperhq_Shipper_Helper_Data::SHIPPERHQ_LAST_SYNC, $latestSync, 'default', 0, false);
|
130 |
+
}
|
131 |
}
|
132 |
+
return $result;
|
133 |
+
|
134 |
}
|
135 |
|
136 |
/**
|
266 |
$storeId = '';
|
267 |
//AUTO_REMOVE_ATTRIBUTE_OPTION
|
268 |
foreach($trackValues as $key => $option) {
|
269 |
+
$isAssigned = Mage::helper('shipperhq_shipper')->getIsAttributeValueUsed(
|
270 |
+
$attribute->code, $option['value'], true);
|
271 |
$deleteFlag = self::AUTO_REMOVE_ATTRIBUTE_OPTION;
|
272 |
+
if($isAssigned) {
|
273 |
$deleteFlag = self::REMOVE_ATTRIBUTE_OPTION;
|
274 |
}
|
275 |
|
351 |
Mage::helper('wsalogger/log')->postDebug('Shipperhq_Shipper', 'Saving synch data',
|
352 |
'No attribute changes required, 0 rows saved');
|
353 |
}
|
354 |
+
$this->checkSynchStatus(true);
|
355 |
return $result;
|
356 |
}
|
357 |
|
363 |
$newUpdate->clearInstance();
|
364 |
$result++;
|
365 |
}
|
366 |
+
|
367 |
return $result;
|
368 |
|
369 |
}
|
426 |
|
427 |
|
428 |
if ($result >= 0) {
|
429 |
+
$this->checkSynchStatus(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
}
|
431 |
return $result;
|
432 |
}
|
app/code/community/Shipperhq/Shipper/changelog.txt
CHANGED
@@ -80,3 +80,96 @@
|
|
80 |
|
81 |
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
|
82 |
|
83 |
+
2.58 -SHQ16-556
|
84 |
+
2.58 -SHQ16-556
|
85 |
+
2.59 -SHQ16-673
|
86 |
+
2.60 - Removed module from extension
|
87 |
+
2.61 - SHQ16-720 bundle display resolved in my orders page
|
88 |
+
2.62 - SHIPPERHQ-1855 item weight set to 0 when null, SHQ16-699 handle item id null
|
89 |
+
2.63 - SHQ16-98 availability date support
|
90 |
+
2.64 - SHQ16-699 item id check support on multi address checkout
|
91 |
+
2.65 - SHQ16-865 - Add ability to switch off shipments being displayed in comments. Added ability to switch off order comments
|
92 |
+
2.66 - Fixed issue with pickup address not saving to shipping address
|
93 |
+
2.67 - Fixed issue with pickup address not saving to shipping address
|
94 |
+
2.68 - SHQ16-825 persist carrier group id on custom admin rates
|
95 |
+
2.69 - SHQ16-796 shipping method display with span tags
|
96 |
+
2.70 - SHQ16-296 SQL update to fix warehouse attribute after update from WSA
|
97 |
+
2.71 - Fixed issue with address validation dialog box on checkout.
|
98 |
+
2.72 - SHQ16-950 altered allowed methods web service call logic
|
99 |
+
2.73 - SHQ16-959 sync mechanism uses last synchronization date
|
100 |
+
2.74 - SHQ16-906 Delivery comments at checkout
|
101 |
+
2.75 - SHQ16-1008 Added shipperhq_location to variables being passed across
|
102 |
+
2.76 - SHQ16-1026 modify display on order for single carrier list rates
|
103 |
+
2.77 - SHQ16-1078 Fixed issue with fatal error on multiaddress checkout when no rates returned
|
104 |
+
2.78 - SHQ16-1041 Carrier group detail decoding, SHQ16-1088 remove price sorting
|
105 |
+
2.79 - SHQ16-1113 Remove unsafe characters from shipping description on order item display, SHQ16-1121 Remove explicit size on datepicker widget
|
106 |
+
2.80 - SHQ16-1118 Reset rate delivery date in carrier group details
|
107 |
+
2.81 - SHQ16-994
|
108 |
+
2.82 - SHQ16-994 tooltip on custom rates, SHQ16-1134 OSC index observer changes, SHQ16-1139 translation of error message in javascript, log json request
|
109 |
+
2.83 - SHQ16-1098 Translate store pickup headings, SHQ16-1066 reformat getAllMethods for ShipperHQ carriers, SHQ16-1085 clean up cart in ShipperLib, SHQ16-1123 Resolve sort order of 0
|
110 |
+
2.84 - SHQ16-1158 Fixed SQL upgrade script
|
111 |
+
2.85 - SHQ16-1163 Fixed issue with configurable product rendering in admin sales order view
|
112 |
+
2.86 - SHQ16-1146
|
113 |
+
2.87 - SHQ16-1181 Add support for OneStepCheckout Comments and update OSC rewrite to OSC v4.5.5
|
114 |
+
2.88 - SHQ16-1237 Resolved issue with blackout days shifting one day back
|
115 |
+
2.89 - SHQ16-1237 Further work on blackout days. Resolves issues with blackout days being +/- one day
|
116 |
+
2.90 - SHQ16-1263 Support for Customer Account Carrier type
|
117 |
+
2.91 - SHQ16-1263 Support for Customer Account Carrier type - style updates
|
118 |
+
2.92 - SHQ16-1299 Fixed issue with display of transaction ID and dim info
|
119 |
+
2.93 - SHQ16-1263 Fixed issue with PHP Fatal Error
|
120 |
+
2.94 - SHQ16-1328 Fixed issue in SQL install script
|
121 |
+
2.95 - SHQ16-1327 Add required changes for compatibility with PVR
|
122 |
+
2.96 - 2.96 release tag
|
123 |
+
2.97 - SHQ16-1342 Remove null from UPS AP Location text
|
124 |
+
2.98 - SHQ16-1399 Will now use the default weight set in SHQ when weight of item is 0 or null
|
125 |
+
2.99 - SHQ16-1237 Fixed issue with wrong rate showing on first load
|
126 |
+
2.100 - SHIPPERHQ-1622 optionally reset carrier code to default Magento on place order
|
127 |
+
2.101 - SHQ16-1467 Fixed pickup address persisting issue
|
128 |
+
2.102 - SHIPPERHQ-1635 Add back in transaction ID
|
129 |
+
2.103 - SHQ16-1389 save address type used in rate SHQ16-1515 resovled date format bug
|
130 |
+
2.104 - SHQ16-1389 save address type used in rate
|
131 |
+
2.105 - SHQ16-1518 Calendar default date changes, SHQ16-1502 ignore admin validation of virtual orders
|
132 |
+
2.106 - SHIPPERHQ-1370 check for selected calendar rates and display by default if selected
|
133 |
+
2.107 - SHQ16-1522 OSC support for legacy versions
|
134 |
+
2.108 - SHQ16-1523 display location for preselected pickup, SHQ16-1525 improve synch notifications, SHQ16-1181 order view duplicate comments correction
|
135 |
+
2.109 - SHQ16-1566 support for calendar end date
|
136 |
+
2.110 - Resolved JS errors on admin view
|
137 |
+
2.111 - SHQ16-1616 account for negative discounted prices, SHQ16-1618 save carrier group ID on order packages
|
138 |
+
2.112 - Compatibility enhancement for minify JS
|
139 |
+
2.113 - IWD Pro Checkout Compatibility. LTL Accessorial display fix
|
140 |
+
2.114 - SHQ16-1711 process deliveryMessage, SHQ16-1722 store packages on session, SHQ16-1726 use date selected in accessorial requests
|
141 |
+
2.115 - SHQ16-1729 resolve error on shipment email for pickup location
|
142 |
+
2.116 - SHQ16-1748 explicitly set collect rates to false on submit, SHQ16-1357 dont show any date for custom calendar carriers on inital load, SHQ16-1750 remove legacy attributes from request
|
143 |
+
2.117 - SHQ16-1690 Added section specific classes and removed inline styles
|
144 |
+
2.118 - SHQ16-1768 item detail added when merged rates enabled for MAC
|
145 |
+
2.119 - SHQ16-1791 Admin order view update improvements. SHQ16-1792 Fixed shipping and handling column in order view
|
146 |
+
2.120 - SHQ16-1777 Admin layout refactor. SHQ16-1792 Resolved issue with dates showing when not applicable in admin
|
147 |
+
2.121 - SHQ16-1825 Added further checks to ensure attribute is included in indexer
|
148 |
+
2.122 - SHQ16-1831 Method styling on OSC for pickup/access point methods
|
149 |
+
2.123 - SHQ16-1834 Autoselect single calendar rate and SHQ16-1791 order email correction for single carrier
|
150 |
+
2.124 - SHQ16-1837 Further improvements for OneStepCheckout and pickup functionality. Ensured rendering correct block and template when using + - item qty in checkout
|
151 |
+
2.125 - SHQ16-1804 - support for limited access delivery accesorial
|
152 |
+
2.126 - SHQ16-1804 - support for limited access delivery accesorial
|
153 |
+
2.127 - SHQ16-1791 refactor order event processing, SHQ16-1834 autoselect single rate on rerequest
|
154 |
+
2.128 - SHQ16-1873 Updated extension to handle split shipping groups and store pickup
|
155 |
+
2.129 - SHQ16-1873 Updated extension to handle split shipping groups and store pickup
|
156 |
+
2.130 - SHQ16-1873 Further work on split shipping groups with one step checkout
|
157 |
+
2.131 - SHQ16-1873 Further work on split shipping groups with one step checkout
|
158 |
+
2.132 - SHQ16-1605 Additional accessorial support
|
159 |
+
2.133 - SHQ16-1893 Work around for Magento issue with taxed discounted base totals
|
160 |
+
2.134 - SHQ16-1837 Resolved so OSC single methods are saved, SHQ16-1926 support for shqshared carrier in default carrier code logic
|
161 |
+
2.135 - SHQ16-1932 Fixed issue with SHQ details saving on item when order shipping method is not SHQ
|
162 |
+
2.136 - SHQ16-1932 only display Delivery Date field in email if date is set
|
163 |
+
2.137 - SHQ16-1932 Resolved issue with carriergroup_shipping_details not saving to order
|
164 |
+
2.138 - SHQ16-1987 Backup carrier improvements
|
165 |
+
2.139 - SHQ16-1987 Backup carrier improvements
|
166 |
+
2.140 - SHQ16-1986 Date Rule on Split Checkout only applying to one checkout option
|
167 |
+
2.141 - SHQ16-2014 Wrong carrier being autoselected
|
168 |
+
2.142 - SHQ16-2020 add bcarriergroup breakdown to order comments
|
169 |
+
2.143 - SHQ16-2023 support for multiple calendar instances in multiaddress checkout
|
170 |
+
2.144 - SHQ16-2031 SHQ16-1994 Admin CSS not loading and IWD Order Manager Compatibility
|
171 |
+
2.145 - SHQ16-2034 Fixed typo in saveOrderAfter code which stopped log appearing in order
|
172 |
+
2.146 - SHQ16-2032 Resolve issue with timeslot and hour lead times2.147 - SHQ16-2023 carrier group support in MAC and SHQ16-2019 PNG images
|
173 |
+
2.148 - SHQ16-2023 carrier group support in MAC and SHQ16-2019 PNG images
|
174 |
+
2.150 - SHQ16-2078 Support lead time in hours for pickup that pushes to next day2.150 - SHQ16-2078 account for lead time in hours
|
175 |
+
2.151 - SHQ16-2065 Fixed issue with inside delivery and limited delivery not being deselectable
|
app/code/community/Shipperhq/Shipper/controllers/Adminhtml/ShqajaxController.php
CHANGED
@@ -50,7 +50,7 @@ class Shipperhq_Shipper_Adminhtml_ShqajaxController extends Mage_Adminhtml_Contr
|
|
50 |
$success = 2;
|
51 |
}
|
52 |
else {
|
53 |
-
$message = Mage::helper('shipperhq_shipper')->__('%s
|
54 |
$session->addSuccess($message);
|
55 |
}
|
56 |
|
50 |
$success = 2;
|
51 |
}
|
52 |
else {
|
53 |
+
$message = Mage::helper('shipperhq_shipper')->__('%s carriers have been updated from ShipperHQ', count($refreshResult));
|
54 |
$session->addSuccess($message);
|
55 |
}
|
56 |
|
app/code/community/Shipperhq/Shipper/etc/config.xml
CHANGED
@@ -32,8 +32,8 @@
|
|
32 |
<config>
|
33 |
<modules>
|
34 |
<Shipperhq_Shipper>
|
35 |
-
<version>0.0.
|
36 |
-
<extension_version>2.
|
37 |
<!-- implemented in module file -->
|
38 |
<!-- <active>true</active>
|
39 |
<codePool>community</codePool>
|
@@ -97,6 +97,11 @@
|
|
97 |
<quote_address_rate>Shipperhq_Shipper_Model_Sales_Quote_Address_Rate</quote_address_rate>
|
98 |
</rewrite>
|
99 |
</sales>
|
|
|
|
|
|
|
|
|
|
|
100 |
</models>
|
101 |
<resources>
|
102 |
<shipperhq_shipper_setup>
|
@@ -143,6 +148,15 @@
|
|
143 |
</shipperhq_shipper_cart_estimate_display>
|
144 |
</observers>
|
145 |
</core_block_abstract_to_html_before>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
<!-- set checkout flag for rates processing -->
|
147 |
<controller_action_predispatch_checkout_onepage_saveBilling>
|
148 |
<observers>
|
@@ -152,6 +166,15 @@
|
|
152 |
</shipperhq_shipper_savebilling_observer>
|
153 |
</observers>
|
154 |
</controller_action_predispatch_checkout_onepage_saveBilling>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
<!-- set checkout for rates processing and re-request rates if it's split checkout -->
|
156 |
<controller_action_predispatch_onestepcheckout_index_index>
|
157 |
<observers>
|
@@ -339,6 +362,9 @@
|
|
339 |
<carriergroup_shipping_html>
|
340 |
<to_order>*</to_order>
|
341 |
</carriergroup_shipping_html>
|
|
|
|
|
|
|
342 |
</sales_convert_quote_address>
|
343 |
<sales_convert_order>
|
344 |
<dispatch_date>
|
@@ -362,6 +388,9 @@
|
|
362 |
<carriergroup_shipping_html>
|
363 |
<to_quote_address_shipping>*</to_quote_address_shipping>
|
364 |
</carriergroup_shipping_html>
|
|
|
|
|
|
|
365 |
</sales_convert_order>
|
366 |
<sales_convert_quote_item>
|
367 |
<carriergroup>
|
@@ -432,6 +461,7 @@
|
|
432 |
<package_type/>
|
433 |
<packing_section_name/>
|
434 |
<shipperhq_malleable_product/>
|
|
|
435 |
</product_attributes>
|
436 |
</item>
|
437 |
</quote>
|
@@ -496,6 +526,7 @@
|
|
496 |
<password backend_model="adminhtml/system_config_backend_encrypted">
|
497 |
DTAzdo8+0u4DbuvI5NgP8V711uNH6COXD/e821CQSmY6gfOzH1enxEVmexG2sPbEQQGDbEelSQ4=
|
498 |
</password>
|
|
|
499 |
<url>http://sandbox.shipperhq.com/v1/</url>
|
500 |
<live_url>http://api.shipperhq.com/v1/</live_url>
|
501 |
<secure_url>https://api.shipperhq.com/v1/</secure_url>
|
@@ -507,11 +538,15 @@
|
|
507 |
<sallowspecific>0</sallowspecific>
|
508 |
<showerrors>0</showerrors>
|
509 |
<showmethod>1</showmethod>
|
|
|
|
|
510 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this
|
511 |
shipping method, please contact us.
|
512 |
</specificerrmsg>
|
513 |
-
<ws_timeout>
|
514 |
<is_enterprise>0</is_enterprise>
|
|
|
|
|
515 |
</shipper>
|
516 |
<shipperadmin>
|
517 |
<active>1</active>
|
32 |
<config>
|
33 |
<modules>
|
34 |
<Shipperhq_Shipper>
|
35 |
+
<version>0.0.34</version>
|
36 |
+
<extension_version>2.151</extension_version>
|
37 |
<!-- implemented in module file -->
|
38 |
<!-- <active>true</active>
|
39 |
<codePool>community</codePool>
|
97 |
<quote_address_rate>Shipperhq_Shipper_Model_Sales_Quote_Address_Rate</quote_address_rate>
|
98 |
</rewrite>
|
99 |
</sales>
|
100 |
+
<adminhtml>
|
101 |
+
<rewrite>
|
102 |
+
<system_config_source_shipping_allmethods>Shipperhq_Shipper_Model_Adminhtml_System_Config_Source_Shipping_Allmethods</system_config_source_shipping_allmethods>
|
103 |
+
</rewrite>
|
104 |
+
</adminhtml>
|
105 |
</models>
|
106 |
<resources>
|
107 |
<shipperhq_shipper_setup>
|
148 |
</shipperhq_shipper_cart_estimate_display>
|
149 |
</observers>
|
150 |
</core_block_abstract_to_html_before>
|
151 |
+
<!--OSC Generate Block on the fly. We need to replace with ours-->
|
152 |
+
<controller_action_postdispatch_onestepcheckout_ajax_updatecart>
|
153 |
+
<observers>
|
154 |
+
<shipperhq_shipper_osc_update_cart>
|
155 |
+
<class>shipperhq_shipper/observer</class>
|
156 |
+
<method>oscUpdateCart</method>
|
157 |
+
</shipperhq_shipper_osc_update_cart>
|
158 |
+
</observers>
|
159 |
+
</controller_action_postdispatch_onestepcheckout_ajax_updatecart>
|
160 |
<!-- set checkout flag for rates processing -->
|
161 |
<controller_action_predispatch_checkout_onepage_saveBilling>
|
162 |
<observers>
|
166 |
</shipperhq_shipper_savebilling_observer>
|
167 |
</observers>
|
168 |
</controller_action_predispatch_checkout_onepage_saveBilling>
|
169 |
+
<!--IWD OPC-->
|
170 |
+
<controller_action_predispatch_opc_json_saveBilling>
|
171 |
+
<observers>
|
172 |
+
<shipperhq_shipper_savebilling_observer>
|
173 |
+
<class>shipperhq_shipper/observer</class>
|
174 |
+
<method>onCheckoutSaveBilling</method>
|
175 |
+
</shipperhq_shipper_savebilling_observer>
|
176 |
+
</observers>
|
177 |
+
</controller_action_predispatch_opc_json_saveBilling>
|
178 |
<!-- set checkout for rates processing and re-request rates if it's split checkout -->
|
179 |
<controller_action_predispatch_onestepcheckout_index_index>
|
180 |
<observers>
|
362 |
<carriergroup_shipping_html>
|
363 |
<to_order>*</to_order>
|
364 |
</carriergroup_shipping_html>
|
365 |
+
<shq_delivery_comments>
|
366 |
+
<to_order>*</to_order>
|
367 |
+
</shq_delivery_comments>
|
368 |
</sales_convert_quote_address>
|
369 |
<sales_convert_order>
|
370 |
<dispatch_date>
|
388 |
<carriergroup_shipping_html>
|
389 |
<to_quote_address_shipping>*</to_quote_address_shipping>
|
390 |
</carriergroup_shipping_html>
|
391 |
+
<shq_delivery_comments>
|
392 |
+
<to_quote_address_shipping>*</to_quote_address_shipping>
|
393 |
+
</shq_delivery_comments>
|
394 |
</sales_convert_order>
|
395 |
<sales_convert_quote_item>
|
396 |
<carriergroup>
|
461 |
<package_type/>
|
462 |
<packing_section_name/>
|
463 |
<shipperhq_malleable_product/>
|
464 |
+
<shipperhq_availability_date/>
|
465 |
</product_attributes>
|
466 |
</item>
|
467 |
</quote>
|
526 |
<password backend_model="adminhtml/system_config_backend_encrypted">
|
527 |
DTAzdo8+0u4DbuvI5NgP8V711uNH6COXD/e821CQSmY6gfOzH1enxEVmexG2sPbEQQGDbEelSQ4=
|
528 |
</password>
|
529 |
+
<invalid_credentials_supplied>0</invalid_credentials_supplied>
|
530 |
<url>http://sandbox.shipperhq.com/v1/</url>
|
531 |
<live_url>http://api.shipperhq.com/v1/</live_url>
|
532 |
<secure_url>https://api.shipperhq.com/v1/</secure_url>
|
538 |
<sallowspecific>0</sallowspecific>
|
539 |
<showerrors>0</showerrors>
|
540 |
<showmethod>1</showmethod>
|
541 |
+
<allowed_methods></allowed_methods>
|
542 |
+
<allowed_methods_carriers></allowed_methods_carriers>
|
543 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this
|
544 |
shipping method, please contact us.
|
545 |
</specificerrmsg>
|
546 |
+
<ws_timeout>30</ws_timeout>
|
547 |
<is_enterprise>0</is_enterprise>
|
548 |
+
<delivery_comments>0</delivery_comments>
|
549 |
+
<delivery_comments_text>Enter your delivery comments here...</delivery_comments_text>
|
550 |
</shipper>
|
551 |
<shipperadmin>
|
552 |
<active>1</active>
|
app/code/community/Shipperhq/Shipper/etc/system.xml
CHANGED
@@ -79,8 +79,7 @@
|
|
79 |
<environment_scope translate="label comment">
|
80 |
<label>Environment Scope</label>
|
81 |
<frontend_type>select</frontend_type>
|
82 |
-
<source_model>shipperhq_shipper/adminhtml_system_config_source_environmentscope
|
83 |
-
</source_model>
|
84 |
<sort_order>150</sort_order>
|
85 |
<show_in_default>1</show_in_default>
|
86 |
<show_in_website>1</show_in_website>
|
@@ -107,16 +106,6 @@
|
|
107 |
<show_in_store>1</show_in_store>
|
108 |
<comment>Obtain from under Websites in the ShipperHQ Dashboard</comment>
|
109 |
</password>
|
110 |
-
<refresh_methods translate="label">
|
111 |
-
<label>Refresh Shipping Methods</label>
|
112 |
-
<frontend_type>select</frontend_type>
|
113 |
-
<frontend_model>shipperhq_shipper/adminhtml_carrier_refreshcarriers</frontend_model>
|
114 |
-
<button_label>Refresh Now</button_label>
|
115 |
-
<sort_order>190</sort_order>
|
116 |
-
<show_in_default>1</show_in_default>
|
117 |
-
<show_in_website>0</show_in_website>
|
118 |
-
<show_in_store>0</show_in_store>
|
119 |
-
</refresh_methods>
|
120 |
<backup_carrier translate="label">
|
121 |
<label>Backup Shipping Carrier/Method</label>
|
122 |
<frontend_type>select</frontend_type>
|
@@ -222,6 +211,37 @@
|
|
222 |
<show_in_website>1</show_in_website>
|
223 |
<show_in_store>0</show_in_store>
|
224 |
</secure_url>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
<heading_std_ship translate="label">
|
226 |
<label>Standard Shipping</label>
|
227 |
<frontend_model>shipperhq_shipper/adminhtml_carrier_heading</frontend_model>
|
@@ -280,6 +300,33 @@
|
|
280 |
</sort_order>
|
281 |
</fields>
|
282 |
</shipper>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
</groups>
|
284 |
</carriers>
|
285 |
</sections>
|
79 |
<environment_scope translate="label comment">
|
80 |
<label>Environment Scope</label>
|
81 |
<frontend_type>select</frontend_type>
|
82 |
+
<source_model>shipperhq_shipper/adminhtml_system_config_source_environmentscope</source_model>
|
|
|
83 |
<sort_order>150</sort_order>
|
84 |
<show_in_default>1</show_in_default>
|
85 |
<show_in_website>1</show_in_website>
|
106 |
<show_in_store>1</show_in_store>
|
107 |
<comment>Obtain from under Websites in the ShipperHQ Dashboard</comment>
|
108 |
</password>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
<backup_carrier translate="label">
|
110 |
<label>Backup Shipping Carrier/Method</label>
|
111 |
<frontend_type>select</frontend_type>
|
211 |
<show_in_website>1</show_in_website>
|
212 |
<show_in_store>0</show_in_store>
|
213 |
</secure_url>
|
214 |
+
<refresh_methods translate="label">
|
215 |
+
<label>Refresh Shipping Methods</label>
|
216 |
+
<frontend_type>select</frontend_type>
|
217 |
+
<frontend_model>shipperhq_shipper/adminhtml_carrier_refreshcarriers</frontend_model>
|
218 |
+
<button_label>Refresh Now</button_label>
|
219 |
+
<sort_order>391</sort_order>
|
220 |
+
<show_in_default>1</show_in_default>
|
221 |
+
<show_in_website>0</show_in_website>
|
222 |
+
<show_in_store>0</show_in_store>
|
223 |
+
</refresh_methods>
|
224 |
+
<delivery_comments translate="label comment">
|
225 |
+
<label>Delivery Comments on Checkout</label>
|
226 |
+
<frontend_type>select</frontend_type>
|
227 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
228 |
+
<sort_order>394</sort_order>
|
229 |
+
<show_in_default>1</show_in_default>
|
230 |
+
<show_in_website>1</show_in_website>
|
231 |
+
<show_in_store>0</show_in_store>
|
232 |
+
</delivery_comments>
|
233 |
+
<delivery_comments_text translate="label">
|
234 |
+
<label>Delivery Comments Explanation Text</label>
|
235 |
+
<frontend_type>text</frontend_type>
|
236 |
+
<sort_order>397</sort_order>
|
237 |
+
<depends>
|
238 |
+
<delivery_comments>1</delivery_comments>
|
239 |
+
</depends>
|
240 |
+
<show_in_default>1</show_in_default>
|
241 |
+
<show_in_website>1</show_in_website>
|
242 |
+
<show_in_store>0</show_in_store>
|
243 |
+
<comment>Text that will initially show in the box before the customer types anything</comment>
|
244 |
+
</delivery_comments_text>
|
245 |
<heading_std_ship translate="label">
|
246 |
<label>Standard Shipping</label>
|
247 |
<frontend_model>shipperhq_shipper/adminhtml_carrier_heading</frontend_model>
|
300 |
</sort_order>
|
301 |
</fields>
|
302 |
</shipper>
|
303 |
+
<ups>
|
304 |
+
<frontend_model>shipperhq_shipper/adminhtml_carrier_aboutblank</frontend_model>
|
305 |
+
<comment>
|
306 |
+
<![CDATA[
|
307 |
+
<b>Note: Credentials required for labelling if using ShipperHQ for rates</b>
|
308 |
+
</br>
|
309 |
+
]]>
|
310 |
+
</comment>
|
311 |
+
</ups>
|
312 |
+
<fedex>
|
313 |
+
<frontend_model>shipperhq_shipper/adminhtml_carrier_aboutblank</frontend_model>
|
314 |
+
<comment>
|
315 |
+
<![CDATA[
|
316 |
+
<b>Note: Credentials required for labelling if using ShipperHQ for rates</b>
|
317 |
+
</br>
|
318 |
+
]]>
|
319 |
+
</comment>
|
320 |
+
</fedex>
|
321 |
+
<dhlint>
|
322 |
+
<frontend_model>shipperhq_shipper/adminhtml_carrier_aboutblank</frontend_model>
|
323 |
+
<comment>
|
324 |
+
<![CDATA[
|
325 |
+
<b>Note: Credentials required for labelling if using ShipperHQ for rates</b>
|
326 |
+
</br>
|
327 |
+
]]>
|
328 |
+
</comment>
|
329 |
+
</dhlint>
|
330 |
</groups>
|
331 |
</carriers>
|
332 |
</sections>
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.31.php
ADDED
@@ -0,0 +1,911 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
|
7 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/attributeupdate'))) {
|
8 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/attributeupdate'));
|
9 |
+
|
10 |
+
$table
|
11 |
+
->addColumn('synch_id', Varien_Db_Ddl_Table::TYPE_INTEGER, NULL, array(
|
12 |
+
'primary' => true,
|
13 |
+
'nullable' => false,
|
14 |
+
'unsigned' => true,
|
15 |
+
'auto_increment' => true
|
16 |
+
))
|
17 |
+
->addColumn('notification_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 0, array(
|
18 |
+
'nullable' => false,
|
19 |
+
'unsigned' => true,
|
20 |
+
))
|
21 |
+
->addColumn('attribute_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
22 |
+
'nullable' => false,
|
23 |
+
))
|
24 |
+
->addColumn('attribute_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
25 |
+
'nullable' => false,
|
26 |
+
))
|
27 |
+
->addColumn('value', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
28 |
+
'nullable' => false,
|
29 |
+
))
|
30 |
+
->addColumn('status', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
31 |
+
'nullable' => false,
|
32 |
+
))
|
33 |
+
->addColumn('date_added', Varien_Db_Ddl_Table::TYPE_DATETIME, NULL, array(
|
34 |
+
'nullable' => false,
|
35 |
+
))
|
36 |
+
;
|
37 |
+
$this->getConnection()->createTable($table);
|
38 |
+
}
|
39 |
+
|
40 |
+
/* ------ shipperhq_shipping_group -------- */
|
41 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_group', array(
|
42 |
+
'type' => 'varchar',
|
43 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
44 |
+
'input' => 'multiselect',
|
45 |
+
'label' => 'Shipping Group',
|
46 |
+
'global' => false,
|
47 |
+
'visible' => 1,
|
48 |
+
'required' => 0,
|
49 |
+
'visible_on_front' => 0,
|
50 |
+
'is_html_allowed_on_front' => 0,
|
51 |
+
'searchable' => 0,
|
52 |
+
'filterable' => 0,
|
53 |
+
'comparable' => 0,
|
54 |
+
'is_configurable' => 0,
|
55 |
+
'unique' => false,
|
56 |
+
'user_defined' => false,
|
57 |
+
'used_in_product_listing' => false
|
58 |
+
));
|
59 |
+
|
60 |
+
/* ------ shipperhq_warehouse -------- */
|
61 |
+
$this->addAttribute('catalog_product', 'shipperhq_warehouse', array(
|
62 |
+
'type' => 'text',
|
63 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
64 |
+
'input' => 'multiselect',
|
65 |
+
'label' => 'Origin',
|
66 |
+
'global' => false,
|
67 |
+
'visible' => 1,
|
68 |
+
'required' => 0,
|
69 |
+
'visible_on_front' => 0,
|
70 |
+
'is_html_allowed_on_front' => 0,
|
71 |
+
'searchable' => 0,
|
72 |
+
'filterable' => 0,
|
73 |
+
'comparable' => 0,
|
74 |
+
'is_configurable' => 0,
|
75 |
+
'unique' => false,
|
76 |
+
'user_defined' => false,
|
77 |
+
'used_in_product_listing' => false
|
78 |
+
));
|
79 |
+
|
80 |
+
/* ------ shipperhq_shipping_qty -------- */
|
81 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_qty', array(
|
82 |
+
'type' => 'int',
|
83 |
+
'input' => 'text',
|
84 |
+
'label' => 'Shipping Qty',
|
85 |
+
'global' => false,
|
86 |
+
'visible' => 1,
|
87 |
+
'required' => 0,
|
88 |
+
'visible_on_front' => 0,
|
89 |
+
'is_html_allowed_on_front' => 0,
|
90 |
+
'searchable' => 0,
|
91 |
+
'filterable' => 0,
|
92 |
+
'comparable' => 0,
|
93 |
+
'unique' => false,
|
94 |
+
'user_defined' => true,
|
95 |
+
'used_in_product_listing' => false
|
96 |
+
));
|
97 |
+
|
98 |
+
/* ------ shipperhq_shipping_fee -------- */
|
99 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_fee', array(
|
100 |
+
'type' => 'decimal',
|
101 |
+
'input' => 'price',
|
102 |
+
'label' => 'Shipping Fee',
|
103 |
+
'global' => false,
|
104 |
+
'visible' => 1,
|
105 |
+
'required' => 0,
|
106 |
+
'visible_on_front' => 0,
|
107 |
+
'is_html_allowed_on_front' => 0,
|
108 |
+
'searchable' => 0,
|
109 |
+
'filterable' => 0,
|
110 |
+
'comparable' => 0,
|
111 |
+
'unique' => false,
|
112 |
+
'user_defined' => true,
|
113 |
+
'used_in_product_listing' => false
|
114 |
+
));
|
115 |
+
|
116 |
+
/* ------ shipperhq_additional_price -------- */
|
117 |
+
$this->addAttribute('catalog_product', 'shipperhq_additional_price', array(
|
118 |
+
'type' => 'decimal',
|
119 |
+
'input' => 'price',
|
120 |
+
'label' => 'Additional Price',
|
121 |
+
'global' => false,
|
122 |
+
'visible' => 1,
|
123 |
+
'required' => 0,
|
124 |
+
'visible_on_front' => 0,
|
125 |
+
'is_html_allowed_on_front' => 0,
|
126 |
+
'searchable' => 0,
|
127 |
+
'filterable' => 0,
|
128 |
+
'comparable' => 0,
|
129 |
+
'unique' => false,
|
130 |
+
'user_defined' => true,
|
131 |
+
'used_in_product_listing' => false
|
132 |
+
));
|
133 |
+
|
134 |
+
/* ------ shipperhq_handling_fee -------- */
|
135 |
+
$this->addAttribute('catalog_product', 'shipperhq_handling_fee', array(
|
136 |
+
'type' => 'decimal',
|
137 |
+
'input' => 'price',
|
138 |
+
'label' => 'Handling Fee',
|
139 |
+
'global' => false,
|
140 |
+
'visible' => 1,
|
141 |
+
'required' => 0,
|
142 |
+
'visible_on_front' => 0,
|
143 |
+
'is_html_allowed_on_front' => 0,
|
144 |
+
'searchable' => 0,
|
145 |
+
'filterable' => 0,
|
146 |
+
'comparable' => 0,
|
147 |
+
'unique' => false,
|
148 |
+
'user_defined' => true,
|
149 |
+
'used_in_product_listing' => false
|
150 |
+
));
|
151 |
+
|
152 |
+
/* ------ shipperhq_carrier_code -------- */
|
153 |
+
$this->addAttribute('catalog_product', 'shipperhq_carrier_code', array(
|
154 |
+
'type' => 'text',
|
155 |
+
'input' => 'text',
|
156 |
+
'label' => 'Carrier Code',
|
157 |
+
'global' => false,
|
158 |
+
'visible' => 1,
|
159 |
+
'required' => 0,
|
160 |
+
'visible_on_front' => 0,
|
161 |
+
'is_html_allowed_on_front' => 0,
|
162 |
+
'searchable' => 0,
|
163 |
+
'filterable' => 0,
|
164 |
+
'comparable' => 0,
|
165 |
+
'unique' => false,
|
166 |
+
'user_defined' => true,
|
167 |
+
'used_in_product_listing' => false
|
168 |
+
));
|
169 |
+
|
170 |
+
/* ------ shipperhq_volume_weight -------- */
|
171 |
+
$this->addAttribute('catalog_product', 'shipperhq_volume_weight', array(
|
172 |
+
'type' => 'decimal',
|
173 |
+
'input' => 'text',
|
174 |
+
'label' => 'Volume Weight',
|
175 |
+
'global' => false,
|
176 |
+
'visible' => 1,
|
177 |
+
'required' => 0,
|
178 |
+
'visible_on_front' => 0,
|
179 |
+
'is_html_allowed_on_front' => 0,
|
180 |
+
'searchable' => 0,
|
181 |
+
'filterable' => 0,
|
182 |
+
'comparable' => 0,
|
183 |
+
'unique' => false,
|
184 |
+
'user_defined' => true,
|
185 |
+
'used_in_product_listing' => false,
|
186 |
+
'note' => 'This value is only used in conjunction with shipping filters'
|
187 |
+
));
|
188 |
+
|
189 |
+
/* ------ shipperhq_declared_value -------- */
|
190 |
+
$this->addAttribute('catalog_product', 'shipperhq_declared_value', array(
|
191 |
+
'type' => 'decimal',
|
192 |
+
'input' => 'price',
|
193 |
+
'label' => 'Declared Value',
|
194 |
+
'global' => false,
|
195 |
+
'visible' => 1,
|
196 |
+
'required' => 0,
|
197 |
+
'visible_on_front' => 0,
|
198 |
+
'is_html_allowed_on_front' => 0,
|
199 |
+
'searchable' => 0,
|
200 |
+
'filterable' => 0,
|
201 |
+
'comparable' => 0,
|
202 |
+
'unique' => false,
|
203 |
+
'user_defined' => true,
|
204 |
+
'used_in_product_listing' => false,
|
205 |
+
'note' => 'The deemed cost of this product for customs & insurance purposes'
|
206 |
+
));
|
207 |
+
|
208 |
+
/* ------ ship_separately -------- */
|
209 |
+
$this->addAttribute('catalog_product', 'ship_separately', array(
|
210 |
+
'type' => 'int',
|
211 |
+
'input' => 'boolean',
|
212 |
+
'label' => 'Ship Separately',
|
213 |
+
'global' => false,
|
214 |
+
'visible' => 1,
|
215 |
+
'required' => 0,
|
216 |
+
'visible_on_front' => 0,
|
217 |
+
'is_html_allowed_on_front' => 0,
|
218 |
+
'searchable' => 0,
|
219 |
+
'filterable' => 0,
|
220 |
+
'comparable' => 0,
|
221 |
+
'unique' => false,
|
222 |
+
'user_defined' => true,
|
223 |
+
'used_in_product_listing' => false
|
224 |
+
));
|
225 |
+
|
226 |
+
/* ------ shipperhq_dim_group -------- */
|
227 |
+
$this->addAttribute('catalog_product', 'shipperhq_dim_group', array(
|
228 |
+
'type' => 'varchar',
|
229 |
+
'input' => 'select',
|
230 |
+
'label' => 'ShipperHQ Dimensional Rule Group',
|
231 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
232 |
+
'global' => false,
|
233 |
+
'visible' => 1,
|
234 |
+
'required' => 0,
|
235 |
+
'visible_on_front' => 0,
|
236 |
+
'is_html_allowed_on_front' => 0,
|
237 |
+
'searchable' => 0,
|
238 |
+
'filterable' => 0,
|
239 |
+
'comparable' => 0,
|
240 |
+
'is_configurable' => 0,
|
241 |
+
'unique' => false,
|
242 |
+
'user_defined' => true,
|
243 |
+
'used_in_product_listing' => false
|
244 |
+
));
|
245 |
+
|
246 |
+
/* ------ ship_length -------- */
|
247 |
+
$this->addAttribute('catalog_product', 'ship_length', array(
|
248 |
+
'type' => 'decimal',
|
249 |
+
'input' => 'text',
|
250 |
+
'label' => 'Dimension Length',
|
251 |
+
'global' => false,
|
252 |
+
'visible' => 1,
|
253 |
+
'required' => 0,
|
254 |
+
'visible_on_front' => 0,
|
255 |
+
'is_html_allowed_on_front' => 0,
|
256 |
+
'searchable' => 0,
|
257 |
+
'filterable' => 0,
|
258 |
+
'comparable' => 0,
|
259 |
+
'unique' => false,
|
260 |
+
'user_defined' => true,
|
261 |
+
'used_in_product_listing' => false
|
262 |
+
));
|
263 |
+
|
264 |
+
/* ------ ship_width -------- */
|
265 |
+
$this->addAttribute('catalog_product', 'ship_width', array(
|
266 |
+
'type' => 'decimal',
|
267 |
+
'input' => 'text',
|
268 |
+
'label' => 'Dimension Width',
|
269 |
+
'global' => false,
|
270 |
+
'visible' => 1,
|
271 |
+
'required' => 0,
|
272 |
+
'visible_on_front' => 0,
|
273 |
+
'is_html_allowed_on_front' => 0,
|
274 |
+
'searchable' => 0,
|
275 |
+
'filterable' => 0,
|
276 |
+
'comparable' => 0,
|
277 |
+
'unique' => false,
|
278 |
+
'user_defined' => true,
|
279 |
+
'used_in_product_listing' => false
|
280 |
+
));
|
281 |
+
|
282 |
+
/* ------ ship_height -------- */
|
283 |
+
$this->addAttribute('catalog_product', 'ship_height', array(
|
284 |
+
'type' => 'decimal',
|
285 |
+
'input' => 'text',
|
286 |
+
'label' => 'Dimension Height',
|
287 |
+
'global' => false,
|
288 |
+
'visible' => 1,
|
289 |
+
'required' => 0,
|
290 |
+
'visible_on_front' => 0,
|
291 |
+
'is_html_allowed_on_front' => 0,
|
292 |
+
'searchable' => 0,
|
293 |
+
'filterable' => 0,
|
294 |
+
'comparable' => 0,
|
295 |
+
'unique' => false,
|
296 |
+
'user_defined' => true,
|
297 |
+
'used_in_product_listing' => false
|
298 |
+
));
|
299 |
+
|
300 |
+
/* ------ shipperhq_poss_boxes -------- */
|
301 |
+
$this->addAttribute('catalog_product', 'shipperhq_poss_boxes', array(
|
302 |
+
'type' => 'varchar',
|
303 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
304 |
+
'input' => 'multiselect',
|
305 |
+
'label' => 'Possible Packing Boxes',
|
306 |
+
'global' => false,
|
307 |
+
'visible' => 1,
|
308 |
+
'required' => 0,
|
309 |
+
'visible_on_front' => 0,
|
310 |
+
'is_html_allowed_on_front' => 0,
|
311 |
+
'searchable' => 0,
|
312 |
+
'filterable' => 0,
|
313 |
+
'comparable' => 0,
|
314 |
+
'is_configurable' => 0,
|
315 |
+
'unique' => false,
|
316 |
+
'user_defined' => true,
|
317 |
+
'used_in_product_listing' => false
|
318 |
+
));
|
319 |
+
|
320 |
+
/* ------ ship_box_tolerance -------- */
|
321 |
+
$this->addAttribute('catalog_product', 'ship_box_tolerance', array(
|
322 |
+
'type' => 'int',
|
323 |
+
'input' => 'text',
|
324 |
+
'label' => 'Box Tolerance',
|
325 |
+
'global' => false,
|
326 |
+
'visible' => 1,
|
327 |
+
'required' => 0,
|
328 |
+
'visible_on_front' => 0,
|
329 |
+
'is_html_allowed_on_front' => 0,
|
330 |
+
'searchable' => 0,
|
331 |
+
'filterable' => 0,
|
332 |
+
'comparable' => 0,
|
333 |
+
'unique' => false,
|
334 |
+
'used_in_product_listing' => false,
|
335 |
+
'user_defined' => true,
|
336 |
+
'note' => 'Note: Ignore if unsure'
|
337 |
+
));
|
338 |
+
|
339 |
+
/* ------ shipperhq_malleable_product -------- */
|
340 |
+
$this->addAttribute('catalog_product', 'shipperhq_malleable_product', array(
|
341 |
+
'type' => 'int',
|
342 |
+
'input' => 'boolean',
|
343 |
+
'label' => 'Malleable Product',
|
344 |
+
'global' => false,
|
345 |
+
'visible' => 1,
|
346 |
+
'required' => 0,
|
347 |
+
'visible_on_front' => 0,
|
348 |
+
'is_html_allowed_on_front' => 0,
|
349 |
+
'searchable' => 0,
|
350 |
+
'filterable' => 0,
|
351 |
+
'comparable' => 0,
|
352 |
+
'unique' => false,
|
353 |
+
'user_defined' => true,
|
354 |
+
'note' => 'Ignore if unsure. Indicates the product dimensions can be adjusted to fit box',
|
355 |
+
'used_in_product_listing' => false
|
356 |
+
));
|
357 |
+
|
358 |
+
/* ------ shipperhq_master_boxes -------- */
|
359 |
+
$this->addAttribute('catalog_product', 'shipperhq_master_boxes', array(
|
360 |
+
'type' => 'varchar',
|
361 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
362 |
+
'input' => 'multiselect',
|
363 |
+
'label' => 'Master Packing Boxes',
|
364 |
+
'global' => false,
|
365 |
+
'visible' => 1,
|
366 |
+
'required' => 0,
|
367 |
+
'visible_on_front' => 0,
|
368 |
+
'is_html_allowed_on_front' => 0,
|
369 |
+
'searchable' => 0,
|
370 |
+
'filterable' => 0,
|
371 |
+
'comparable' => 0,
|
372 |
+
'is_configurable' => 0,
|
373 |
+
'unique' => false,
|
374 |
+
'user_defined' => true,
|
375 |
+
'used_in_product_listing' => false
|
376 |
+
));
|
377 |
+
|
378 |
+
/* ------ shipperhq_availability_date -------- */
|
379 |
+
$this->addAttribute('catalog_product', 'shipperhq_availability_date', array(
|
380 |
+
'type' => 'datetime',
|
381 |
+
'backend' => 'eav/entity_attribute_backend_datetime',
|
382 |
+
'input' => 'date',
|
383 |
+
'label' => 'Availability Date',
|
384 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
|
385 |
+
'visible' => 1,
|
386 |
+
'required' => 0,
|
387 |
+
'visible_on_front' => 0,
|
388 |
+
'is_html_allowed_on_front' => 0,
|
389 |
+
'searchable' => 0,
|
390 |
+
'filterable' => 0,
|
391 |
+
'comparable' => 0,
|
392 |
+
'is_configurable' => 0,
|
393 |
+
'unique' => false,
|
394 |
+
'user_defined' => true,
|
395 |
+
'used_in_product_listing' => false
|
396 |
+
));
|
397 |
+
|
398 |
+
/*
|
399 |
+
*
|
400 |
+
*
|
401 |
+
*
|
402 |
+
*/
|
403 |
+
|
404 |
+
$entityTypeId = $installer->getEntityTypeId('catalog_product');
|
405 |
+
|
406 |
+
$attributeSetArr = $installer->getAllAttributeSetIds($entityTypeId);
|
407 |
+
|
408 |
+
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Splitrates')) {
|
409 |
+
$stdAttributeCodes = array('shipperhq_shipping_group' => '1', 'shipperhq_warehouse' => '10');
|
410 |
+
}
|
411 |
+
else {
|
412 |
+
$stdAttributeCodes = array('shipperhq_shipping_group' => '1');
|
413 |
+
}
|
414 |
+
$dimAttributeCodes = array('ship_separately' => '2',
|
415 |
+
'shipperhq_dim_group' => '1',
|
416 |
+
'ship_length' => '10',
|
417 |
+
'ship_width' => '11',
|
418 |
+
'ship_height' => '12',
|
419 |
+
'shipperhq_poss_boxes' => '20',
|
420 |
+
);
|
421 |
+
|
422 |
+
foreach ($attributeSetArr as $attributeSetId) {
|
423 |
+
|
424 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Shipping', '99');
|
425 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Dimensional Shipping', '100');
|
426 |
+
|
427 |
+
$attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Shipping');
|
428 |
+
$dimAttributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Dimensional Shipping');
|
429 |
+
|
430 |
+
foreach($stdAttributeCodes as $code => $sort) {
|
431 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
432 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, $attributeId, $sort);
|
433 |
+
}
|
434 |
+
|
435 |
+
foreach($dimAttributeCodes as $code => $sort) {
|
436 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
437 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $dimAttributeGroupId, $attributeId, $sort);
|
438 |
+
}
|
439 |
+
|
440 |
+
};
|
441 |
+
|
442 |
+
|
443 |
+
|
444 |
+
$text = Mage::helper('wsalogger')->getNewVersion() > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text';
|
445 |
+
|
446 |
+
$isCheckout = array(
|
447 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
448 |
+
'comment' => 'Shipperhq Shipper',
|
449 |
+
'nullable' => 'false',
|
450 |
+
'default' => '0'
|
451 |
+
);
|
452 |
+
|
453 |
+
$carrierType = array(
|
454 |
+
'type' => $text,
|
455 |
+
'comment' => 'Shipperhq Carrier Type',
|
456 |
+
'nullable' => 'true',
|
457 |
+
);
|
458 |
+
|
459 |
+
$dispatchDate = array(
|
460 |
+
'type' => $text,
|
461 |
+
'length' => 20,
|
462 |
+
'comment' => 'Dispatch Date',
|
463 |
+
'nullable' => 'true');
|
464 |
+
|
465 |
+
$deliveryDate = array(
|
466 |
+
'type' => $text,
|
467 |
+
'length' => 20,
|
468 |
+
'comment' => 'Expected Delivery',
|
469 |
+
'nullable' => 'true');
|
470 |
+
|
471 |
+
$carrierNotice = array(
|
472 |
+
'type' => $text,
|
473 |
+
'comment' => 'Shipperhq Carrier Notice',
|
474 |
+
'nullable' => 'true',
|
475 |
+
);
|
476 |
+
|
477 |
+
$customDescription = array(
|
478 |
+
'type' => $text,
|
479 |
+
'comment' => 'Shipperhq Custom Description',
|
480 |
+
'nullable' => 'true',
|
481 |
+
);
|
482 |
+
|
483 |
+
$carrierId = array(
|
484 |
+
'type' => $text,
|
485 |
+
'length' => 20,
|
486 |
+
'comment' => 'Shipperhq Carrier ID',
|
487 |
+
'nullable' => 'true',
|
488 |
+
);
|
489 |
+
|
490 |
+
$customDuties = array(
|
491 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
|
492 |
+
'scale' => 4,
|
493 |
+
'precision' => 12,
|
494 |
+
'comment' => 'Shipperhq Custom Duties',
|
495 |
+
);
|
496 |
+
|
497 |
+
$confirmationNo = array(
|
498 |
+
'type' => $text,
|
499 |
+
'length' => 20,
|
500 |
+
'comment' => 'Shipperhq Confirmation Number',
|
501 |
+
'nullable' => 'true',
|
502 |
+
);
|
503 |
+
|
504 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'is_checkout')){
|
505 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'is_checkout', $isCheckout);
|
506 |
+
}
|
507 |
+
|
508 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_type')){
|
509 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carrier_type', $carrierType);
|
510 |
+
}
|
511 |
+
|
512 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'dispatch_date')){
|
513 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'dispatch_date', $dispatchDate );
|
514 |
+
}
|
515 |
+
|
516 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'delivery_date')){
|
517 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'delivery_date', $deliveryDate );
|
518 |
+
}
|
519 |
+
|
520 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type')){
|
521 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type', $carrierType);
|
522 |
+
}
|
523 |
+
|
524 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'dispatch_date')){
|
525 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'dispatch_date', $dispatchDate );
|
526 |
+
}
|
527 |
+
|
528 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'delivery_date')){
|
529 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'delivery_date', $deliveryDate );
|
530 |
+
}
|
531 |
+
|
532 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice')){
|
533 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice', $carrierNotice);
|
534 |
+
}
|
535 |
+
|
536 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description')){
|
537 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description', $customDescription);
|
538 |
+
}
|
539 |
+
|
540 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id')){
|
541 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id', $carrierId);
|
542 |
+
}
|
543 |
+
|
544 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_id')){
|
545 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'carrier_id', $carrierId );
|
546 |
+
}
|
547 |
+
|
548 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_id')){
|
549 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_id', $carrierId );
|
550 |
+
}
|
551 |
+
|
552 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'confirmation_number')){
|
553 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'confirmation_number', $confirmationNo );
|
554 |
+
}
|
555 |
+
|
556 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties')){
|
557 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties', $customDuties);
|
558 |
+
}
|
559 |
+
|
560 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_type')){
|
561 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_type', $carrierType );
|
562 |
+
}
|
563 |
+
|
564 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'dispatch_date')){
|
565 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'dispatch_date', $dispatchDate );
|
566 |
+
}
|
567 |
+
|
568 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'delivery_date')){
|
569 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'delivery_date', $deliveryDate );
|
570 |
+
}
|
571 |
+
else {
|
572 |
+
$installer->getConnection()->modifyColumn(
|
573 |
+
$installer->getTable('sales/order'),
|
574 |
+
'delivery_date',
|
575 |
+
array(
|
576 |
+
'type' => $text,
|
577 |
+
'length' => 20,
|
578 |
+
'comment' => 'Expected Delivery',
|
579 |
+
'nullable' => 'true'
|
580 |
+
)
|
581 |
+
);
|
582 |
+
}
|
583 |
+
|
584 |
+
/*carrier group attributes*/
|
585 |
+
$version = Mage::helper('wsalogger')->getNewVersion();
|
586 |
+
|
587 |
+
$carriergroupAttr = array(
|
588 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
589 |
+
'comment' => 'Carrier Group',
|
590 |
+
'nullable' => 'true',
|
591 |
+
);
|
592 |
+
|
593 |
+
$carriergroupID = array(
|
594 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
595 |
+
'comment' => 'Carrier Group ID',
|
596 |
+
'nullable' => 'true',
|
597 |
+
);
|
598 |
+
|
599 |
+
$carriergroupDetails = array(
|
600 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
601 |
+
'comment' => 'Carrier Group Details',
|
602 |
+
'nullable' => 'true',
|
603 |
+
);
|
604 |
+
|
605 |
+
$carriergroupHtml = array(
|
606 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
607 |
+
'comment' => 'Carrier Group Html',
|
608 |
+
'nullable' => 'true',
|
609 |
+
);
|
610 |
+
|
611 |
+
$displayMerged = array(
|
612 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
613 |
+
'comment' => 'Checkout display type',
|
614 |
+
'nullable' => 'false',
|
615 |
+
'default' => '1'
|
616 |
+
);
|
617 |
+
|
618 |
+
$splitRates = array(
|
619 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
620 |
+
'comment' => 'Shipperhq Split Rates',
|
621 |
+
'nullable' => 'false',
|
622 |
+
'default' => '0'
|
623 |
+
);
|
624 |
+
|
625 |
+
$carriergroupShipping = array(
|
626 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
627 |
+
'comment' => 'Shipping Description',
|
628 |
+
'nullable' => 'true',
|
629 |
+
);
|
630 |
+
|
631 |
+
$destinationTypeAttr = array(
|
632 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text',
|
633 |
+
'comment' => 'ShipperHQ Address Type',
|
634 |
+
'nullable' => 'true',
|
635 |
+
);
|
636 |
+
|
637 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'destination_type')){
|
638 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'destination_type',$destinationTypeAttr);
|
639 |
+
}
|
640 |
+
|
641 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'destination_type')){
|
642 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'destination_type',$destinationTypeAttr);
|
643 |
+
}
|
644 |
+
|
645 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details')){
|
646 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details', $carriergroupDetails);
|
647 |
+
}
|
648 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html')){
|
649 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html', $carriergroupHtml);
|
650 |
+
}
|
651 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'checkout_display_merged')){
|
652 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'checkout_display_merged', $displayMerged);
|
653 |
+
}
|
654 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'split_rates')){
|
655 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'split_rates', $splitRates);
|
656 |
+
}
|
657 |
+
|
658 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id')){
|
659 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id', $carriergroupID);
|
660 |
+
}
|
661 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup')){
|
662 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup', $carriergroupAttr);
|
663 |
+
}
|
664 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details')){
|
665 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details', $carriergroupDetails);
|
666 |
+
}
|
667 |
+
|
668 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup')){
|
669 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup', $carriergroupAttr);
|
670 |
+
}
|
671 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup')){
|
672 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup', $carriergroupAttr);
|
673 |
+
}
|
674 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_id')){
|
675 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_id', $carriergroupID);
|
676 |
+
}
|
677 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_id')){
|
678 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_id', $carriergroupID);
|
679 |
+
}
|
680 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_shipping')){
|
681 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_shipping', $carriergroupShipping);
|
682 |
+
}
|
683 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_shipping')){
|
684 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_shipping', $carriergroupShipping);
|
685 |
+
}
|
686 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping')){
|
687 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping', $carriergroupShipping);
|
688 |
+
}
|
689 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup')){
|
690 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup', $carriergroupAttr);
|
691 |
+
}
|
692 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_id')){
|
693 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_id', $carriergroupID);
|
694 |
+
}
|
695 |
+
|
696 |
+
|
697 |
+
if (Mage::helper('wsalogger')->getNewVersion() >= 8) {
|
698 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment_grid'), 'carriergroup')){
|
699 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment_grid'),'carriergroup',$carriergroupAttr);
|
700 |
+
}
|
701 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'carriergroup')){
|
702 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'carriergroup',$carriergroupAttr);
|
703 |
+
}
|
704 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'shipping_description')){
|
705 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'shipping_description',array(
|
706 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
707 |
+
'length' => 255,
|
708 |
+
'comment' => 'Shipping Description',
|
709 |
+
'nullable' => 'true',));
|
710 |
+
}
|
711 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_html')){
|
712 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_html', $carriergroupHtml);
|
713 |
+
}
|
714 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_details')){
|
715 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_details', $carriergroupDetails);
|
716 |
+
}
|
717 |
+
if (Mage::helper('wsalogger')->isEnterpriseEdition() && $installer->tableExists('enterprise_sales_shipment_grid_archive')) {
|
718 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('enterprise_sales_shipment_grid_archive'), 'carriergroup')){
|
719 |
+
$installer->getConnection()->addColumn($installer->getTable('enterprise_sales_shipment_grid_archive'),'carriergroup',$carriergroupAttr);
|
720 |
+
}
|
721 |
+
}
|
722 |
+
}
|
723 |
+
|
724 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/storage'))) {
|
725 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/storage'));
|
726 |
+
|
727 |
+
$table
|
728 |
+
->addColumn('quote_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
729 |
+
'primary' => true,
|
730 |
+
'nullable' => false,
|
731 |
+
'unsigned' => true
|
732 |
+
))
|
733 |
+
->addColumn('data', Varien_Db_Ddl_Table::TYPE_TEXT, '512k', array('nullable' => false))
|
734 |
+
->addForeignKey(
|
735 |
+
$this->getFkName('shipperhq_shipper/storage', 'quote_id', 'sales/quote', 'entity_id'),
|
736 |
+
'quote_id',
|
737 |
+
$this->getTable('sales/quote'),
|
738 |
+
'entity_id',
|
739 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
740 |
+
)
|
741 |
+
;
|
742 |
+
$this->getConnection()->createTable($table);
|
743 |
+
}
|
744 |
+
|
745 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_packages'))) {
|
746 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_packages'));
|
747 |
+
|
748 |
+
$table
|
749 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
750 |
+
'primary' => true,
|
751 |
+
'nullable' => false,
|
752 |
+
'unsigned' => true,
|
753 |
+
'auto_increment' => true
|
754 |
+
))
|
755 |
+
->addColumn('address_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
756 |
+
'nullable' => false,
|
757 |
+
'unsigned' => true
|
758 |
+
))
|
759 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
760 |
+
'nullable' => false,
|
761 |
+
))
|
762 |
+
->addColumn('carrier_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
763 |
+
'nullable' => false,
|
764 |
+
))
|
765 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
766 |
+
'nullable' => false,
|
767 |
+
))
|
768 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
769 |
+
'nullable' => true
|
770 |
+
))
|
771 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
772 |
+
'nullable' => true
|
773 |
+
))
|
774 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
775 |
+
'nullable' => true
|
776 |
+
))
|
777 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
778 |
+
'nullable' => true
|
779 |
+
))
|
780 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
781 |
+
'nullable' => true
|
782 |
+
))
|
783 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
784 |
+
'nullable' => true
|
785 |
+
))
|
786 |
+
->addForeignKey(
|
787 |
+
$this->getFkName('shipperhq_shipper/quote_packages', 'address_id', 'sales/quote_address', 'address_id'),
|
788 |
+
'address_id',
|
789 |
+
$this->getTable('sales/quote_address'),
|
790 |
+
'address_id',
|
791 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
792 |
+
)
|
793 |
+
;
|
794 |
+
$this->getConnection()->createTable($table);
|
795 |
+
}
|
796 |
+
|
797 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_package_items'))) {
|
798 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_package_items'));
|
799 |
+
|
800 |
+
$table
|
801 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
802 |
+
'nullable' => false,
|
803 |
+
))
|
804 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
805 |
+
'nullable' => false,
|
806 |
+
))
|
807 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
808 |
+
'nullable' => true
|
809 |
+
))
|
810 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
811 |
+
'nullable' => true
|
812 |
+
))
|
813 |
+
->addForeignKey(
|
814 |
+
$this->getFkName('shipperhq_shipper/quote_package_items', 'package_id', 'shipperhq_shipper/quote_packages', 'package_id'),
|
815 |
+
'package_id',
|
816 |
+
$this->getTable('shipperhq_shipper/quote_packages'),
|
817 |
+
'package_id',
|
818 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
819 |
+
)
|
820 |
+
;
|
821 |
+
$this->getConnection()->createTable($table);
|
822 |
+
}
|
823 |
+
|
824 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_packages'))) {
|
825 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_packages'));
|
826 |
+
|
827 |
+
$table
|
828 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
829 |
+
'primary' => true,
|
830 |
+
'nullable' => false,
|
831 |
+
'unsigned' => true,
|
832 |
+
'auto_increment' => true
|
833 |
+
))
|
834 |
+
->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
835 |
+
'nullable' => false,
|
836 |
+
'unsigned' => true
|
837 |
+
))
|
838 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
839 |
+
'nullable' => false,
|
840 |
+
))
|
841 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
842 |
+
'nullable' => false,
|
843 |
+
))
|
844 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
845 |
+
'nullable' => true
|
846 |
+
))
|
847 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
848 |
+
'nullable' => true
|
849 |
+
))
|
850 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
851 |
+
'nullable' => true
|
852 |
+
))
|
853 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
854 |
+
'nullable' => true
|
855 |
+
))
|
856 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
857 |
+
'nullable' => true
|
858 |
+
))
|
859 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
860 |
+
'nullable' => true
|
861 |
+
))
|
862 |
+
->addForeignKey(
|
863 |
+
$this->getFkName('shipperhq_shipper/order_packages', 'order_id', 'sales/order', 'entity_id'),
|
864 |
+
'order_id',
|
865 |
+
$this->getTable('sales/order'),
|
866 |
+
'entity_id',
|
867 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
868 |
+
)
|
869 |
+
;
|
870 |
+
$this->getConnection()->createTable($table);
|
871 |
+
}
|
872 |
+
|
873 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_package_items'))) {
|
874 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_package_items'));
|
875 |
+
|
876 |
+
$table
|
877 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
878 |
+
'nullable' => false,
|
879 |
+
'unsigned' => true,
|
880 |
+
))
|
881 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
882 |
+
'nullable' => false,
|
883 |
+
))
|
884 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
885 |
+
'nullable' => true
|
886 |
+
))
|
887 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
888 |
+
'nullable' => true
|
889 |
+
))
|
890 |
+
->addForeignKey(
|
891 |
+
$this->getFkName('shipperhq_shipper/order_package_items', 'package_id', 'shipperhq_shipper/order_packages', 'package_id'),
|
892 |
+
'package_id',
|
893 |
+
$this->getTable('shipperhq_shipper/order_packages'),
|
894 |
+
'package_id',
|
895 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
896 |
+
)
|
897 |
+
;
|
898 |
+
$this->getConnection()->createTable($table);
|
899 |
+
}
|
900 |
+
|
901 |
+
/**
|
902 |
+
* We use this for some of the EE layout updates
|
903 |
+
*/
|
904 |
+
$isEnterprise = Mage::helper('wsalogger')->isEnterpriseEdition();
|
905 |
+
|
906 |
+
if($isEnterprise) {
|
907 |
+
$config = new Mage_Core_Model_Config();
|
908 |
+
$config->saveConfig('carriers/shipper/is_enterprise', "1", 'default', 0);
|
909 |
+
}
|
910 |
+
|
911 |
+
$installer->endSetup();
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.32.php
ADDED
@@ -0,0 +1,911 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
|
7 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/attributeupdate'))) {
|
8 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/attributeupdate'));
|
9 |
+
|
10 |
+
$table
|
11 |
+
->addColumn('synch_id', Varien_Db_Ddl_Table::TYPE_INTEGER, NULL, array(
|
12 |
+
'primary' => true,
|
13 |
+
'nullable' => false,
|
14 |
+
'unsigned' => true,
|
15 |
+
'auto_increment' => true
|
16 |
+
))
|
17 |
+
->addColumn('notification_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 0, array(
|
18 |
+
'nullable' => false,
|
19 |
+
'unsigned' => true,
|
20 |
+
))
|
21 |
+
->addColumn('attribute_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
22 |
+
'nullable' => false,
|
23 |
+
))
|
24 |
+
->addColumn('attribute_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
25 |
+
'nullable' => false,
|
26 |
+
))
|
27 |
+
->addColumn('value', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
28 |
+
'nullable' => false,
|
29 |
+
))
|
30 |
+
->addColumn('status', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
31 |
+
'nullable' => false,
|
32 |
+
))
|
33 |
+
->addColumn('date_added', Varien_Db_Ddl_Table::TYPE_DATETIME, NULL, array(
|
34 |
+
'nullable' => false,
|
35 |
+
))
|
36 |
+
;
|
37 |
+
$this->getConnection()->createTable($table);
|
38 |
+
}
|
39 |
+
|
40 |
+
/* ------ shipperhq_shipping_group -------- */
|
41 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_group', array(
|
42 |
+
'type' => 'varchar',
|
43 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
44 |
+
'input' => 'multiselect',
|
45 |
+
'label' => 'Shipping Group',
|
46 |
+
'global' => false,
|
47 |
+
'visible' => 1,
|
48 |
+
'required' => 0,
|
49 |
+
'visible_on_front' => 0,
|
50 |
+
'is_html_allowed_on_front' => 0,
|
51 |
+
'searchable' => 0,
|
52 |
+
'filterable' => 0,
|
53 |
+
'comparable' => 0,
|
54 |
+
'is_configurable' => 0,
|
55 |
+
'unique' => false,
|
56 |
+
'user_defined' => false,
|
57 |
+
'used_in_product_listing' => false
|
58 |
+
));
|
59 |
+
|
60 |
+
/* ------ shipperhq_warehouse -------- */
|
61 |
+
$this->addAttribute('catalog_product', 'shipperhq_warehouse', array(
|
62 |
+
'type' => 'text',
|
63 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
64 |
+
'input' => 'multiselect',
|
65 |
+
'label' => 'Origin',
|
66 |
+
'global' => false,
|
67 |
+
'visible' => 1,
|
68 |
+
'required' => 0,
|
69 |
+
'visible_on_front' => 0,
|
70 |
+
'is_html_allowed_on_front' => 0,
|
71 |
+
'searchable' => 0,
|
72 |
+
'filterable' => 0,
|
73 |
+
'comparable' => 0,
|
74 |
+
'is_configurable' => 0,
|
75 |
+
'unique' => false,
|
76 |
+
'user_defined' => false,
|
77 |
+
'used_in_product_listing' => false
|
78 |
+
));
|
79 |
+
|
80 |
+
/* ------ shipperhq_shipping_qty -------- */
|
81 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_qty', array(
|
82 |
+
'type' => 'int',
|
83 |
+
'input' => 'text',
|
84 |
+
'label' => 'Shipping Qty',
|
85 |
+
'global' => false,
|
86 |
+
'visible' => 1,
|
87 |
+
'required' => 0,
|
88 |
+
'visible_on_front' => 0,
|
89 |
+
'is_html_allowed_on_front' => 0,
|
90 |
+
'searchable' => 0,
|
91 |
+
'filterable' => 0,
|
92 |
+
'comparable' => 0,
|
93 |
+
'unique' => false,
|
94 |
+
'user_defined' => true,
|
95 |
+
'used_in_product_listing' => false
|
96 |
+
));
|
97 |
+
|
98 |
+
/* ------ shipperhq_shipping_fee -------- */
|
99 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_fee', array(
|
100 |
+
'type' => 'decimal',
|
101 |
+
'input' => 'price',
|
102 |
+
'label' => 'Shipping Fee',
|
103 |
+
'global' => false,
|
104 |
+
'visible' => 1,
|
105 |
+
'required' => 0,
|
106 |
+
'visible_on_front' => 0,
|
107 |
+
'is_html_allowed_on_front' => 0,
|
108 |
+
'searchable' => 0,
|
109 |
+
'filterable' => 0,
|
110 |
+
'comparable' => 0,
|
111 |
+
'unique' => false,
|
112 |
+
'user_defined' => true,
|
113 |
+
'used_in_product_listing' => false
|
114 |
+
));
|
115 |
+
|
116 |
+
/* ------ shipperhq_additional_price -------- */
|
117 |
+
$this->addAttribute('catalog_product', 'shipperhq_additional_price', array(
|
118 |
+
'type' => 'decimal',
|
119 |
+
'input' => 'price',
|
120 |
+
'label' => 'Additional Price',
|
121 |
+
'global' => false,
|
122 |
+
'visible' => 1,
|
123 |
+
'required' => 0,
|
124 |
+
'visible_on_front' => 0,
|
125 |
+
'is_html_allowed_on_front' => 0,
|
126 |
+
'searchable' => 0,
|
127 |
+
'filterable' => 0,
|
128 |
+
'comparable' => 0,
|
129 |
+
'unique' => false,
|
130 |
+
'user_defined' => true,
|
131 |
+
'used_in_product_listing' => false
|
132 |
+
));
|
133 |
+
|
134 |
+
/* ------ shipperhq_handling_fee -------- */
|
135 |
+
$this->addAttribute('catalog_product', 'shipperhq_handling_fee', array(
|
136 |
+
'type' => 'decimal',
|
137 |
+
'input' => 'price',
|
138 |
+
'label' => 'Handling Fee',
|
139 |
+
'global' => false,
|
140 |
+
'visible' => 1,
|
141 |
+
'required' => 0,
|
142 |
+
'visible_on_front' => 0,
|
143 |
+
'is_html_allowed_on_front' => 0,
|
144 |
+
'searchable' => 0,
|
145 |
+
'filterable' => 0,
|
146 |
+
'comparable' => 0,
|
147 |
+
'unique' => false,
|
148 |
+
'user_defined' => true,
|
149 |
+
'used_in_product_listing' => false
|
150 |
+
));
|
151 |
+
|
152 |
+
/* ------ shipperhq_carrier_code -------- */
|
153 |
+
$this->addAttribute('catalog_product', 'shipperhq_carrier_code', array(
|
154 |
+
'type' => 'text',
|
155 |
+
'input' => 'text',
|
156 |
+
'label' => 'Carrier Code',
|
157 |
+
'global' => false,
|
158 |
+
'visible' => 1,
|
159 |
+
'required' => 0,
|
160 |
+
'visible_on_front' => 0,
|
161 |
+
'is_html_allowed_on_front' => 0,
|
162 |
+
'searchable' => 0,
|
163 |
+
'filterable' => 0,
|
164 |
+
'comparable' => 0,
|
165 |
+
'unique' => false,
|
166 |
+
'user_defined' => true,
|
167 |
+
'used_in_product_listing' => false
|
168 |
+
));
|
169 |
+
|
170 |
+
/* ------ shipperhq_volume_weight -------- */
|
171 |
+
$this->addAttribute('catalog_product', 'shipperhq_volume_weight', array(
|
172 |
+
'type' => 'decimal',
|
173 |
+
'input' => 'text',
|
174 |
+
'label' => 'Volume Weight',
|
175 |
+
'global' => false,
|
176 |
+
'visible' => 1,
|
177 |
+
'required' => 0,
|
178 |
+
'visible_on_front' => 0,
|
179 |
+
'is_html_allowed_on_front' => 0,
|
180 |
+
'searchable' => 0,
|
181 |
+
'filterable' => 0,
|
182 |
+
'comparable' => 0,
|
183 |
+
'unique' => false,
|
184 |
+
'user_defined' => true,
|
185 |
+
'used_in_product_listing' => false,
|
186 |
+
'note' => 'This value is only used in conjunction with shipping filters'
|
187 |
+
));
|
188 |
+
|
189 |
+
/* ------ shipperhq_declared_value -------- */
|
190 |
+
$this->addAttribute('catalog_product', 'shipperhq_declared_value', array(
|
191 |
+
'type' => 'decimal',
|
192 |
+
'input' => 'price',
|
193 |
+
'label' => 'Declared Value',
|
194 |
+
'global' => false,
|
195 |
+
'visible' => 1,
|
196 |
+
'required' => 0,
|
197 |
+
'visible_on_front' => 0,
|
198 |
+
'is_html_allowed_on_front' => 0,
|
199 |
+
'searchable' => 0,
|
200 |
+
'filterable' => 0,
|
201 |
+
'comparable' => 0,
|
202 |
+
'unique' => false,
|
203 |
+
'user_defined' => true,
|
204 |
+
'used_in_product_listing' => false,
|
205 |
+
'note' => 'The deemed cost of this product for customs & insurance purposes'
|
206 |
+
));
|
207 |
+
|
208 |
+
/* ------ ship_separately -------- */
|
209 |
+
$this->addAttribute('catalog_product', 'ship_separately', array(
|
210 |
+
'type' => 'int',
|
211 |
+
'input' => 'boolean',
|
212 |
+
'label' => 'Ship Separately',
|
213 |
+
'global' => false,
|
214 |
+
'visible' => 1,
|
215 |
+
'required' => 0,
|
216 |
+
'visible_on_front' => 0,
|
217 |
+
'is_html_allowed_on_front' => 0,
|
218 |
+
'searchable' => 0,
|
219 |
+
'filterable' => 0,
|
220 |
+
'comparable' => 0,
|
221 |
+
'unique' => false,
|
222 |
+
'user_defined' => true,
|
223 |
+
'used_in_product_listing' => false
|
224 |
+
));
|
225 |
+
|
226 |
+
/* ------ shipperhq_dim_group -------- */
|
227 |
+
$this->addAttribute('catalog_product', 'shipperhq_dim_group', array(
|
228 |
+
'type' => 'varchar',
|
229 |
+
'input' => 'select',
|
230 |
+
'label' => 'ShipperHQ Dimensional Rule Group',
|
231 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
232 |
+
'global' => false,
|
233 |
+
'visible' => 1,
|
234 |
+
'required' => 0,
|
235 |
+
'visible_on_front' => 0,
|
236 |
+
'is_html_allowed_on_front' => 0,
|
237 |
+
'searchable' => 0,
|
238 |
+
'filterable' => 0,
|
239 |
+
'comparable' => 0,
|
240 |
+
'is_configurable' => 0,
|
241 |
+
'unique' => false,
|
242 |
+
'user_defined' => true,
|
243 |
+
'used_in_product_listing' => false
|
244 |
+
));
|
245 |
+
|
246 |
+
/* ------ ship_length -------- */
|
247 |
+
$this->addAttribute('catalog_product', 'ship_length', array(
|
248 |
+
'type' => 'decimal',
|
249 |
+
'input' => 'text',
|
250 |
+
'label' => 'Dimension Length',
|
251 |
+
'global' => false,
|
252 |
+
'visible' => 1,
|
253 |
+
'required' => 0,
|
254 |
+
'visible_on_front' => 0,
|
255 |
+
'is_html_allowed_on_front' => 0,
|
256 |
+
'searchable' => 0,
|
257 |
+
'filterable' => 0,
|
258 |
+
'comparable' => 0,
|
259 |
+
'unique' => false,
|
260 |
+
'user_defined' => true,
|
261 |
+
'used_in_product_listing' => false
|
262 |
+
));
|
263 |
+
|
264 |
+
/* ------ ship_width -------- */
|
265 |
+
$this->addAttribute('catalog_product', 'ship_width', array(
|
266 |
+
'type' => 'decimal',
|
267 |
+
'input' => 'text',
|
268 |
+
'label' => 'Dimension Width',
|
269 |
+
'global' => false,
|
270 |
+
'visible' => 1,
|
271 |
+
'required' => 0,
|
272 |
+
'visible_on_front' => 0,
|
273 |
+
'is_html_allowed_on_front' => 0,
|
274 |
+
'searchable' => 0,
|
275 |
+
'filterable' => 0,
|
276 |
+
'comparable' => 0,
|
277 |
+
'unique' => false,
|
278 |
+
'user_defined' => true,
|
279 |
+
'used_in_product_listing' => false
|
280 |
+
));
|
281 |
+
|
282 |
+
/* ------ ship_height -------- */
|
283 |
+
$this->addAttribute('catalog_product', 'ship_height', array(
|
284 |
+
'type' => 'decimal',
|
285 |
+
'input' => 'text',
|
286 |
+
'label' => 'Dimension Height',
|
287 |
+
'global' => false,
|
288 |
+
'visible' => 1,
|
289 |
+
'required' => 0,
|
290 |
+
'visible_on_front' => 0,
|
291 |
+
'is_html_allowed_on_front' => 0,
|
292 |
+
'searchable' => 0,
|
293 |
+
'filterable' => 0,
|
294 |
+
'comparable' => 0,
|
295 |
+
'unique' => false,
|
296 |
+
'user_defined' => true,
|
297 |
+
'used_in_product_listing' => false
|
298 |
+
));
|
299 |
+
|
300 |
+
/* ------ shipperhq_poss_boxes -------- */
|
301 |
+
$this->addAttribute('catalog_product', 'shipperhq_poss_boxes', array(
|
302 |
+
'type' => 'varchar',
|
303 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
304 |
+
'input' => 'multiselect',
|
305 |
+
'label' => 'Possible Packing Boxes',
|
306 |
+
'global' => false,
|
307 |
+
'visible' => 1,
|
308 |
+
'required' => 0,
|
309 |
+
'visible_on_front' => 0,
|
310 |
+
'is_html_allowed_on_front' => 0,
|
311 |
+
'searchable' => 0,
|
312 |
+
'filterable' => 0,
|
313 |
+
'comparable' => 0,
|
314 |
+
'is_configurable' => 0,
|
315 |
+
'unique' => false,
|
316 |
+
'user_defined' => true,
|
317 |
+
'used_in_product_listing' => false
|
318 |
+
));
|
319 |
+
|
320 |
+
/* ------ ship_box_tolerance -------- */
|
321 |
+
$this->addAttribute('catalog_product', 'ship_box_tolerance', array(
|
322 |
+
'type' => 'int',
|
323 |
+
'input' => 'text',
|
324 |
+
'label' => 'Box Tolerance',
|
325 |
+
'global' => false,
|
326 |
+
'visible' => 1,
|
327 |
+
'required' => 0,
|
328 |
+
'visible_on_front' => 0,
|
329 |
+
'is_html_allowed_on_front' => 0,
|
330 |
+
'searchable' => 0,
|
331 |
+
'filterable' => 0,
|
332 |
+
'comparable' => 0,
|
333 |
+
'unique' => false,
|
334 |
+
'used_in_product_listing' => false,
|
335 |
+
'user_defined' => true,
|
336 |
+
'note' => 'Note: Ignore if unsure'
|
337 |
+
));
|
338 |
+
|
339 |
+
/* ------ shipperhq_malleable_product -------- */
|
340 |
+
$this->addAttribute('catalog_product', 'shipperhq_malleable_product', array(
|
341 |
+
'type' => 'int',
|
342 |
+
'input' => 'boolean',
|
343 |
+
'label' => 'Malleable Product',
|
344 |
+
'global' => false,
|
345 |
+
'visible' => 1,
|
346 |
+
'required' => 0,
|
347 |
+
'visible_on_front' => 0,
|
348 |
+
'is_html_allowed_on_front' => 0,
|
349 |
+
'searchable' => 0,
|
350 |
+
'filterable' => 0,
|
351 |
+
'comparable' => 0,
|
352 |
+
'unique' => false,
|
353 |
+
'user_defined' => true,
|
354 |
+
'note' => 'Ignore if unsure. Indicates the product dimensions can be adjusted to fit box',
|
355 |
+
'used_in_product_listing' => false
|
356 |
+
));
|
357 |
+
|
358 |
+
/* ------ shipperhq_master_boxes -------- */
|
359 |
+
$this->addAttribute('catalog_product', 'shipperhq_master_boxes', array(
|
360 |
+
'type' => 'varchar',
|
361 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
362 |
+
'input' => 'multiselect',
|
363 |
+
'label' => 'Master Packing Boxes',
|
364 |
+
'global' => false,
|
365 |
+
'visible' => 1,
|
366 |
+
'required' => 0,
|
367 |
+
'visible_on_front' => 0,
|
368 |
+
'is_html_allowed_on_front' => 0,
|
369 |
+
'searchable' => 0,
|
370 |
+
'filterable' => 0,
|
371 |
+
'comparable' => 0,
|
372 |
+
'is_configurable' => 0,
|
373 |
+
'unique' => false,
|
374 |
+
'user_defined' => true,
|
375 |
+
'used_in_product_listing' => false
|
376 |
+
));
|
377 |
+
|
378 |
+
/* ------ shipperhq_availability_date -------- */
|
379 |
+
$this->addAttribute('catalog_product', 'shipperhq_availability_date', array(
|
380 |
+
'type' => 'datetime',
|
381 |
+
'backend' => 'eav/entity_attribute_backend_datetime',
|
382 |
+
'input' => 'date',
|
383 |
+
'label' => 'Availability Date',
|
384 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
|
385 |
+
'visible' => 1,
|
386 |
+
'required' => 0,
|
387 |
+
'visible_on_front' => 0,
|
388 |
+
'is_html_allowed_on_front' => 0,
|
389 |
+
'searchable' => 0,
|
390 |
+
'filterable' => 0,
|
391 |
+
'comparable' => 0,
|
392 |
+
'is_configurable' => 0,
|
393 |
+
'unique' => false,
|
394 |
+
'user_defined' => true,
|
395 |
+
'used_in_product_listing' => false
|
396 |
+
));
|
397 |
+
|
398 |
+
/*
|
399 |
+
*
|
400 |
+
*
|
401 |
+
*
|
402 |
+
*/
|
403 |
+
|
404 |
+
$entityTypeId = $installer->getEntityTypeId('catalog_product');
|
405 |
+
|
406 |
+
$attributeSetArr = $installer->getAllAttributeSetIds($entityTypeId);
|
407 |
+
|
408 |
+
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Splitrates')) {
|
409 |
+
$stdAttributeCodes = array('shipperhq_shipping_group' => '1', 'shipperhq_warehouse' => '10');
|
410 |
+
}
|
411 |
+
else {
|
412 |
+
$stdAttributeCodes = array('shipperhq_shipping_group' => '1');
|
413 |
+
}
|
414 |
+
$dimAttributeCodes = array('ship_separately' => '2',
|
415 |
+
'shipperhq_dim_group' => '1',
|
416 |
+
'ship_length' => '10',
|
417 |
+
'ship_width' => '11',
|
418 |
+
'ship_height' => '12',
|
419 |
+
'shipperhq_poss_boxes' => '20',
|
420 |
+
);
|
421 |
+
|
422 |
+
foreach ($attributeSetArr as $attributeSetId) {
|
423 |
+
|
424 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Shipping', '99');
|
425 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Dimensional Shipping', '100');
|
426 |
+
|
427 |
+
$attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Shipping');
|
428 |
+
$dimAttributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Dimensional Shipping');
|
429 |
+
|
430 |
+
foreach($stdAttributeCodes as $code => $sort) {
|
431 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
432 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, $attributeId, $sort);
|
433 |
+
}
|
434 |
+
|
435 |
+
foreach($dimAttributeCodes as $code => $sort) {
|
436 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
437 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $dimAttributeGroupId, $attributeId, $sort);
|
438 |
+
}
|
439 |
+
|
440 |
+
};
|
441 |
+
|
442 |
+
|
443 |
+
|
444 |
+
$text = Mage::helper('wsalogger')->getNewVersion() > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text';
|
445 |
+
|
446 |
+
$isCheckout = array(
|
447 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
448 |
+
'comment' => 'Shipperhq Shipper',
|
449 |
+
'nullable' => 'false',
|
450 |
+
'default' => '0'
|
451 |
+
);
|
452 |
+
|
453 |
+
$carrierType = array(
|
454 |
+
'type' => $text,
|
455 |
+
'comment' => 'Shipperhq Carrier Type',
|
456 |
+
'nullable' => 'true',
|
457 |
+
);
|
458 |
+
|
459 |
+
$dispatchDate = array(
|
460 |
+
'type' => $text,
|
461 |
+
'length' => 20,
|
462 |
+
'comment' => 'Dispatch Date',
|
463 |
+
'nullable' => 'true');
|
464 |
+
|
465 |
+
$deliveryDate = array(
|
466 |
+
'type' => $text,
|
467 |
+
'length' => 20,
|
468 |
+
'comment' => 'Expected Delivery',
|
469 |
+
'nullable' => 'true');
|
470 |
+
|
471 |
+
$carrierNotice = array(
|
472 |
+
'type' => $text,
|
473 |
+
'comment' => 'Shipperhq Carrier Notice',
|
474 |
+
'nullable' => 'true',
|
475 |
+
);
|
476 |
+
|
477 |
+
$customDescription = array(
|
478 |
+
'type' => $text,
|
479 |
+
'comment' => 'Shipperhq Custom Description',
|
480 |
+
'nullable' => 'true',
|
481 |
+
);
|
482 |
+
|
483 |
+
$carrierId = array(
|
484 |
+
'type' => $text,
|
485 |
+
'length' => 20,
|
486 |
+
'comment' => 'Shipperhq Carrier ID',
|
487 |
+
'nullable' => 'true',
|
488 |
+
);
|
489 |
+
|
490 |
+
$customDuties = array(
|
491 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
|
492 |
+
'scale' => 4,
|
493 |
+
'precision' => 12,
|
494 |
+
'comment' => 'Shipperhq Custom Duties',
|
495 |
+
);
|
496 |
+
|
497 |
+
$confirmationNo = array(
|
498 |
+
'type' => $text,
|
499 |
+
'length' => 20,
|
500 |
+
'comment' => 'Shipperhq Confirmation Number',
|
501 |
+
'nullable' => 'true',
|
502 |
+
);
|
503 |
+
|
504 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'is_checkout')){
|
505 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'is_checkout', $isCheckout);
|
506 |
+
}
|
507 |
+
|
508 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_type')){
|
509 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carrier_type', $carrierType);
|
510 |
+
}
|
511 |
+
|
512 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'dispatch_date')){
|
513 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'dispatch_date', $dispatchDate );
|
514 |
+
}
|
515 |
+
|
516 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'delivery_date')){
|
517 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'delivery_date', $deliveryDate );
|
518 |
+
}
|
519 |
+
|
520 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type')){
|
521 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type', $carrierType);
|
522 |
+
}
|
523 |
+
|
524 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'dispatch_date')){
|
525 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'dispatch_date', $dispatchDate );
|
526 |
+
}
|
527 |
+
|
528 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'delivery_date')){
|
529 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'delivery_date', $deliveryDate );
|
530 |
+
}
|
531 |
+
|
532 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice')){
|
533 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice', $carrierNotice);
|
534 |
+
}
|
535 |
+
|
536 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description')){
|
537 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description', $customDescription);
|
538 |
+
}
|
539 |
+
|
540 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id')){
|
541 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id', $carrierId);
|
542 |
+
}
|
543 |
+
|
544 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_id')){
|
545 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'carrier_id', $carrierId );
|
546 |
+
}
|
547 |
+
|
548 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_id')){
|
549 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_id', $carrierId );
|
550 |
+
}
|
551 |
+
|
552 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'confirmation_number')){
|
553 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'confirmation_number', $confirmationNo );
|
554 |
+
}
|
555 |
+
|
556 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties')){
|
557 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties', $customDuties);
|
558 |
+
}
|
559 |
+
|
560 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_type')){
|
561 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_type', $carrierType );
|
562 |
+
}
|
563 |
+
|
564 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'dispatch_date')){
|
565 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'dispatch_date', $dispatchDate );
|
566 |
+
}
|
567 |
+
|
568 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'delivery_date')){
|
569 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'delivery_date', $deliveryDate );
|
570 |
+
}
|
571 |
+
else {
|
572 |
+
$installer->getConnection()->modifyColumn(
|
573 |
+
$installer->getTable('sales/order'),
|
574 |
+
'delivery_date',
|
575 |
+
array(
|
576 |
+
'type' => $text,
|
577 |
+
'length' => 20,
|
578 |
+
'comment' => 'Expected Delivery',
|
579 |
+
'nullable' => 'true'
|
580 |
+
)
|
581 |
+
);
|
582 |
+
}
|
583 |
+
|
584 |
+
/*carrier group attributes*/
|
585 |
+
$version = Mage::helper('wsalogger')->getNewVersion();
|
586 |
+
|
587 |
+
$carriergroupAttr = array(
|
588 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
589 |
+
'comment' => 'Carrier Group',
|
590 |
+
'nullable' => 'true',
|
591 |
+
);
|
592 |
+
|
593 |
+
$carriergroupID = array(
|
594 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
595 |
+
'comment' => 'Carrier Group ID',
|
596 |
+
'nullable' => 'true',
|
597 |
+
);
|
598 |
+
|
599 |
+
$carriergroupDetails = array(
|
600 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
601 |
+
'comment' => 'Carrier Group Details',
|
602 |
+
'nullable' => 'true',
|
603 |
+
);
|
604 |
+
|
605 |
+
$carriergroupHtml = array(
|
606 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
607 |
+
'comment' => 'Carrier Group Html',
|
608 |
+
'nullable' => 'true',
|
609 |
+
);
|
610 |
+
|
611 |
+
$displayMerged = array(
|
612 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
613 |
+
'comment' => 'Checkout display type',
|
614 |
+
'nullable' => 'false',
|
615 |
+
'default' => '1'
|
616 |
+
);
|
617 |
+
|
618 |
+
$splitRates = array(
|
619 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
620 |
+
'comment' => 'Shipperhq Split Rates',
|
621 |
+
'nullable' => 'false',
|
622 |
+
'default' => '0'
|
623 |
+
);
|
624 |
+
|
625 |
+
$carriergroupShipping = array(
|
626 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
627 |
+
'comment' => 'Shipping Description',
|
628 |
+
'nullable' => 'true',
|
629 |
+
);
|
630 |
+
|
631 |
+
$destinationTypeAttr = array(
|
632 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text',
|
633 |
+
'comment' => 'ShipperHQ Address Type',
|
634 |
+
'nullable' => 'true',
|
635 |
+
);
|
636 |
+
|
637 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'destination_type')){
|
638 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'destination_type',$destinationTypeAttr);
|
639 |
+
}
|
640 |
+
|
641 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'destination_type')){
|
642 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'destination_type',$destinationTypeAttr);
|
643 |
+
}
|
644 |
+
|
645 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details')){
|
646 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details', $carriergroupDetails);
|
647 |
+
}
|
648 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html')){
|
649 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html', $carriergroupHtml);
|
650 |
+
}
|
651 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'checkout_display_merged')){
|
652 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'checkout_display_merged', $displayMerged);
|
653 |
+
}
|
654 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'split_rates')){
|
655 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'split_rates', $splitRates);
|
656 |
+
}
|
657 |
+
|
658 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id')){
|
659 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id', $carriergroupID);
|
660 |
+
}
|
661 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup')){
|
662 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup', $carriergroupAttr);
|
663 |
+
}
|
664 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details')){
|
665 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details', $carriergroupDetails);
|
666 |
+
}
|
667 |
+
|
668 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup')){
|
669 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup', $carriergroupAttr);
|
670 |
+
}
|
671 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup')){
|
672 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup', $carriergroupAttr);
|
673 |
+
}
|
674 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_id')){
|
675 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_id', $carriergroupID);
|
676 |
+
}
|
677 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_id')){
|
678 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_id', $carriergroupID);
|
679 |
+
}
|
680 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_shipping')){
|
681 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_shipping', $carriergroupShipping);
|
682 |
+
}
|
683 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_shipping')){
|
684 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_shipping', $carriergroupShipping);
|
685 |
+
}
|
686 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping')){
|
687 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping', $carriergroupShipping);
|
688 |
+
}
|
689 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup')){
|
690 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup', $carriergroupAttr);
|
691 |
+
}
|
692 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_id')){
|
693 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_id', $carriergroupID);
|
694 |
+
}
|
695 |
+
|
696 |
+
|
697 |
+
if (Mage::helper('wsalogger')->getNewVersion() >= 8) {
|
698 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment_grid'), 'carriergroup')){
|
699 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment_grid'),'carriergroup',$carriergroupAttr);
|
700 |
+
}
|
701 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'carriergroup')){
|
702 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'carriergroup',$carriergroupAttr);
|
703 |
+
}
|
704 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'shipping_description')){
|
705 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'shipping_description',array(
|
706 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
707 |
+
'length' => 255,
|
708 |
+
'comment' => 'Shipping Description',
|
709 |
+
'nullable' => 'true',));
|
710 |
+
}
|
711 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_html')){
|
712 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_html', $carriergroupHtml);
|
713 |
+
}
|
714 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_details')){
|
715 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_details', $carriergroupDetails);
|
716 |
+
}
|
717 |
+
if (Mage::helper('wsalogger')->isEnterpriseEdition() && $installer->tableExists('enterprise_sales_shipment_grid_archive')) {
|
718 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('enterprise_sales_shipment_grid_archive'), 'carriergroup')){
|
719 |
+
$installer->getConnection()->addColumn($installer->getTable('enterprise_sales_shipment_grid_archive'),'carriergroup',$carriergroupAttr);
|
720 |
+
}
|
721 |
+
}
|
722 |
+
}
|
723 |
+
|
724 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/storage'))) {
|
725 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/storage'));
|
726 |
+
|
727 |
+
$table
|
728 |
+
->addColumn('quote_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
729 |
+
'primary' => true,
|
730 |
+
'nullable' => false,
|
731 |
+
'unsigned' => true
|
732 |
+
))
|
733 |
+
->addColumn('data', Varien_Db_Ddl_Table::TYPE_TEXT, '512k', array('nullable' => false))
|
734 |
+
->addForeignKey(
|
735 |
+
$this->getFkName('shipperhq_shipper/storage', 'quote_id', 'sales/quote', 'entity_id'),
|
736 |
+
'quote_id',
|
737 |
+
$this->getTable('sales/quote'),
|
738 |
+
'entity_id',
|
739 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
740 |
+
)
|
741 |
+
;
|
742 |
+
$this->getConnection()->createTable($table);
|
743 |
+
}
|
744 |
+
|
745 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_packages'))) {
|
746 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_packages'));
|
747 |
+
|
748 |
+
$table
|
749 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
750 |
+
'primary' => true,
|
751 |
+
'nullable' => false,
|
752 |
+
'unsigned' => true,
|
753 |
+
'auto_increment' => true
|
754 |
+
))
|
755 |
+
->addColumn('address_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
756 |
+
'nullable' => false,
|
757 |
+
'unsigned' => true
|
758 |
+
))
|
759 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
760 |
+
'nullable' => false,
|
761 |
+
))
|
762 |
+
->addColumn('carrier_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
763 |
+
'nullable' => false,
|
764 |
+
))
|
765 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
766 |
+
'nullable' => false,
|
767 |
+
))
|
768 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
769 |
+
'nullable' => true
|
770 |
+
))
|
771 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
772 |
+
'nullable' => true
|
773 |
+
))
|
774 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
775 |
+
'nullable' => true
|
776 |
+
))
|
777 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
778 |
+
'nullable' => true
|
779 |
+
))
|
780 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
781 |
+
'nullable' => true
|
782 |
+
))
|
783 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
784 |
+
'nullable' => true
|
785 |
+
))
|
786 |
+
->addForeignKey(
|
787 |
+
$this->getFkName('shipperhq_shipper/quote_packages', 'address_id', 'sales/quote_address', 'address_id'),
|
788 |
+
'address_id',
|
789 |
+
$this->getTable('sales/quote_address'),
|
790 |
+
'address_id',
|
791 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
792 |
+
)
|
793 |
+
;
|
794 |
+
$this->getConnection()->createTable($table);
|
795 |
+
}
|
796 |
+
|
797 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_package_items'))) {
|
798 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_package_items'));
|
799 |
+
|
800 |
+
$table
|
801 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
802 |
+
'nullable' => false,
|
803 |
+
))
|
804 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
805 |
+
'nullable' => false,
|
806 |
+
))
|
807 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
808 |
+
'nullable' => true
|
809 |
+
))
|
810 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
811 |
+
'nullable' => true
|
812 |
+
))
|
813 |
+
->addForeignKey(
|
814 |
+
$this->getFkName('shipperhq_shipper/quote_package_items', 'package_id', 'shipperhq_shipper/quote_packages', 'package_id'),
|
815 |
+
'package_id',
|
816 |
+
$this->getTable('shipperhq_shipper/quote_packages'),
|
817 |
+
'package_id',
|
818 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
819 |
+
)
|
820 |
+
;
|
821 |
+
$this->getConnection()->createTable($table);
|
822 |
+
}
|
823 |
+
|
824 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_packages'))) {
|
825 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_packages'));
|
826 |
+
|
827 |
+
$table
|
828 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
829 |
+
'primary' => true,
|
830 |
+
'nullable' => false,
|
831 |
+
'unsigned' => true,
|
832 |
+
'auto_increment' => true
|
833 |
+
))
|
834 |
+
->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
835 |
+
'nullable' => false,
|
836 |
+
'unsigned' => true
|
837 |
+
))
|
838 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
839 |
+
'nullable' => false,
|
840 |
+
))
|
841 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
842 |
+
'nullable' => false,
|
843 |
+
))
|
844 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
845 |
+
'nullable' => true
|
846 |
+
))
|
847 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
848 |
+
'nullable' => true
|
849 |
+
))
|
850 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
851 |
+
'nullable' => true
|
852 |
+
))
|
853 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
854 |
+
'nullable' => true
|
855 |
+
))
|
856 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
857 |
+
'nullable' => true
|
858 |
+
))
|
859 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
860 |
+
'nullable' => true
|
861 |
+
))
|
862 |
+
->addForeignKey(
|
863 |
+
$this->getFkName('shipperhq_shipper/order_packages', 'order_id', 'sales/order', 'entity_id'),
|
864 |
+
'order_id',
|
865 |
+
$this->getTable('sales/order'),
|
866 |
+
'entity_id',
|
867 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
868 |
+
)
|
869 |
+
;
|
870 |
+
$this->getConnection()->createTable($table);
|
871 |
+
}
|
872 |
+
|
873 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_package_items'))) {
|
874 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_package_items'));
|
875 |
+
|
876 |
+
$table
|
877 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
878 |
+
'nullable' => false,
|
879 |
+
'unsigned' => true,
|
880 |
+
))
|
881 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
882 |
+
'nullable' => false,
|
883 |
+
))
|
884 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
885 |
+
'nullable' => true
|
886 |
+
))
|
887 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
888 |
+
'nullable' => true
|
889 |
+
))
|
890 |
+
->addForeignKey(
|
891 |
+
$this->getFkName('shipperhq_shipper/order_package_items', 'package_id', 'shipperhq_shipper/order_packages', 'package_id'),
|
892 |
+
'package_id',
|
893 |
+
$this->getTable('shipperhq_shipper/order_packages'),
|
894 |
+
'package_id',
|
895 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
896 |
+
)
|
897 |
+
;
|
898 |
+
$this->getConnection()->createTable($table);
|
899 |
+
}
|
900 |
+
|
901 |
+
/**
|
902 |
+
* We use this for some of the EE layout updates
|
903 |
+
*/
|
904 |
+
$isEnterprise = Mage::helper('wsalogger')->isEnterpriseEdition();
|
905 |
+
|
906 |
+
if($isEnterprise) {
|
907 |
+
$config = new Mage_Core_Model_Config();
|
908 |
+
$config->saveConfig('carriers/shipper/is_enterprise', "1", 'default', 0);
|
909 |
+
}
|
910 |
+
|
911 |
+
$installer->endSetup();
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.33.php
ADDED
@@ -0,0 +1,925 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
|
7 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/attributeupdate'))) {
|
8 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/attributeupdate'));
|
9 |
+
|
10 |
+
$table
|
11 |
+
->addColumn('synch_id', Varien_Db_Ddl_Table::TYPE_INTEGER, NULL, array(
|
12 |
+
'primary' => true,
|
13 |
+
'nullable' => false,
|
14 |
+
'unsigned' => true,
|
15 |
+
'auto_increment' => true
|
16 |
+
))
|
17 |
+
->addColumn('notification_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 0, array(
|
18 |
+
'nullable' => false,
|
19 |
+
'unsigned' => true,
|
20 |
+
))
|
21 |
+
->addColumn('attribute_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
22 |
+
'nullable' => false,
|
23 |
+
))
|
24 |
+
->addColumn('attribute_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
25 |
+
'nullable' => false,
|
26 |
+
))
|
27 |
+
->addColumn('value', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
28 |
+
'nullable' => false,
|
29 |
+
))
|
30 |
+
->addColumn('status', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
31 |
+
'nullable' => false,
|
32 |
+
))
|
33 |
+
->addColumn('date_added', Varien_Db_Ddl_Table::TYPE_DATETIME, NULL, array(
|
34 |
+
'nullable' => false,
|
35 |
+
))
|
36 |
+
;
|
37 |
+
$this->getConnection()->createTable($table);
|
38 |
+
}
|
39 |
+
|
40 |
+
/* ------ shipperhq_shipping_group -------- */
|
41 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_group', array(
|
42 |
+
'type' => 'varchar',
|
43 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
44 |
+
'input' => 'multiselect',
|
45 |
+
'label' => 'Shipping Group',
|
46 |
+
'global' => false,
|
47 |
+
'visible' => 1,
|
48 |
+
'required' => 0,
|
49 |
+
'visible_on_front' => 0,
|
50 |
+
'is_html_allowed_on_front' => 0,
|
51 |
+
'searchable' => 0,
|
52 |
+
'filterable' => 0,
|
53 |
+
'comparable' => 0,
|
54 |
+
'is_configurable' => 0,
|
55 |
+
'unique' => false,
|
56 |
+
'user_defined' => false,
|
57 |
+
'used_in_product_listing' => false
|
58 |
+
));
|
59 |
+
|
60 |
+
/* ------ shipperhq_warehouse -------- */
|
61 |
+
$this->addAttribute('catalog_product', 'shipperhq_warehouse', array(
|
62 |
+
'type' => 'text',
|
63 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
64 |
+
'input' => 'multiselect',
|
65 |
+
'label' => 'Origin',
|
66 |
+
'global' => false,
|
67 |
+
'visible' => 1,
|
68 |
+
'required' => 0,
|
69 |
+
'visible_on_front' => 0,
|
70 |
+
'is_html_allowed_on_front' => 0,
|
71 |
+
'searchable' => 0,
|
72 |
+
'filterable' => 0,
|
73 |
+
'comparable' => 0,
|
74 |
+
'is_configurable' => 0,
|
75 |
+
'unique' => false,
|
76 |
+
'user_defined' => false,
|
77 |
+
'used_in_product_listing' => false
|
78 |
+
));
|
79 |
+
|
80 |
+
/* ------ shipperhq_shipping_qty -------- */
|
81 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_qty', array(
|
82 |
+
'type' => 'int',
|
83 |
+
'input' => 'text',
|
84 |
+
'label' => 'Shipping Qty',
|
85 |
+
'global' => false,
|
86 |
+
'visible' => 1,
|
87 |
+
'required' => 0,
|
88 |
+
'visible_on_front' => 0,
|
89 |
+
'is_html_allowed_on_front' => 0,
|
90 |
+
'searchable' => 0,
|
91 |
+
'filterable' => 0,
|
92 |
+
'comparable' => 0,
|
93 |
+
'unique' => false,
|
94 |
+
'user_defined' => true,
|
95 |
+
'used_in_product_listing' => false
|
96 |
+
));
|
97 |
+
|
98 |
+
/* ------ shipperhq_shipping_fee -------- */
|
99 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_fee', array(
|
100 |
+
'type' => 'decimal',
|
101 |
+
'input' => 'price',
|
102 |
+
'label' => 'Shipping Fee',
|
103 |
+
'global' => false,
|
104 |
+
'visible' => 1,
|
105 |
+
'required' => 0,
|
106 |
+
'visible_on_front' => 0,
|
107 |
+
'is_html_allowed_on_front' => 0,
|
108 |
+
'searchable' => 0,
|
109 |
+
'filterable' => 0,
|
110 |
+
'comparable' => 0,
|
111 |
+
'unique' => false,
|
112 |
+
'user_defined' => true,
|
113 |
+
'used_in_product_listing' => false
|
114 |
+
));
|
115 |
+
|
116 |
+
/* ------ shipperhq_additional_price -------- */
|
117 |
+
$this->addAttribute('catalog_product', 'shipperhq_additional_price', array(
|
118 |
+
'type' => 'decimal',
|
119 |
+
'input' => 'price',
|
120 |
+
'label' => 'Additional Price',
|
121 |
+
'global' => false,
|
122 |
+
'visible' => 1,
|
123 |
+
'required' => 0,
|
124 |
+
'visible_on_front' => 0,
|
125 |
+
'is_html_allowed_on_front' => 0,
|
126 |
+
'searchable' => 0,
|
127 |
+
'filterable' => 0,
|
128 |
+
'comparable' => 0,
|
129 |
+
'unique' => false,
|
130 |
+
'user_defined' => true,
|
131 |
+
'used_in_product_listing' => false
|
132 |
+
));
|
133 |
+
|
134 |
+
/* ------ shipperhq_handling_fee -------- */
|
135 |
+
$this->addAttribute('catalog_product', 'shipperhq_handling_fee', array(
|
136 |
+
'type' => 'decimal',
|
137 |
+
'input' => 'price',
|
138 |
+
'label' => 'Handling Fee',
|
139 |
+
'global' => false,
|
140 |
+
'visible' => 1,
|
141 |
+
'required' => 0,
|
142 |
+
'visible_on_front' => 0,
|
143 |
+
'is_html_allowed_on_front' => 0,
|
144 |
+
'searchable' => 0,
|
145 |
+
'filterable' => 0,
|
146 |
+
'comparable' => 0,
|
147 |
+
'unique' => false,
|
148 |
+
'user_defined' => true,
|
149 |
+
'used_in_product_listing' => false
|
150 |
+
));
|
151 |
+
|
152 |
+
/* ------ shipperhq_carrier_code -------- */
|
153 |
+
$this->addAttribute('catalog_product', 'shipperhq_carrier_code', array(
|
154 |
+
'type' => 'text',
|
155 |
+
'input' => 'text',
|
156 |
+
'label' => 'Carrier Code',
|
157 |
+
'global' => false,
|
158 |
+
'visible' => 1,
|
159 |
+
'required' => 0,
|
160 |
+
'visible_on_front' => 0,
|
161 |
+
'is_html_allowed_on_front' => 0,
|
162 |
+
'searchable' => 0,
|
163 |
+
'filterable' => 0,
|
164 |
+
'comparable' => 0,
|
165 |
+
'unique' => false,
|
166 |
+
'user_defined' => true,
|
167 |
+
'used_in_product_listing' => false
|
168 |
+
));
|
169 |
+
|
170 |
+
/* ------ shipperhq_volume_weight -------- */
|
171 |
+
$this->addAttribute('catalog_product', 'shipperhq_volume_weight', array(
|
172 |
+
'type' => 'decimal',
|
173 |
+
'input' => 'text',
|
174 |
+
'label' => 'Volume Weight',
|
175 |
+
'global' => false,
|
176 |
+
'visible' => 1,
|
177 |
+
'required' => 0,
|
178 |
+
'visible_on_front' => 0,
|
179 |
+
'is_html_allowed_on_front' => 0,
|
180 |
+
'searchable' => 0,
|
181 |
+
'filterable' => 0,
|
182 |
+
'comparable' => 0,
|
183 |
+
'unique' => false,
|
184 |
+
'user_defined' => true,
|
185 |
+
'used_in_product_listing' => false,
|
186 |
+
'note' => 'This value is only used in conjunction with shipping filters'
|
187 |
+
));
|
188 |
+
|
189 |
+
/* ------ shipperhq_declared_value -------- */
|
190 |
+
$this->addAttribute('catalog_product', 'shipperhq_declared_value', array(
|
191 |
+
'type' => 'decimal',
|
192 |
+
'input' => 'price',
|
193 |
+
'label' => 'Declared Value',
|
194 |
+
'global' => false,
|
195 |
+
'visible' => 1,
|
196 |
+
'required' => 0,
|
197 |
+
'visible_on_front' => 0,
|
198 |
+
'is_html_allowed_on_front' => 0,
|
199 |
+
'searchable' => 0,
|
200 |
+
'filterable' => 0,
|
201 |
+
'comparable' => 0,
|
202 |
+
'unique' => false,
|
203 |
+
'user_defined' => true,
|
204 |
+
'used_in_product_listing' => false,
|
205 |
+
'note' => 'The deemed cost of this product for customs & insurance purposes'
|
206 |
+
));
|
207 |
+
|
208 |
+
/* ------ ship_separately -------- */
|
209 |
+
$this->addAttribute('catalog_product', 'ship_separately', array(
|
210 |
+
'type' => 'int',
|
211 |
+
'input' => 'boolean',
|
212 |
+
'label' => 'Ship Separately',
|
213 |
+
'global' => false,
|
214 |
+
'visible' => 1,
|
215 |
+
'required' => 0,
|
216 |
+
'visible_on_front' => 0,
|
217 |
+
'is_html_allowed_on_front' => 0,
|
218 |
+
'searchable' => 0,
|
219 |
+
'filterable' => 0,
|
220 |
+
'comparable' => 0,
|
221 |
+
'unique' => false,
|
222 |
+
'user_defined' => true,
|
223 |
+
'used_in_product_listing' => false
|
224 |
+
));
|
225 |
+
|
226 |
+
/* ------ shipperhq_dim_group -------- */
|
227 |
+
$this->addAttribute('catalog_product', 'shipperhq_dim_group', array(
|
228 |
+
'type' => 'varchar',
|
229 |
+
'input' => 'select',
|
230 |
+
'label' => 'ShipperHQ Dimensional Rule Group',
|
231 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
232 |
+
'global' => false,
|
233 |
+
'visible' => 1,
|
234 |
+
'required' => 0,
|
235 |
+
'visible_on_front' => 0,
|
236 |
+
'is_html_allowed_on_front' => 0,
|
237 |
+
'searchable' => 0,
|
238 |
+
'filterable' => 0,
|
239 |
+
'comparable' => 0,
|
240 |
+
'is_configurable' => 0,
|
241 |
+
'unique' => false,
|
242 |
+
'user_defined' => true,
|
243 |
+
'used_in_product_listing' => false
|
244 |
+
));
|
245 |
+
|
246 |
+
/* ------ ship_length -------- */
|
247 |
+
$this->addAttribute('catalog_product', 'ship_length', array(
|
248 |
+
'type' => 'decimal',
|
249 |
+
'input' => 'text',
|
250 |
+
'label' => 'Dimension Length',
|
251 |
+
'global' => false,
|
252 |
+
'visible' => 1,
|
253 |
+
'required' => 0,
|
254 |
+
'visible_on_front' => 0,
|
255 |
+
'is_html_allowed_on_front' => 0,
|
256 |
+
'searchable' => 0,
|
257 |
+
'filterable' => 0,
|
258 |
+
'comparable' => 0,
|
259 |
+
'unique' => false,
|
260 |
+
'user_defined' => true,
|
261 |
+
'used_in_product_listing' => false
|
262 |
+
));
|
263 |
+
|
264 |
+
/* ------ ship_width -------- */
|
265 |
+
$this->addAttribute('catalog_product', 'ship_width', array(
|
266 |
+
'type' => 'decimal',
|
267 |
+
'input' => 'text',
|
268 |
+
'label' => 'Dimension Width',
|
269 |
+
'global' => false,
|
270 |
+
'visible' => 1,
|
271 |
+
'required' => 0,
|
272 |
+
'visible_on_front' => 0,
|
273 |
+
'is_html_allowed_on_front' => 0,
|
274 |
+
'searchable' => 0,
|
275 |
+
'filterable' => 0,
|
276 |
+
'comparable' => 0,
|
277 |
+
'unique' => false,
|
278 |
+
'user_defined' => true,
|
279 |
+
'used_in_product_listing' => false
|
280 |
+
));
|
281 |
+
|
282 |
+
/* ------ ship_height -------- */
|
283 |
+
$this->addAttribute('catalog_product', 'ship_height', array(
|
284 |
+
'type' => 'decimal',
|
285 |
+
'input' => 'text',
|
286 |
+
'label' => 'Dimension Height',
|
287 |
+
'global' => false,
|
288 |
+
'visible' => 1,
|
289 |
+
'required' => 0,
|
290 |
+
'visible_on_front' => 0,
|
291 |
+
'is_html_allowed_on_front' => 0,
|
292 |
+
'searchable' => 0,
|
293 |
+
'filterable' => 0,
|
294 |
+
'comparable' => 0,
|
295 |
+
'unique' => false,
|
296 |
+
'user_defined' => true,
|
297 |
+
'used_in_product_listing' => false
|
298 |
+
));
|
299 |
+
|
300 |
+
/* ------ shipperhq_poss_boxes -------- */
|
301 |
+
$this->addAttribute('catalog_product', 'shipperhq_poss_boxes', array(
|
302 |
+
'type' => 'varchar',
|
303 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
304 |
+
'input' => 'multiselect',
|
305 |
+
'label' => 'Possible Packing Boxes',
|
306 |
+
'global' => false,
|
307 |
+
'visible' => 1,
|
308 |
+
'required' => 0,
|
309 |
+
'visible_on_front' => 0,
|
310 |
+
'is_html_allowed_on_front' => 0,
|
311 |
+
'searchable' => 0,
|
312 |
+
'filterable' => 0,
|
313 |
+
'comparable' => 0,
|
314 |
+
'is_configurable' => 0,
|
315 |
+
'unique' => false,
|
316 |
+
'user_defined' => true,
|
317 |
+
'used_in_product_listing' => false
|
318 |
+
));
|
319 |
+
|
320 |
+
/* ------ ship_box_tolerance -------- */
|
321 |
+
$this->addAttribute('catalog_product', 'ship_box_tolerance', array(
|
322 |
+
'type' => 'int',
|
323 |
+
'input' => 'text',
|
324 |
+
'label' => 'Box Tolerance',
|
325 |
+
'global' => false,
|
326 |
+
'visible' => 1,
|
327 |
+
'required' => 0,
|
328 |
+
'visible_on_front' => 0,
|
329 |
+
'is_html_allowed_on_front' => 0,
|
330 |
+
'searchable' => 0,
|
331 |
+
'filterable' => 0,
|
332 |
+
'comparable' => 0,
|
333 |
+
'unique' => false,
|
334 |
+
'used_in_product_listing' => false,
|
335 |
+
'user_defined' => true,
|
336 |
+
'note' => 'Note: Ignore if unsure'
|
337 |
+
));
|
338 |
+
|
339 |
+
/* ------ shipperhq_malleable_product -------- */
|
340 |
+
$this->addAttribute('catalog_product', 'shipperhq_malleable_product', array(
|
341 |
+
'type' => 'int',
|
342 |
+
'input' => 'boolean',
|
343 |
+
'label' => 'Malleable Product',
|
344 |
+
'global' => false,
|
345 |
+
'visible' => 1,
|
346 |
+
'required' => 0,
|
347 |
+
'visible_on_front' => 0,
|
348 |
+
'is_html_allowed_on_front' => 0,
|
349 |
+
'searchable' => 0,
|
350 |
+
'filterable' => 0,
|
351 |
+
'comparable' => 0,
|
352 |
+
'unique' => false,
|
353 |
+
'user_defined' => true,
|
354 |
+
'note' => 'Ignore if unsure. Indicates the product dimensions can be adjusted to fit box',
|
355 |
+
'used_in_product_listing' => false
|
356 |
+
));
|
357 |
+
|
358 |
+
/* ------ shipperhq_master_boxes -------- */
|
359 |
+
$this->addAttribute('catalog_product', 'shipperhq_master_boxes', array(
|
360 |
+
'type' => 'varchar',
|
361 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
362 |
+
'input' => 'multiselect',
|
363 |
+
'label' => 'Master Packing Boxes',
|
364 |
+
'global' => false,
|
365 |
+
'visible' => 1,
|
366 |
+
'required' => 0,
|
367 |
+
'visible_on_front' => 0,
|
368 |
+
'is_html_allowed_on_front' => 0,
|
369 |
+
'searchable' => 0,
|
370 |
+
'filterable' => 0,
|
371 |
+
'comparable' => 0,
|
372 |
+
'is_configurable' => 0,
|
373 |
+
'unique' => false,
|
374 |
+
'user_defined' => true,
|
375 |
+
'used_in_product_listing' => false
|
376 |
+
));
|
377 |
+
|
378 |
+
/* ------ shipperhq_availability_date -------- */
|
379 |
+
$this->addAttribute('catalog_product', 'shipperhq_availability_date', array(
|
380 |
+
'type' => 'datetime',
|
381 |
+
'backend' => 'eav/entity_attribute_backend_datetime',
|
382 |
+
'input' => 'date',
|
383 |
+
'label' => 'Availability Date',
|
384 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
|
385 |
+
'visible' => 1,
|
386 |
+
'required' => 0,
|
387 |
+
'visible_on_front' => 0,
|
388 |
+
'is_html_allowed_on_front' => 0,
|
389 |
+
'searchable' => 0,
|
390 |
+
'filterable' => 0,
|
391 |
+
'comparable' => 0,
|
392 |
+
'is_configurable' => 0,
|
393 |
+
'unique' => false,
|
394 |
+
'user_defined' => true,
|
395 |
+
'used_in_product_listing' => false
|
396 |
+
));
|
397 |
+
|
398 |
+
/*
|
399 |
+
*
|
400 |
+
*
|
401 |
+
*
|
402 |
+
*/
|
403 |
+
|
404 |
+
$entityTypeId = $installer->getEntityTypeId('catalog_product');
|
405 |
+
|
406 |
+
$attributeSetArr = $installer->getAllAttributeSetIds($entityTypeId);
|
407 |
+
|
408 |
+
if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Splitrates')) {
|
409 |
+
$stdAttributeCodes = array('shipperhq_shipping_group' => '1', 'shipperhq_warehouse' => '10');
|
410 |
+
}
|
411 |
+
else {
|
412 |
+
$stdAttributeCodes = array('shipperhq_shipping_group' => '1');
|
413 |
+
}
|
414 |
+
$dimAttributeCodes = array('ship_separately' => '2',
|
415 |
+
'shipperhq_dim_group' => '1',
|
416 |
+
'ship_length' => '10',
|
417 |
+
'ship_width' => '11',
|
418 |
+
'ship_height' => '12',
|
419 |
+
'shipperhq_poss_boxes' => '20',
|
420 |
+
);
|
421 |
+
|
422 |
+
foreach ($attributeSetArr as $attributeSetId) {
|
423 |
+
|
424 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Shipping', '99');
|
425 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Dimensional Shipping', '100');
|
426 |
+
|
427 |
+
$attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Shipping');
|
428 |
+
$dimAttributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Dimensional Shipping');
|
429 |
+
|
430 |
+
foreach($stdAttributeCodes as $code => $sort) {
|
431 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
432 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, $attributeId, $sort);
|
433 |
+
}
|
434 |
+
|
435 |
+
foreach($dimAttributeCodes as $code => $sort) {
|
436 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
437 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $dimAttributeGroupId, $attributeId, $sort);
|
438 |
+
}
|
439 |
+
|
440 |
+
};
|
441 |
+
|
442 |
+
|
443 |
+
|
444 |
+
$text = Mage::helper('wsalogger')->getNewVersion() > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text';
|
445 |
+
|
446 |
+
$isCheckout = array(
|
447 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
448 |
+
'comment' => 'Shipperhq Shipper',
|
449 |
+
'nullable' => 'false',
|
450 |
+
'default' => '0'
|
451 |
+
);
|
452 |
+
|
453 |
+
$carrierType = array(
|
454 |
+
'type' => $text,
|
455 |
+
'comment' => 'Shipperhq Carrier Type',
|
456 |
+
'nullable' => 'true',
|
457 |
+
);
|
458 |
+
|
459 |
+
$dispatchDate = array(
|
460 |
+
'type' => $text,
|
461 |
+
'length' => 20,
|
462 |
+
'comment' => 'Dispatch Date',
|
463 |
+
'nullable' => 'true');
|
464 |
+
|
465 |
+
$deliveryDate = array(
|
466 |
+
'type' => $text,
|
467 |
+
'length' => 20,
|
468 |
+
'comment' => 'Expected Delivery',
|
469 |
+
'nullable' => 'true');
|
470 |
+
|
471 |
+
$carrierNotice = array(
|
472 |
+
'type' => $text,
|
473 |
+
'comment' => 'Shipperhq Carrier Notice',
|
474 |
+
'nullable' => 'true',
|
475 |
+
);
|
476 |
+
|
477 |
+
$customDescription = array(
|
478 |
+
'type' => $text,
|
479 |
+
'comment' => 'Shipperhq Custom Description',
|
480 |
+
'nullable' => 'true',
|
481 |
+
);
|
482 |
+
|
483 |
+
$carrierId = array(
|
484 |
+
'type' => $text,
|
485 |
+
'length' => 20,
|
486 |
+
'comment' => 'Shipperhq Carrier ID',
|
487 |
+
'nullable' => 'true',
|
488 |
+
);
|
489 |
+
|
490 |
+
$customDuties = array(
|
491 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
|
492 |
+
'scale' => 4,
|
493 |
+
'precision' => 12,
|
494 |
+
'comment' => 'Shipperhq Custom Duties',
|
495 |
+
);
|
496 |
+
|
497 |
+
$confirmationNo = array(
|
498 |
+
'type' => $text,
|
499 |
+
'length' => 20,
|
500 |
+
'comment' => 'Shipperhq Confirmation Number',
|
501 |
+
'nullable' => 'true',
|
502 |
+
);
|
503 |
+
|
504 |
+
$deliveryComments = array(
|
505 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text',
|
506 |
+
'comment' => 'ShipperHQ Delivery Comments',
|
507 |
+
'nullable' => 'true',
|
508 |
+
);
|
509 |
+
|
510 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'is_checkout')){
|
511 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'is_checkout', $isCheckout);
|
512 |
+
}
|
513 |
+
|
514 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_type')){
|
515 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carrier_type', $carrierType);
|
516 |
+
}
|
517 |
+
|
518 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'dispatch_date')){
|
519 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'dispatch_date', $dispatchDate );
|
520 |
+
}
|
521 |
+
|
522 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'delivery_date')){
|
523 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'delivery_date', $deliveryDate );
|
524 |
+
}
|
525 |
+
|
526 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'shq_delivery_comments')){
|
527 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'shq_delivery_comments',$deliveryComments);
|
528 |
+
}
|
529 |
+
|
530 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type')){
|
531 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type', $carrierType);
|
532 |
+
}
|
533 |
+
|
534 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'dispatch_date')){
|
535 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'dispatch_date', $dispatchDate );
|
536 |
+
}
|
537 |
+
|
538 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'delivery_date')){
|
539 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'delivery_date', $deliveryDate );
|
540 |
+
}
|
541 |
+
|
542 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice')){
|
543 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice', $carrierNotice);
|
544 |
+
}
|
545 |
+
|
546 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description')){
|
547 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description', $customDescription);
|
548 |
+
}
|
549 |
+
|
550 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id')){
|
551 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id', $carrierId);
|
552 |
+
}
|
553 |
+
|
554 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_id')){
|
555 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'carrier_id', $carrierId );
|
556 |
+
}
|
557 |
+
|
558 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_id')){
|
559 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_id', $carrierId );
|
560 |
+
}
|
561 |
+
|
562 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'confirmation_number')){
|
563 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'confirmation_number', $confirmationNo );
|
564 |
+
}
|
565 |
+
|
566 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties')){
|
567 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties', $customDuties);
|
568 |
+
}
|
569 |
+
|
570 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_type')){
|
571 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_type', $carrierType );
|
572 |
+
}
|
573 |
+
|
574 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'dispatch_date')){
|
575 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'dispatch_date', $dispatchDate );
|
576 |
+
}
|
577 |
+
|
578 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'shq_delivery_comments')){
|
579 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'shq_delivery_comments',$deliveryComments);
|
580 |
+
}
|
581 |
+
|
582 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'delivery_date')){
|
583 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'delivery_date', $deliveryDate );
|
584 |
+
}
|
585 |
+
else {
|
586 |
+
$installer->getConnection()->modifyColumn(
|
587 |
+
$installer->getTable('sales/order'),
|
588 |
+
'delivery_date',
|
589 |
+
array(
|
590 |
+
'type' => $text,
|
591 |
+
'length' => 20,
|
592 |
+
'comment' => 'Expected Delivery',
|
593 |
+
'nullable' => 'true'
|
594 |
+
)
|
595 |
+
);
|
596 |
+
}
|
597 |
+
|
598 |
+
/*carrier group attributes*/
|
599 |
+
$version = Mage::helper('wsalogger')->getNewVersion();
|
600 |
+
|
601 |
+
$carriergroupAttr = array(
|
602 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
603 |
+
'comment' => 'Carrier Group',
|
604 |
+
'nullable' => 'true',
|
605 |
+
);
|
606 |
+
|
607 |
+
$carriergroupID = array(
|
608 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
609 |
+
'comment' => 'Carrier Group ID',
|
610 |
+
'nullable' => 'true',
|
611 |
+
);
|
612 |
+
|
613 |
+
$carriergroupDetails = array(
|
614 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
615 |
+
'comment' => 'Carrier Group Details',
|
616 |
+
'nullable' => 'true',
|
617 |
+
);
|
618 |
+
|
619 |
+
$carriergroupHtml = array(
|
620 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
621 |
+
'comment' => 'Carrier Group Html',
|
622 |
+
'nullable' => 'true',
|
623 |
+
);
|
624 |
+
|
625 |
+
$displayMerged = array(
|
626 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
627 |
+
'comment' => 'Checkout display type',
|
628 |
+
'nullable' => 'false',
|
629 |
+
'default' => '1'
|
630 |
+
);
|
631 |
+
|
632 |
+
$splitRates = array(
|
633 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
634 |
+
'comment' => 'Shipperhq Split Rates',
|
635 |
+
'nullable' => 'false',
|
636 |
+
'default' => '0'
|
637 |
+
);
|
638 |
+
|
639 |
+
$carriergroupShipping = array(
|
640 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
641 |
+
'comment' => 'Shipping Description',
|
642 |
+
'nullable' => 'true',
|
643 |
+
);
|
644 |
+
|
645 |
+
$destinationTypeAttr = array(
|
646 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text',
|
647 |
+
'comment' => 'ShipperHQ Address Type',
|
648 |
+
'nullable' => 'true',
|
649 |
+
);
|
650 |
+
|
651 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'destination_type')){
|
652 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'destination_type',$destinationTypeAttr);
|
653 |
+
}
|
654 |
+
|
655 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'destination_type')){
|
656 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'destination_type',$destinationTypeAttr);
|
657 |
+
}
|
658 |
+
|
659 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details')){
|
660 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details', $carriergroupDetails);
|
661 |
+
}
|
662 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html')){
|
663 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html', $carriergroupHtml);
|
664 |
+
}
|
665 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'checkout_display_merged')){
|
666 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'checkout_display_merged', $displayMerged);
|
667 |
+
}
|
668 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'split_rates')){
|
669 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'split_rates', $splitRates);
|
670 |
+
}
|
671 |
+
|
672 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id')){
|
673 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id', $carriergroupID);
|
674 |
+
}
|
675 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup')){
|
676 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup', $carriergroupAttr);
|
677 |
+
}
|
678 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details')){
|
679 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details', $carriergroupDetails);
|
680 |
+
}
|
681 |
+
|
682 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup')){
|
683 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup', $carriergroupAttr);
|
684 |
+
}
|
685 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup')){
|
686 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup', $carriergroupAttr);
|
687 |
+
}
|
688 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_id')){
|
689 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_id', $carriergroupID);
|
690 |
+
}
|
691 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_id')){
|
692 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_id', $carriergroupID);
|
693 |
+
}
|
694 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_shipping')){
|
695 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_shipping', $carriergroupShipping);
|
696 |
+
}
|
697 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_shipping')){
|
698 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_shipping', $carriergroupShipping);
|
699 |
+
}
|
700 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping')){
|
701 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping', $carriergroupShipping);
|
702 |
+
}
|
703 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup')){
|
704 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup', $carriergroupAttr);
|
705 |
+
}
|
706 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_id')){
|
707 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_id', $carriergroupID);
|
708 |
+
}
|
709 |
+
|
710 |
+
|
711 |
+
if (Mage::helper('wsalogger')->getNewVersion() >= 8) {
|
712 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment_grid'), 'carriergroup')){
|
713 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment_grid'),'carriergroup',$carriergroupAttr);
|
714 |
+
}
|
715 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'carriergroup')){
|
716 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'carriergroup',$carriergroupAttr);
|
717 |
+
}
|
718 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'shipping_description')){
|
719 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'shipping_description',array(
|
720 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
721 |
+
'length' => 255,
|
722 |
+
'comment' => 'Shipping Description',
|
723 |
+
'nullable' => 'true',));
|
724 |
+
}
|
725 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_html')){
|
726 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_html', $carriergroupHtml);
|
727 |
+
}
|
728 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_details')){
|
729 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_details', $carriergroupDetails);
|
730 |
+
}
|
731 |
+
if (Mage::helper('wsalogger')->isEnterpriseEdition() && $installer->tableExists('enterprise_sales_shipment_grid_archive')) {
|
732 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('enterprise_sales_shipment_grid_archive'), 'carriergroup')){
|
733 |
+
$installer->getConnection()->addColumn($installer->getTable('enterprise_sales_shipment_grid_archive'),'carriergroup',$carriergroupAttr);
|
734 |
+
}
|
735 |
+
}
|
736 |
+
}
|
737 |
+
|
738 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/storage'))) {
|
739 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/storage'));
|
740 |
+
|
741 |
+
$table
|
742 |
+
->addColumn('quote_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
743 |
+
'primary' => true,
|
744 |
+
'nullable' => false,
|
745 |
+
'unsigned' => true
|
746 |
+
))
|
747 |
+
->addColumn('data', Varien_Db_Ddl_Table::TYPE_TEXT, '512k', array('nullable' => false))
|
748 |
+
->addForeignKey(
|
749 |
+
$this->getFkName('shipperhq_shipper/storage', 'quote_id', 'sales/quote', 'entity_id'),
|
750 |
+
'quote_id',
|
751 |
+
$this->getTable('sales/quote'),
|
752 |
+
'entity_id',
|
753 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
754 |
+
)
|
755 |
+
;
|
756 |
+
$this->getConnection()->createTable($table);
|
757 |
+
}
|
758 |
+
|
759 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_packages'))) {
|
760 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_packages'));
|
761 |
+
|
762 |
+
$table
|
763 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
764 |
+
'primary' => true,
|
765 |
+
'nullable' => false,
|
766 |
+
'unsigned' => true,
|
767 |
+
'auto_increment' => true
|
768 |
+
))
|
769 |
+
->addColumn('address_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
770 |
+
'nullable' => false,
|
771 |
+
'unsigned' => true
|
772 |
+
))
|
773 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
774 |
+
'nullable' => false,
|
775 |
+
))
|
776 |
+
->addColumn('carrier_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
777 |
+
'nullable' => false,
|
778 |
+
))
|
779 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
780 |
+
'nullable' => false,
|
781 |
+
))
|
782 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
783 |
+
'nullable' => true
|
784 |
+
))
|
785 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
786 |
+
'nullable' => true
|
787 |
+
))
|
788 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
789 |
+
'nullable' => true
|
790 |
+
))
|
791 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
792 |
+
'nullable' => true
|
793 |
+
))
|
794 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
795 |
+
'nullable' => true
|
796 |
+
))
|
797 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
798 |
+
'nullable' => true
|
799 |
+
))
|
800 |
+
->addForeignKey(
|
801 |
+
$this->getFkName('shipperhq_shipper/quote_packages', 'address_id', 'sales/quote_address', 'address_id'),
|
802 |
+
'address_id',
|
803 |
+
$this->getTable('sales/quote_address'),
|
804 |
+
'address_id',
|
805 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
806 |
+
)
|
807 |
+
;
|
808 |
+
$this->getConnection()->createTable($table);
|
809 |
+
}
|
810 |
+
|
811 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_package_items'))) {
|
812 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_package_items'));
|
813 |
+
|
814 |
+
$table
|
815 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
816 |
+
'nullable' => false,
|
817 |
+
))
|
818 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
819 |
+
'nullable' => false,
|
820 |
+
))
|
821 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
822 |
+
'nullable' => true
|
823 |
+
))
|
824 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
825 |
+
'nullable' => true
|
826 |
+
))
|
827 |
+
->addForeignKey(
|
828 |
+
$this->getFkName('shipperhq_shipper/quote_package_items', 'package_id', 'shipperhq_shipper/quote_packages', 'package_id'),
|
829 |
+
'package_id',
|
830 |
+
$this->getTable('shipperhq_shipper/quote_packages'),
|
831 |
+
'package_id',
|
832 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
833 |
+
)
|
834 |
+
;
|
835 |
+
$this->getConnection()->createTable($table);
|
836 |
+
}
|
837 |
+
|
838 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_packages'))) {
|
839 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_packages'));
|
840 |
+
|
841 |
+
$table
|
842 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
843 |
+
'primary' => true,
|
844 |
+
'nullable' => false,
|
845 |
+
'unsigned' => true,
|
846 |
+
'auto_increment' => true
|
847 |
+
))
|
848 |
+
->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
849 |
+
'nullable' => false,
|
850 |
+
'unsigned' => true
|
851 |
+
))
|
852 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
853 |
+
'nullable' => false,
|
854 |
+
))
|
855 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
856 |
+
'nullable' => false,
|
857 |
+
))
|
858 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
859 |
+
'nullable' => true
|
860 |
+
))
|
861 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
862 |
+
'nullable' => true
|
863 |
+
))
|
864 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
865 |
+
'nullable' => true
|
866 |
+
))
|
867 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
868 |
+
'nullable' => true
|
869 |
+
))
|
870 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
871 |
+
'nullable' => true
|
872 |
+
))
|
873 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
874 |
+
'nullable' => true
|
875 |
+
))
|
876 |
+
->addForeignKey(
|
877 |
+
$this->getFkName('shipperhq_shipper/order_packages', 'order_id', 'sales/order', 'entity_id'),
|
878 |
+
'order_id',
|
879 |
+
$this->getTable('sales/order'),
|
880 |
+
'entity_id',
|
881 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
882 |
+
)
|
883 |
+
;
|
884 |
+
$this->getConnection()->createTable($table);
|
885 |
+
}
|
886 |
+
|
887 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_package_items'))) {
|
888 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_package_items'));
|
889 |
+
|
890 |
+
$table
|
891 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
892 |
+
'nullable' => false,
|
893 |
+
'unsigned' => true,
|
894 |
+
))
|
895 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
896 |
+
'nullable' => false,
|
897 |
+
))
|
898 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
899 |
+
'nullable' => true
|
900 |
+
))
|
901 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
902 |
+
'nullable' => true
|
903 |
+
))
|
904 |
+
->addForeignKey(
|
905 |
+
$this->getFkName('shipperhq_shipper/order_package_items', 'package_id', 'shipperhq_shipper/order_packages', 'package_id'),
|
906 |
+
'package_id',
|
907 |
+
$this->getTable('shipperhq_shipper/order_packages'),
|
908 |
+
'package_id',
|
909 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
910 |
+
)
|
911 |
+
;
|
912 |
+
$this->getConnection()->createTable($table);
|
913 |
+
}
|
914 |
+
|
915 |
+
/**
|
916 |
+
* We use this for some of the EE layout updates
|
917 |
+
*/
|
918 |
+
$isEnterprise = Mage::helper('wsalogger')->isEnterpriseEdition();
|
919 |
+
|
920 |
+
if($isEnterprise) {
|
921 |
+
$config = new Mage_Core_Model_Config();
|
922 |
+
$config->saveConfig('carriers/shipper/is_enterprise', "1", 'default', 0);
|
923 |
+
}
|
924 |
+
|
925 |
+
$installer->endSetup();
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-install-0.0.34.php
ADDED
@@ -0,0 +1,932 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
|
7 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/attributeupdate'))) {
|
8 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/attributeupdate'));
|
9 |
+
|
10 |
+
$table
|
11 |
+
->addColumn('synch_id', Varien_Db_Ddl_Table::TYPE_INTEGER, NULL, array(
|
12 |
+
'primary' => true,
|
13 |
+
'nullable' => false,
|
14 |
+
'unsigned' => true,
|
15 |
+
'auto_increment' => true
|
16 |
+
))
|
17 |
+
->addColumn('notification_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 0, array(
|
18 |
+
'nullable' => false,
|
19 |
+
'unsigned' => true,
|
20 |
+
))
|
21 |
+
->addColumn('attribute_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
22 |
+
'nullable' => false,
|
23 |
+
))
|
24 |
+
->addColumn('attribute_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
25 |
+
'nullable' => false,
|
26 |
+
))
|
27 |
+
->addColumn('value', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
28 |
+
'nullable' => false,
|
29 |
+
))
|
30 |
+
->addColumn('status', Varien_Db_Ddl_Table::TYPE_VARCHAR, NULL, array(
|
31 |
+
'nullable' => false,
|
32 |
+
))
|
33 |
+
->addColumn('date_added', Varien_Db_Ddl_Table::TYPE_DATETIME, NULL, array(
|
34 |
+
'nullable' => false,
|
35 |
+
))
|
36 |
+
;
|
37 |
+
$this->getConnection()->createTable($table);
|
38 |
+
}
|
39 |
+
|
40 |
+
/* ------ shipperhq_shipping_group -------- */
|
41 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_group', array(
|
42 |
+
'type' => 'varchar',
|
43 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
44 |
+
'input' => 'multiselect',
|
45 |
+
'label' => 'Shipping Group',
|
46 |
+
'global' => false,
|
47 |
+
'visible' => 1,
|
48 |
+
'required' => 0,
|
49 |
+
'visible_on_front' => 0,
|
50 |
+
'is_html_allowed_on_front' => 0,
|
51 |
+
'searchable' => 0,
|
52 |
+
'filterable' => 0,
|
53 |
+
'comparable' => 0,
|
54 |
+
'is_configurable' => 0,
|
55 |
+
'unique' => false,
|
56 |
+
'user_defined' => false, //SHQ16-1981 user_defined is false so cant be deleted
|
57 |
+
'used_in_product_listing' => false
|
58 |
+
));
|
59 |
+
|
60 |
+
/* ------ shipperhq_warehouse -------- */
|
61 |
+
$this->addAttribute('catalog_product', 'shipperhq_warehouse', array(
|
62 |
+
'type' => 'text',
|
63 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
64 |
+
'input' => 'multiselect',
|
65 |
+
'label' => 'Origin',
|
66 |
+
'global' => false,
|
67 |
+
'visible' => 1,
|
68 |
+
'required' => 0,
|
69 |
+
'visible_on_front' => 0,
|
70 |
+
'is_html_allowed_on_front' => 0,
|
71 |
+
'searchable' => 0,
|
72 |
+
'filterable' => 0,
|
73 |
+
'comparable' => 0,
|
74 |
+
'is_configurable' => 0,
|
75 |
+
'unique' => false,
|
76 |
+
'user_defined' => false, //SHQ16-1981 user_defined is false so cant be deleted
|
77 |
+
'used_in_product_listing' => false
|
78 |
+
));
|
79 |
+
|
80 |
+
/* ------ shipperhq_shipping_qty -------- */
|
81 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_qty', array(
|
82 |
+
'type' => 'int',
|
83 |
+
'input' => 'text',
|
84 |
+
'label' => 'Shipping Qty',
|
85 |
+
'global' => false,
|
86 |
+
'visible' => 1,
|
87 |
+
'required' => 0,
|
88 |
+
'visible_on_front' => 0,
|
89 |
+
'is_html_allowed_on_front' => 0,
|
90 |
+
'searchable' => 0,
|
91 |
+
'filterable' => 0,
|
92 |
+
'comparable' => 0,
|
93 |
+
'unique' => false,
|
94 |
+
'user_defined' => true,
|
95 |
+
'used_in_product_listing' => false
|
96 |
+
));
|
97 |
+
|
98 |
+
/* ------ shipperhq_shipping_fee -------- */
|
99 |
+
$this->addAttribute('catalog_product', 'shipperhq_shipping_fee', array(
|
100 |
+
'type' => 'decimal',
|
101 |
+
'input' => 'price',
|
102 |
+
'label' => 'Shipping Fee',
|
103 |
+
'global' => false,
|
104 |
+
'visible' => 1,
|
105 |
+
'required' => 0,
|
106 |
+
'visible_on_front' => 0,
|
107 |
+
'is_html_allowed_on_front' => 0,
|
108 |
+
'searchable' => 0,
|
109 |
+
'filterable' => 0,
|
110 |
+
'comparable' => 0,
|
111 |
+
'unique' => false,
|
112 |
+
'user_defined' => true,
|
113 |
+
'used_in_product_listing' => false
|
114 |
+
));
|
115 |
+
|
116 |
+
/* ------ shipperhq_additional_price -------- */
|
117 |
+
$this->addAttribute('catalog_product', 'shipperhq_additional_price', array(
|
118 |
+
'type' => 'decimal',
|
119 |
+
'input' => 'price',
|
120 |
+
'label' => 'Additional Price',
|
121 |
+
'global' => false,
|
122 |
+
'visible' => 1,
|
123 |
+
'required' => 0,
|
124 |
+
'visible_on_front' => 0,
|
125 |
+
'is_html_allowed_on_front' => 0,
|
126 |
+
'searchable' => 0,
|
127 |
+
'filterable' => 0,
|
128 |
+
'comparable' => 0,
|
129 |
+
'unique' => false,
|
130 |
+
'user_defined' => true,
|
131 |
+
'used_in_product_listing' => false
|
132 |
+
));
|
133 |
+
|
134 |
+
/* ------ shipperhq_handling_fee -------- */
|
135 |
+
$this->addAttribute('catalog_product', 'shipperhq_handling_fee', array(
|
136 |
+
'type' => 'decimal',
|
137 |
+
'input' => 'price',
|
138 |
+
'label' => 'Handling Fee',
|
139 |
+
'global' => false,
|
140 |
+
'visible' => 1,
|
141 |
+
'required' => 0,
|
142 |
+
'visible_on_front' => 0,
|
143 |
+
'is_html_allowed_on_front' => 0,
|
144 |
+
'searchable' => 0,
|
145 |
+
'filterable' => 0,
|
146 |
+
'comparable' => 0,
|
147 |
+
'unique' => false,
|
148 |
+
'user_defined' => true,
|
149 |
+
'used_in_product_listing' => false
|
150 |
+
));
|
151 |
+
|
152 |
+
/* ------ shipperhq_carrier_code -------- */
|
153 |
+
$this->addAttribute('catalog_product', 'shipperhq_carrier_code', array(
|
154 |
+
'type' => 'text',
|
155 |
+
'input' => 'text',
|
156 |
+
'label' => 'Carrier Code',
|
157 |
+
'global' => false,
|
158 |
+
'visible' => 1,
|
159 |
+
'required' => 0,
|
160 |
+
'visible_on_front' => 0,
|
161 |
+
'is_html_allowed_on_front' => 0,
|
162 |
+
'searchable' => 0,
|
163 |
+
'filterable' => 0,
|
164 |
+
'comparable' => 0,
|
165 |
+
'unique' => false,
|
166 |
+
'user_defined' => true,
|
167 |
+
'used_in_product_listing' => false
|
168 |
+
));
|
169 |
+
|
170 |
+
/* ------ shipperhq_volume_weight -------- */
|
171 |
+
$this->addAttribute('catalog_product', 'shipperhq_volume_weight', array(
|
172 |
+
'type' => 'decimal',
|
173 |
+
'input' => 'text',
|
174 |
+
'label' => 'Volume Weight',
|
175 |
+
'global' => false,
|
176 |
+
'visible' => 1,
|
177 |
+
'required' => 0,
|
178 |
+
'visible_on_front' => 0,
|
179 |
+
'is_html_allowed_on_front' => 0,
|
180 |
+
'searchable' => 0,
|
181 |
+
'filterable' => 0,
|
182 |
+
'comparable' => 0,
|
183 |
+
'unique' => false,
|
184 |
+
'user_defined' => true,
|
185 |
+
'used_in_product_listing' => false,
|
186 |
+
'note' => 'This value is only used in conjunction with shipping filters'
|
187 |
+
));
|
188 |
+
|
189 |
+
/* ------ shipperhq_declared_value -------- */
|
190 |
+
$this->addAttribute('catalog_product', 'shipperhq_declared_value', array(
|
191 |
+
'type' => 'decimal',
|
192 |
+
'input' => 'price',
|
193 |
+
'label' => 'Declared Value',
|
194 |
+
'global' => false,
|
195 |
+
'visible' => 1,
|
196 |
+
'required' => 0,
|
197 |
+
'visible_on_front' => 0,
|
198 |
+
'is_html_allowed_on_front' => 0,
|
199 |
+
'searchable' => 0,
|
200 |
+
'filterable' => 0,
|
201 |
+
'comparable' => 0,
|
202 |
+
'unique' => false,
|
203 |
+
'user_defined' => true,
|
204 |
+
'used_in_product_listing' => false,
|
205 |
+
'note' => 'The deemed cost of this product for customs & insurance purposes'
|
206 |
+
));
|
207 |
+
|
208 |
+
/* ------ ship_separately -------- */
|
209 |
+
$this->addAttribute('catalog_product', 'ship_separately', array(
|
210 |
+
'type' => 'int',
|
211 |
+
'input' => 'boolean',
|
212 |
+
'label' => 'Ship Separately',
|
213 |
+
'global' => false,
|
214 |
+
'visible' => 1,
|
215 |
+
'required' => 0,
|
216 |
+
'visible_on_front' => 0,
|
217 |
+
'is_html_allowed_on_front' => 0,
|
218 |
+
'searchable' => 0,
|
219 |
+
'filterable' => 0,
|
220 |
+
'comparable' => 0,
|
221 |
+
'unique' => false,
|
222 |
+
'user_defined' => true,
|
223 |
+
'used_in_product_listing' => false
|
224 |
+
));
|
225 |
+
|
226 |
+
/* ------ shipperhq_dim_group --------*/
|
227 |
+
$this->addAttribute('catalog_product', 'shipperhq_dim_group', array(
|
228 |
+
'type' => 'varchar',
|
229 |
+
'input' => 'select',
|
230 |
+
'label' => 'ShipperHQ Dimensional Rule Group',
|
231 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
232 |
+
'global' => false,
|
233 |
+
'visible' => 1,
|
234 |
+
'required' => 0,
|
235 |
+
'visible_on_front' => 0,
|
236 |
+
'is_html_allowed_on_front' => 0,
|
237 |
+
'searchable' => 0,
|
238 |
+
'filterable' => 0,
|
239 |
+
'comparable' => 0,
|
240 |
+
'is_configurable' => 0,
|
241 |
+
'unique' => false,
|
242 |
+
'user_defined' => false, //SHQ16-1981 user_defined is false so cant be deleted
|
243 |
+
'used_in_product_listing' => false
|
244 |
+
));
|
245 |
+
|
246 |
+
/* ------ ship_length -------- */
|
247 |
+
$this->addAttribute('catalog_product', 'ship_length', array(
|
248 |
+
'type' => 'decimal',
|
249 |
+
'input' => 'text',
|
250 |
+
'label' => 'Dimension Length',
|
251 |
+
'global' => false,
|
252 |
+
'visible' => 1,
|
253 |
+
'required' => 0,
|
254 |
+
'visible_on_front' => 0,
|
255 |
+
'is_html_allowed_on_front' => 0,
|
256 |
+
'searchable' => 0,
|
257 |
+
'filterable' => 0,
|
258 |
+
'comparable' => 0,
|
259 |
+
'unique' => false,
|
260 |
+
'user_defined' => true,
|
261 |
+
'used_in_product_listing' => false
|
262 |
+
));
|
263 |
+
|
264 |
+
/* ------ ship_width -------- */
|
265 |
+
$this->addAttribute('catalog_product', 'ship_width', array(
|
266 |
+
'type' => 'decimal',
|
267 |
+
'input' => 'text',
|
268 |
+
'label' => 'Dimension Width',
|
269 |
+
'global' => false,
|
270 |
+
'visible' => 1,
|
271 |
+
'required' => 0,
|
272 |
+
'visible_on_front' => 0,
|
273 |
+
'is_html_allowed_on_front' => 0,
|
274 |
+
'searchable' => 0,
|
275 |
+
'filterable' => 0,
|
276 |
+
'comparable' => 0,
|
277 |
+
'unique' => false,
|
278 |
+
'user_defined' => true,
|
279 |
+
'used_in_product_listing' => false
|
280 |
+
));
|
281 |
+
|
282 |
+
/* ------ ship_height -------- */
|
283 |
+
$this->addAttribute('catalog_product', 'ship_height', array(
|
284 |
+
'type' => 'decimal',
|
285 |
+
'input' => 'text',
|
286 |
+
'label' => 'Dimension Height',
|
287 |
+
'global' => false,
|
288 |
+
'visible' => 1,
|
289 |
+
'required' => 0,
|
290 |
+
'visible_on_front' => 0,
|
291 |
+
'is_html_allowed_on_front' => 0,
|
292 |
+
'searchable' => 0,
|
293 |
+
'filterable' => 0,
|
294 |
+
'comparable' => 0,
|
295 |
+
'unique' => false,
|
296 |
+
'user_defined' => true,
|
297 |
+
'used_in_product_listing' => false
|
298 |
+
));
|
299 |
+
|
300 |
+
|
301 |
+
/* ------ shipperhq_poss_boxes -------- SHQ16-1981 user_defined is false so cant be deleted */
|
302 |
+
$this->addAttribute('catalog_product', 'shipperhq_poss_boxes', array(
|
303 |
+
'type' => 'varchar',
|
304 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
305 |
+
'input' => 'multiselect',
|
306 |
+
'label' => 'Possible Packing Boxes',
|
307 |
+
'global' => false,
|
308 |
+
'visible' => 1,
|
309 |
+
'required' => 0,
|
310 |
+
'visible_on_front' => 0,
|
311 |
+
'is_html_allowed_on_front' => 0,
|
312 |
+
'searchable' => 0,
|
313 |
+
'filterable' => 0,
|
314 |
+
'comparable' => 0,
|
315 |
+
'is_configurable' => 0,
|
316 |
+
'unique' => false,
|
317 |
+
'user_defined' => false, //SHQ16-1981 user_defined is false so cant be deleted
|
318 |
+
'used_in_product_listing' => false
|
319 |
+
));
|
320 |
+
|
321 |
+
/* ------ ship_box_tolerance -------- */
|
322 |
+
$this->addAttribute('catalog_product', 'ship_box_tolerance', array(
|
323 |
+
'type' => 'int',
|
324 |
+
'input' => 'text',
|
325 |
+
'label' => 'Box Tolerance',
|
326 |
+
'global' => false,
|
327 |
+
'visible' => 1,
|
328 |
+
'required' => 0,
|
329 |
+
'visible_on_front' => 0,
|
330 |
+
'is_html_allowed_on_front' => 0,
|
331 |
+
'searchable' => 0,
|
332 |
+
'filterable' => 0,
|
333 |
+
'comparable' => 0,
|
334 |
+
'unique' => false,
|
335 |
+
'used_in_product_listing' => false,
|
336 |
+
'user_defined' => true,
|
337 |
+
'note' => 'Note: Ignore if unsure'
|
338 |
+
));
|
339 |
+
|
340 |
+
/* ------ shipperhq_malleable_product -------- */
|
341 |
+
$this->addAttribute('catalog_product', 'shipperhq_malleable_product', array(
|
342 |
+
'type' => 'int',
|
343 |
+
'input' => 'boolean',
|
344 |
+
'label' => 'Malleable Product',
|
345 |
+
'global' => false,
|
346 |
+
'visible' => 1,
|
347 |
+
'required' => 0,
|
348 |
+
'visible_on_front' => 0,
|
349 |
+
'is_html_allowed_on_front' => 0,
|
350 |
+
'searchable' => 0,
|
351 |
+
'filterable' => 0,
|
352 |
+
'comparable' => 0,
|
353 |
+
'unique' => false,
|
354 |
+
'user_defined' => true,
|
355 |
+
'note' => 'Ignore if unsure. Indicates the product dimensions can be adjusted to fit box',
|
356 |
+
'used_in_product_listing' => false
|
357 |
+
));
|
358 |
+
|
359 |
+
/* ------ shipperhq_master_boxes -------- */
|
360 |
+
$this->addAttribute('catalog_product', 'shipperhq_master_boxes', array(
|
361 |
+
'type' => 'varchar',
|
362 |
+
'backend' => 'eav/entity_attribute_backend_array',
|
363 |
+
'input' => 'multiselect',
|
364 |
+
'label' => 'Master Packing Boxes',
|
365 |
+
'global' => false,
|
366 |
+
'visible' => 1,
|
367 |
+
'required' => 0,
|
368 |
+
'visible_on_front' => 0,
|
369 |
+
'is_html_allowed_on_front' => 0,
|
370 |
+
'searchable' => 0,
|
371 |
+
'filterable' => 0,
|
372 |
+
'comparable' => 0,
|
373 |
+
'is_configurable' => 0,
|
374 |
+
'unique' => false,
|
375 |
+
'user_defined' => true,
|
376 |
+
'used_in_product_listing' => false
|
377 |
+
));
|
378 |
+
|
379 |
+
/* ------ shipperhq_availability_date -------- */
|
380 |
+
$this->addAttribute('catalog_product', 'shipperhq_availability_date', array(
|
381 |
+
'type' => 'datetime',
|
382 |
+
'backend' => 'eav/entity_attribute_backend_datetime',
|
383 |
+
'input' => 'date',
|
384 |
+
'label' => 'Availability Date',
|
385 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
|
386 |
+
'visible' => 1,
|
387 |
+
'required' => 0,
|
388 |
+
'visible_on_front' => 0,
|
389 |
+
'is_html_allowed_on_front' => 0,
|
390 |
+
'searchable' => 0,
|
391 |
+
'filterable' => 0,
|
392 |
+
'comparable' => 0,
|
393 |
+
'is_configurable' => 0,
|
394 |
+
'unique' => false,
|
395 |
+
'user_defined' => true,
|
396 |
+
'used_in_product_listing' => false
|
397 |
+
));
|
398 |
+
|
399 |
+
/*
|
400 |
+
*
|
401 |
+
*
|
402 |
+
*
|
403 |
+
*/
|
404 |
+
|
405 |
+
$entityTypeId = $installer->getEntityTypeId('catalog_product');
|
406 |
+
|
407 |
+
$attributeSetArr = $installer->getAllAttributeSetIds($entityTypeId);
|
408 |
+
|
409 |
+
|
410 |
+
$stdAttributeCodes = array('shipperhq_shipping_group' => '1', 'shipperhq_warehouse' => '10');
|
411 |
+
$dimAttributeCodes = array('ship_separately' => '2',
|
412 |
+
'shipperhq_dim_group' => '1',
|
413 |
+
'ship_length' => '10',
|
414 |
+
'ship_width' => '11',
|
415 |
+
'ship_height' => '12',
|
416 |
+
'shipperhq_poss_boxes' => '20',
|
417 |
+
);
|
418 |
+
|
419 |
+
foreach ($attributeSetArr as $attributeSetId) {
|
420 |
+
|
421 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Shipping', '99');
|
422 |
+
$installer->addAttributeGroup($entityTypeId, $attributeSetId, 'Dimensional Shipping', '100');
|
423 |
+
|
424 |
+
$attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Shipping');
|
425 |
+
$dimAttributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, 'Dimensional Shipping');
|
426 |
+
|
427 |
+
foreach($stdAttributeCodes as $code => $sort) {
|
428 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
429 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, $attributeId, $sort);
|
430 |
+
}
|
431 |
+
|
432 |
+
foreach($dimAttributeCodes as $code => $sort) {
|
433 |
+
$attributeId = $installer->getAttributeId($entityTypeId, $code);
|
434 |
+
$installer->addAttributeToGroup($entityTypeId, $attributeSetId, $dimAttributeGroupId, $attributeId, $sort);
|
435 |
+
}
|
436 |
+
|
437 |
+
};
|
438 |
+
|
439 |
+
|
440 |
+
|
441 |
+
$text = Mage::helper('wsalogger')->getNewVersion() > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text';
|
442 |
+
|
443 |
+
$isCheckout = array(
|
444 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
445 |
+
'comment' => 'Shipperhq Shipper',
|
446 |
+
'nullable' => 'false',
|
447 |
+
'default' => '0'
|
448 |
+
);
|
449 |
+
|
450 |
+
$carrierType = array(
|
451 |
+
'type' => $text,
|
452 |
+
'comment' => 'Shipperhq Carrier Type',
|
453 |
+
'nullable' => 'true',
|
454 |
+
);
|
455 |
+
|
456 |
+
$dispatchDate = array(
|
457 |
+
'type' => $text,
|
458 |
+
'length' => 20,
|
459 |
+
'comment' => 'Dispatch Date',
|
460 |
+
'nullable' => 'true');
|
461 |
+
|
462 |
+
$deliveryDate = array(
|
463 |
+
'type' => $text,
|
464 |
+
'length' => 20,
|
465 |
+
'comment' => 'Expected Delivery',
|
466 |
+
'nullable' => 'true');
|
467 |
+
|
468 |
+
$carrierNotice = array(
|
469 |
+
'type' => $text,
|
470 |
+
'comment' => 'Shipperhq Carrier Notice',
|
471 |
+
'nullable' => 'true',
|
472 |
+
);
|
473 |
+
|
474 |
+
$customDescription = array(
|
475 |
+
'type' => $text,
|
476 |
+
'comment' => 'Shipperhq Custom Description',
|
477 |
+
'nullable' => 'true',
|
478 |
+
);
|
479 |
+
|
480 |
+
$tooltip = array(
|
481 |
+
'type' => $text,
|
482 |
+
'comment' => 'Shipperhq Tooltip',
|
483 |
+
'nullable' => 'true',
|
484 |
+
);
|
485 |
+
|
486 |
+
$carrierId = array(
|
487 |
+
'type' => $text,
|
488 |
+
'length' => 20,
|
489 |
+
'comment' => 'Shipperhq Carrier ID',
|
490 |
+
'nullable' => 'true',
|
491 |
+
);
|
492 |
+
|
493 |
+
$customDuties = array(
|
494 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
|
495 |
+
'scale' => 4,
|
496 |
+
'precision' => 12,
|
497 |
+
'comment' => 'Shipperhq Custom Duties',
|
498 |
+
);
|
499 |
+
|
500 |
+
$confirmationNo = array(
|
501 |
+
'type' => $text,
|
502 |
+
'length' => 20,
|
503 |
+
'comment' => 'Shipperhq Confirmation Number',
|
504 |
+
'nullable' => 'true',
|
505 |
+
);
|
506 |
+
|
507 |
+
$deliveryComments = array(
|
508 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text',
|
509 |
+
'comment' => 'ShipperHQ Delivery Comments',
|
510 |
+
'nullable' => 'true',
|
511 |
+
);
|
512 |
+
|
513 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'is_checkout')){
|
514 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'is_checkout', $isCheckout);
|
515 |
+
}
|
516 |
+
|
517 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_type')){
|
518 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carrier_type', $carrierType);
|
519 |
+
}
|
520 |
+
|
521 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'dispatch_date')){
|
522 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'dispatch_date', $dispatchDate );
|
523 |
+
}
|
524 |
+
|
525 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'delivery_date')){
|
526 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'delivery_date', $deliveryDate );
|
527 |
+
}
|
528 |
+
|
529 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'shq_delivery_comments')){
|
530 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'shq_delivery_comments',$deliveryComments);
|
531 |
+
}
|
532 |
+
|
533 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type')){
|
534 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_type', $carrierType);
|
535 |
+
}
|
536 |
+
|
537 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'dispatch_date')){
|
538 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'dispatch_date', $dispatchDate );
|
539 |
+
}
|
540 |
+
|
541 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'delivery_date')){
|
542 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'),'delivery_date', $deliveryDate );
|
543 |
+
}
|
544 |
+
|
545 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice')){
|
546 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_notice', $carrierNotice);
|
547 |
+
}
|
548 |
+
|
549 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description')){
|
550 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_description', $customDescription);
|
551 |
+
}
|
552 |
+
|
553 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'tooltip')){
|
554 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'tooltip', $tooltip);
|
555 |
+
}
|
556 |
+
|
557 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id')){
|
558 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carrier_id', $carrierId);
|
559 |
+
}
|
560 |
+
|
561 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carrier_id')){
|
562 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'carrier_id', $carrierId );
|
563 |
+
}
|
564 |
+
|
565 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_id')){
|
566 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_id', $carrierId );
|
567 |
+
}
|
568 |
+
|
569 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'confirmation_number')){
|
570 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'confirmation_number', $confirmationNo );
|
571 |
+
}
|
572 |
+
|
573 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties')){
|
574 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'custom_duties', $customDuties);
|
575 |
+
}
|
576 |
+
|
577 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carrier_type')){
|
578 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'carrier_type', $carrierType );
|
579 |
+
}
|
580 |
+
|
581 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'dispatch_date')){
|
582 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'dispatch_date', $dispatchDate );
|
583 |
+
}
|
584 |
+
|
585 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'shq_delivery_comments')){
|
586 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'shq_delivery_comments',$deliveryComments);
|
587 |
+
}
|
588 |
+
|
589 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'delivery_date')){
|
590 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'delivery_date', $deliveryDate );
|
591 |
+
}
|
592 |
+
else {
|
593 |
+
$installer->getConnection()->modifyColumn(
|
594 |
+
$installer->getTable('sales/order'),
|
595 |
+
'delivery_date',
|
596 |
+
array(
|
597 |
+
'type' => $text,
|
598 |
+
'length' => 20,
|
599 |
+
'comment' => 'Expected Delivery',
|
600 |
+
'nullable' => 'true'
|
601 |
+
)
|
602 |
+
);
|
603 |
+
}
|
604 |
+
|
605 |
+
/*carrier group attributes*/
|
606 |
+
$version = Mage::helper('wsalogger')->getNewVersion();
|
607 |
+
|
608 |
+
$carriergroupAttr = array(
|
609 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
610 |
+
'comment' => 'Carrier Group',
|
611 |
+
'nullable' => 'true',
|
612 |
+
);
|
613 |
+
|
614 |
+
$carriergroupID = array(
|
615 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
616 |
+
'comment' => 'Carrier Group ID',
|
617 |
+
'nullable' => 'true',
|
618 |
+
);
|
619 |
+
|
620 |
+
$carriergroupDetails = array(
|
621 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
622 |
+
'comment' => 'Carrier Group Details',
|
623 |
+
'nullable' => 'true',
|
624 |
+
);
|
625 |
+
|
626 |
+
$carriergroupHtml = array(
|
627 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
628 |
+
'comment' => 'Carrier Group Html',
|
629 |
+
'nullable' => 'true',
|
630 |
+
);
|
631 |
+
|
632 |
+
$displayMerged = array(
|
633 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
634 |
+
'comment' => 'Checkout display type',
|
635 |
+
'nullable' => 'false',
|
636 |
+
'default' => '1'
|
637 |
+
);
|
638 |
+
|
639 |
+
$splitRates = array(
|
640 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
641 |
+
'comment' => 'Shipperhq Split Rates',
|
642 |
+
'nullable' => 'false',
|
643 |
+
'default' => '0'
|
644 |
+
);
|
645 |
+
|
646 |
+
$carriergroupShipping = array(
|
647 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
648 |
+
'comment' => 'Shipping Description',
|
649 |
+
'nullable' => 'true',
|
650 |
+
);
|
651 |
+
|
652 |
+
$destinationTypeAttr = array(
|
653 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text',
|
654 |
+
'comment' => 'ShipperHQ Address Type',
|
655 |
+
'nullable' => 'true',
|
656 |
+
);
|
657 |
+
|
658 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'destination_type')){
|
659 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'destination_type',$destinationTypeAttr);
|
660 |
+
}
|
661 |
+
|
662 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'destination_type')){
|
663 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'destination_type',$destinationTypeAttr);
|
664 |
+
}
|
665 |
+
|
666 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details')){
|
667 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_details', $carriergroupDetails);
|
668 |
+
}
|
669 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html')){
|
670 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'carriergroup_shipping_html', $carriergroupHtml);
|
671 |
+
}
|
672 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'checkout_display_merged')){
|
673 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'checkout_display_merged', $displayMerged);
|
674 |
+
}
|
675 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'split_rates')){
|
676 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'), 'split_rates', $splitRates);
|
677 |
+
}
|
678 |
+
|
679 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id')){
|
680 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_id', $carriergroupID);
|
681 |
+
}
|
682 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup')){
|
683 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup', $carriergroupAttr);
|
684 |
+
}
|
685 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details')){
|
686 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'carriergroup_shipping_details', $carriergroupDetails);
|
687 |
+
}
|
688 |
+
|
689 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup')){
|
690 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup', $carriergroupAttr);
|
691 |
+
}
|
692 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup')){
|
693 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup', $carriergroupAttr);
|
694 |
+
}
|
695 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_id')){
|
696 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_id', $carriergroupID);
|
697 |
+
}
|
698 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_id')){
|
699 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_id', $carriergroupID);
|
700 |
+
}
|
701 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_item'), 'carriergroup_shipping')){
|
702 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'carriergroup_shipping', $carriergroupShipping);
|
703 |
+
}
|
704 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order_item'), 'carriergroup_shipping')){
|
705 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'carriergroup_shipping', $carriergroupShipping);
|
706 |
+
}
|
707 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping')){
|
708 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_shipping', $carriergroupShipping);
|
709 |
+
}
|
710 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup')){
|
711 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup', $carriergroupAttr);
|
712 |
+
}
|
713 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_item'), 'carriergroup_id')){
|
714 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_item'), 'carriergroup_id', $carriergroupID);
|
715 |
+
}
|
716 |
+
|
717 |
+
|
718 |
+
if (Mage::helper('wsalogger')->getNewVersion() >= 8) {
|
719 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment_grid'), 'carriergroup')){
|
720 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment_grid'),'carriergroup',$carriergroupAttr);
|
721 |
+
}
|
722 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'carriergroup')){
|
723 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'carriergroup',$carriergroupAttr);
|
724 |
+
}
|
725 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/shipment'), 'shipping_description')){
|
726 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/shipment'),'shipping_description',array(
|
727 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
728 |
+
'length' => 255,
|
729 |
+
'comment' => 'Shipping Description',
|
730 |
+
'nullable' => 'true',));
|
731 |
+
}
|
732 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_html')){
|
733 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_html', $carriergroupHtml);
|
734 |
+
}
|
735 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'carriergroup_shipping_details')){
|
736 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'carriergroup_shipping_details', $carriergroupDetails);
|
737 |
+
}
|
738 |
+
if (Mage::helper('wsalogger')->isEnterpriseEdition() && $installer->tableExists('enterprise_sales_shipment_grid_archive')) {
|
739 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('enterprise_sales_shipment_grid_archive'), 'carriergroup')){
|
740 |
+
$installer->getConnection()->addColumn($installer->getTable('enterprise_sales_shipment_grid_archive'),'carriergroup',$carriergroupAttr);
|
741 |
+
}
|
742 |
+
}
|
743 |
+
}
|
744 |
+
|
745 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/storage'))) {
|
746 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/storage'));
|
747 |
+
|
748 |
+
$table
|
749 |
+
->addColumn('quote_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
750 |
+
'primary' => true,
|
751 |
+
'nullable' => false,
|
752 |
+
'unsigned' => true
|
753 |
+
))
|
754 |
+
->addColumn('data', Varien_Db_Ddl_Table::TYPE_TEXT, '512k', array('nullable' => false))
|
755 |
+
->addForeignKey(
|
756 |
+
$this->getFkName('shipperhq_shipper/storage', 'quote_id', 'sales/quote', 'entity_id'),
|
757 |
+
'quote_id',
|
758 |
+
$this->getTable('sales/quote'),
|
759 |
+
'entity_id',
|
760 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
761 |
+
)
|
762 |
+
;
|
763 |
+
$this->getConnection()->createTable($table);
|
764 |
+
}
|
765 |
+
|
766 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_packages'))) {
|
767 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_packages'));
|
768 |
+
|
769 |
+
$table
|
770 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
771 |
+
'primary' => true,
|
772 |
+
'nullable' => false,
|
773 |
+
'unsigned' => true,
|
774 |
+
'auto_increment' => true
|
775 |
+
))
|
776 |
+
->addColumn('address_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
777 |
+
'nullable' => false,
|
778 |
+
'unsigned' => true
|
779 |
+
))
|
780 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
781 |
+
'nullable' => false,
|
782 |
+
))
|
783 |
+
->addColumn('carrier_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
784 |
+
'nullable' => false,
|
785 |
+
))
|
786 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
787 |
+
'nullable' => false,
|
788 |
+
))
|
789 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
790 |
+
'nullable' => true
|
791 |
+
))
|
792 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
793 |
+
'nullable' => true
|
794 |
+
))
|
795 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
796 |
+
'nullable' => true
|
797 |
+
))
|
798 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
799 |
+
'nullable' => true
|
800 |
+
))
|
801 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
802 |
+
'nullable' => true
|
803 |
+
))
|
804 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
805 |
+
'nullable' => true
|
806 |
+
))
|
807 |
+
->addForeignKey(
|
808 |
+
$this->getFkName('shipperhq_shipper/quote_packages', 'address_id', 'sales/quote_address', 'address_id'),
|
809 |
+
'address_id',
|
810 |
+
$this->getTable('sales/quote_address'),
|
811 |
+
'address_id',
|
812 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
813 |
+
)
|
814 |
+
;
|
815 |
+
$this->getConnection()->createTable($table);
|
816 |
+
}
|
817 |
+
|
818 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/quote_package_items'))) {
|
819 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/quote_package_items'));
|
820 |
+
|
821 |
+
$table
|
822 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
823 |
+
'nullable' => false,
|
824 |
+
))
|
825 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
826 |
+
'nullable' => false,
|
827 |
+
))
|
828 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
829 |
+
'nullable' => true
|
830 |
+
))
|
831 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
832 |
+
'nullable' => true
|
833 |
+
))
|
834 |
+
->addForeignKey(
|
835 |
+
$this->getFkName('shipperhq_shipper/quote_package_items', 'package_id', 'shipperhq_shipper/quote_packages', 'package_id'),
|
836 |
+
'package_id',
|
837 |
+
$this->getTable('shipperhq_shipper/quote_packages'),
|
838 |
+
'package_id',
|
839 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
840 |
+
)
|
841 |
+
;
|
842 |
+
$this->getConnection()->createTable($table);
|
843 |
+
}
|
844 |
+
|
845 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_packages'))) {
|
846 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_packages'));
|
847 |
+
|
848 |
+
$table
|
849 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
850 |
+
'primary' => true,
|
851 |
+
'nullable' => false,
|
852 |
+
'unsigned' => true,
|
853 |
+
'auto_increment' => true
|
854 |
+
))
|
855 |
+
->addColumn('order_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
856 |
+
'nullable' => false,
|
857 |
+
'unsigned' => true
|
858 |
+
))
|
859 |
+
->addColumn('carrier_group_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
860 |
+
'nullable' => false,
|
861 |
+
))
|
862 |
+
->addColumn('package_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
863 |
+
'nullable' => false,
|
864 |
+
))
|
865 |
+
->addColumn('length', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
866 |
+
'nullable' => true
|
867 |
+
))
|
868 |
+
->addColumn('width', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
869 |
+
'nullable' => true
|
870 |
+
))
|
871 |
+
->addColumn('height', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
872 |
+
'nullable' => true
|
873 |
+
))
|
874 |
+
->addColumn('weight', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
875 |
+
'nullable' => true
|
876 |
+
))
|
877 |
+
->addColumn('declared_value', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
878 |
+
'nullable' => true
|
879 |
+
))
|
880 |
+
->addColumn('surcharge_price', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
881 |
+
'nullable' => true
|
882 |
+
))
|
883 |
+
->addForeignKey(
|
884 |
+
$this->getFkName('shipperhq_shipper/order_packages', 'order_id', 'sales/order', 'entity_id'),
|
885 |
+
'order_id',
|
886 |
+
$this->getTable('sales/order'),
|
887 |
+
'entity_id',
|
888 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
889 |
+
)
|
890 |
+
;
|
891 |
+
$this->getConnection()->createTable($table);
|
892 |
+
}
|
893 |
+
|
894 |
+
if(!$installer->getConnection()->isTableExists($this->getTable('shipperhq_shipper/order_package_items'))) {
|
895 |
+
$table = $this->getConnection()->newTable($this->getTable('shipperhq_shipper/order_package_items'));
|
896 |
+
|
897 |
+
$table
|
898 |
+
->addColumn('package_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
899 |
+
'nullable' => false,
|
900 |
+
'unsigned' => true,
|
901 |
+
))
|
902 |
+
->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
|
903 |
+
'nullable' => false,
|
904 |
+
))
|
905 |
+
->addColumn('qty_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
906 |
+
'nullable' => true
|
907 |
+
))
|
908 |
+
->addColumn('weight_packed', Varien_Db_Ddl_Table::TYPE_FLOAT , array(
|
909 |
+
'nullable' => true
|
910 |
+
))
|
911 |
+
->addForeignKey(
|
912 |
+
$this->getFkName('shipperhq_shipper/order_package_items', 'package_id', 'shipperhq_shipper/order_packages', 'package_id'),
|
913 |
+
'package_id',
|
914 |
+
$this->getTable('shipperhq_shipper/order_packages'),
|
915 |
+
'package_id',
|
916 |
+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE
|
917 |
+
)
|
918 |
+
;
|
919 |
+
$this->getConnection()->createTable($table);
|
920 |
+
}
|
921 |
+
|
922 |
+
/**
|
923 |
+
* We use this for some of the EE layout updates
|
924 |
+
*/
|
925 |
+
$isEnterprise = Mage::helper('wsalogger')->isEnterpriseEdition();
|
926 |
+
|
927 |
+
if($isEnterprise) {
|
928 |
+
$config = new Mage_Core_Model_Config();
|
929 |
+
$config->saveConfig('carriers/shipper/is_enterprise', "1", 'default', 0);
|
930 |
+
}
|
931 |
+
|
932 |
+
$installer->endSetup();
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.30-0.0.31.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
/* ------ shipperhq_availability_date -------- */
|
8 |
+
$this->addAttribute('catalog_product', 'shipperhq_availability_date', array(
|
9 |
+
'type' => 'datetime',
|
10 |
+
'backend' => 'eav/entity_attribute_backend_datetime',
|
11 |
+
'input' => 'date',
|
12 |
+
'label' => 'Availability Date',
|
13 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
|
14 |
+
'visible' => 1,
|
15 |
+
'required' => 0,
|
16 |
+
'visible_on_front' => 0,
|
17 |
+
'is_html_allowed_on_front' => 0,
|
18 |
+
'searchable' => 0,
|
19 |
+
'filterable' => 0,
|
20 |
+
'comparable' => 0,
|
21 |
+
'is_configurable' => 0,
|
22 |
+
'unique' => false,
|
23 |
+
'user_defined' => true,
|
24 |
+
'used_in_product_listing' => false
|
25 |
+
));
|
26 |
+
|
27 |
+
$installer->endSetup();
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.31-0.0.32.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
SELECT @attribute_id:=attribute_id FROM {$installer->getTable('eav_attribute')} WHERE attribute_code='shipperhq_warehouse';
|
9 |
+
|
10 |
+
INSERT into {$installer->getTable('catalog_product_entity_text')} (entity_type_id, attribute_id, store_id, entity_id, value)
|
11 |
+
SELECT entity_type_id, attribute_id, store_id, entity_id, value
|
12 |
+
FROM {$installer->getTable('catalog_product_entity_varchar')}
|
13 |
+
WHERE attribute_id = @attribute_id ;
|
14 |
+
|
15 |
+
DELETE FROM {$installer->getTable('catalog_product_entity_varchar')} WHERE attribute_id = @attribute_id;
|
16 |
+
");
|
17 |
+
|
18 |
+
$installer->endSetup();
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.32-0.0.33.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$deliveryComments = array(
|
7 |
+
'type' => $version > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text',
|
8 |
+
'comment' => 'ShipperHQ Delivery Comments',
|
9 |
+
'nullable' => 'true',
|
10 |
+
);
|
11 |
+
|
12 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address'), 'shq_delivery_comments')){
|
13 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address'),'shq_delivery_comments',$deliveryComments);
|
14 |
+
}
|
15 |
+
|
16 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/order'), 'shq_delivery_comments')){
|
17 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/order'),'shq_delivery_comments',$deliveryComments);
|
18 |
+
}
|
19 |
+
|
20 |
+
$installer->endSetup();
|
app/code/community/Shipperhq/Shipper/sql/shipperhq_shipper_setup/mysql4-upgrade-0.0.33-0.0.34.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$text = Mage::helper('wsalogger')->getNewVersion() > 10 ? Varien_Db_Ddl_Table::TYPE_TEXT : 'text';
|
7 |
+
|
8 |
+
$tooltip = array(
|
9 |
+
'type' => $text,
|
10 |
+
'comment' => 'Shipperhq Tooltip',
|
11 |
+
'nullable' => 'true',
|
12 |
+
);
|
13 |
+
|
14 |
+
|
15 |
+
if(!$installer->getConnection()->tableColumnExists($installer->getTable('sales/quote_address_shipping_rate'), 'tooltip')){
|
16 |
+
$installer->getConnection()->addColumn($installer->getTable('sales/quote_address_shipping_rate'), 'tooltip', $tooltip);
|
17 |
+
}
|
18 |
+
|
19 |
+
$installer->endSetup();
|
app/code/community/Webshopapps/Adminshortcut/Helper/Data.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Mage
|
22 |
-
* @package Mage_Shipping
|
23 |
-
* @copyright Copyright (c) 2013 Zowta Ltd (http://www.WebShopApps.com)
|
24 |
-
* Copyright, 2013, Zowta, LLC - US license
|
25 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
-
*/
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Shipping data helper
|
30 |
-
*/
|
31 |
-
class Webshopapps_Adminshortcut_Helper_Data extends Mage_Core_Helper_Abstract
|
32 |
-
{
|
33 |
-
|
34 |
-
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Webshopapps/Adminshortcut/changelog.txt
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
1.0 - Initial release with hardcoded links
|
|
app/code/community/Webshopapps/Adminshortcut/etc/adminhtml.xml
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* Magento Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* @category Webshopapps
|
23 |
-
* @package Webshopapps_Boxmenu
|
24 |
-
* @copyright Copyright (c) 2013 Zowta Ltd (http://www.WebShopApps.com)
|
25 |
-
* Copyright, 2013, Zowta, LLC - US license
|
26 |
-
* @license http://www.webshopapps.com/license/license.txt
|
27 |
-
* @author Karen Baker <sales@webshopapps.com>
|
28 |
-
*/
|
29 |
-
-->
|
30 |
-
<config>
|
31 |
-
<menu>
|
32 |
-
<adminshortcut>
|
33 |
-
<title>Shortcuts</title>
|
34 |
-
<sort_order>200</sort_order>
|
35 |
-
<children>
|
36 |
-
<shipping_methods translate="title" module="adminshortcut">
|
37 |
-
<title>Shipping Methods</title>
|
38 |
-
<action>adminhtml/system_config/edit/section/carriers</action>
|
39 |
-
</shipping_methods>
|
40 |
-
<shipping_settings translate="title" module="adminshortcut">
|
41 |
-
<title>Shipping Settings</title>
|
42 |
-
<action>adminhtml/system_config/edit/section/shipping</action>
|
43 |
-
</shipping_settings>
|
44 |
-
<attributes translate="title" module="adminshortcut">
|
45 |
-
<title>Attributes</title>
|
46 |
-
<action>adminhtml/catalog_product_attribute</action>
|
47 |
-
</attributes>
|
48 |
-
<logger translate="title" module="adminshortcut">
|
49 |
-
<title>WebShopApps Logger</title>
|
50 |
-
<action>adminhtml/system_config/edit/section/wsalogmenu</action>
|
51 |
-
</logger>
|
52 |
-
<dev_logger translate="title" module="adminshortcut">
|
53 |
-
<title>Developer Logging</title>
|
54 |
-
<action>adminhtml/system_config/edit/section/dev</action>
|
55 |
-
</dev_logger>
|
56 |
-
</children>
|
57 |
-
</adminshortcut>
|
58 |
-
</menu>
|
59 |
-
<acl>
|
60 |
-
<resources>
|
61 |
-
<admin>
|
62 |
-
<children>
|
63 |
-
<adminshortcut>
|
64 |
-
<title>Shortcuts</title>
|
65 |
-
<sort_order>200</sort_order>
|
66 |
-
<children>
|
67 |
-
<shipping_methods translate="title">
|
68 |
-
<title>Shipping Methods</title>
|
69 |
-
</shipping_methods>
|
70 |
-
<shipping_methods translate="title">
|
71 |
-
<title>Shipping Settings</title>
|
72 |
-
</shipping_methods>
|
73 |
-
<attributes translate="title">
|
74 |
-
<title>Attributes</title>
|
75 |
-
</attributes>
|
76 |
-
<logger translate="title">
|
77 |
-
<title>WebShopApps Logger</title>
|
78 |
-
</logger>
|
79 |
-
<dev_logger translate="title">
|
80 |
-
<title>Developer Logging</title>
|
81 |
-
</dev_logger>
|
82 |
-
</children>
|
83 |
-
</adminshortcut>
|
84 |
-
</children>
|
85 |
-
</admin>
|
86 |
-
</resources>
|
87 |
-
</acl>
|
88 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Webshopapps/Adminshortcut/etc/config.xml
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* Magento Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
@category Webshopapps
|
23 |
-
* @package Webshopapps_Wsavalidation
|
24 |
-
* @copyright Copyright (c) 2013 Zowta Ltd (http://www.WebShopApps.com)
|
25 |
-
* Copyright, 2013, Zowta, LLC - US license
|
26 |
-
* @license http://www.webshopapps.com/license/license.txt
|
27 |
-
* @author Karen Baker <sales@webshopapps.com
|
28 |
-
*
|
29 |
-
*/
|
30 |
-
-->
|
31 |
-
<config>
|
32 |
-
<modules>
|
33 |
-
<Webshopapps_Adminshortcut>
|
34 |
-
<version>0.0.1</version>
|
35 |
-
</Webshopapps_Adminshortcut>
|
36 |
-
</modules>
|
37 |
-
<global>
|
38 |
-
<helpers>
|
39 |
-
<adminshortcut>
|
40 |
-
<class>Webshopapps_Adminshortcut_Helper</class>
|
41 |
-
</adminshortcut>
|
42 |
-
</helpers>
|
43 |
-
</global>
|
44 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/shipperhq/pbint.xml
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<shipperhq_pbint_add_order_total>
|
4 |
-
<reference name="order_totals">
|
5 |
-
<block type="shipperhq_postorder/sales_order_duty" name="total_shqpbint_duty"/>
|
6 |
-
</reference>
|
7 |
-
</shipperhq_pbint_add_order_total>
|
8 |
-
<shipperhq_pbint_add_invoice_total>
|
9 |
-
<reference name="invoice_totals">
|
10 |
-
<block type="shipperhq_pbint/sales_order_duty" name="total_shqpbint_duty"/>
|
11 |
-
</reference>
|
12 |
-
</shipperhq_pbint_add_invoice_total>
|
13 |
-
<shipperhq_pbint_add_creditmemo_total>
|
14 |
-
<reference name="creditmemo_totals">
|
15 |
-
<block type="shipperhq_pbint/sales_order_duty" name="total_shqpbint_duty"/>
|
16 |
-
</reference>
|
17 |
-
</shipperhq_pbint_add_creditmemo_total>
|
18 |
-
|
19 |
-
<!--covered by postorder layout updates -->
|
20 |
-
<!--<adminhtml_sales_order_view>-->
|
21 |
-
<!--<update handle="shipperhq_pbint_add_order_total" />-->
|
22 |
-
<!--</adminhtml_sales_order_view>-->
|
23 |
-
<!--<adminhtml_sales_order_invoice_new>-->
|
24 |
-
<!--<update handle="shipperhq_pbint_add_invoice_total" />-->
|
25 |
-
<!--</adminhtml_sales_order_invoice_new>-->
|
26 |
-
<!--<adminhtml_sales_order_invoice_updateqty>-->
|
27 |
-
<!--<update handle="shipperhq_pbint_add_invoice_total" />-->
|
28 |
-
<!--</adminhtml_sales_order_invoice_updateqty>-->
|
29 |
-
<adminhtml_sales_order_invoice_view>
|
30 |
-
<update handle="shipperhq_pbint_add_invoice_total" />
|
31 |
-
</adminhtml_sales_order_invoice_view>
|
32 |
-
<!--<adminhtml_sales_order_creditmemo_new>-->
|
33 |
-
<!--<update handle="shipperhq_pbint_add_creditmemo_total" />-->
|
34 |
-
<!--</adminhtml_sales_order_creditmemo_new>-->
|
35 |
-
<!--<adminhtml_sales_order_creditmemo_updateqty>-->
|
36 |
-
<!--<update handle="shipperhq_pbint_add_creditmemo_total" />-->
|
37 |
-
<!--</adminhtml_sales_order_creditmemo_updateqty>-->
|
38 |
-
<adminhtml_sales_order_creditmemo_view>
|
39 |
-
<update handle="shipperhq_pbint_add_creditmemo_total" />
|
40 |
-
</adminhtml_sales_order_creditmemo_view>
|
41 |
-
|
42 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/shipperhq/shipper.xml
CHANGED
@@ -39,6 +39,7 @@
|
|
39 |
<default>
|
40 |
<reference name="notifications">
|
41 |
<block type="shipperhq_shipper/adminhtml_synchronize_notify" name="synchronize_notify" template="shipperhq/shipper/synchronize/notify.phtml"></block>
|
|
|
42 |
</reference>
|
43 |
</default>
|
44 |
<adminhtml_catalog_product_edit>
|
39 |
<default>
|
40 |
<reference name="notifications">
|
41 |
<block type="shipperhq_shipper/adminhtml_synchronize_notify" name="synchronize_notify" template="shipperhq/shipper/synchronize/notify.phtml"></block>
|
42 |
+
<block type="shipperhq_shipper/adminhtml_carrier_notify" name="carrier_notify" template="shipperhq/shipper/carrier/notify.phtml"></block>
|
43 |
</reference>
|
44 |
</default>
|
45 |
<adminhtml_catalog_product_edit>
|
app/design/adminhtml/default/default/template/shipperhq/frontend/sales/order/create/shipping_method/available.phtml
CHANGED
@@ -39,10 +39,13 @@
|
|
39 |
<?php if (!($_shippingRateGroups = $this->getShippingRates())): ?>
|
40 |
<strong><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></strong>
|
41 |
<?php $_noRates = true; ?>
|
|
|
42 |
<?php else: ?>
|
43 |
<dl class="sp-methods">
|
44 |
<?php $_sole = false; foreach ($_shippingRateGroups as $code => $_rates): ?>
|
45 |
-
|
|
|
|
|
46 |
<?php $showCarrierNotice = false; ?>
|
47 |
<?php if ($_showTooltip): ?>
|
48 |
<b class="helpcursor" title="<?php echo $this->getToolTipText() ?>">
|
@@ -64,7 +67,7 @@
|
|
64 |
<?php endif; ?>
|
65 |
<ul>
|
66 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
67 |
-
<div id="ship_options_<?php echo $code ?>"
|
68 |
<div id="radio_choices_<?php echo $code ?>">
|
69 |
<?php endif ?>
|
70 |
<?php $_sole = false; foreach ($_rates as $_rate): ?>
|
@@ -126,7 +129,8 @@
|
|
126 |
</li>
|
127 |
</ul>
|
128 |
</dd>
|
129 |
-
|
|
|
130 |
<?php endif; ?>
|
131 |
<?php else: ?>
|
132 |
<?php if (!($_carrierGroupRates = $this->getCarrierGroupRates())): ?>
|
@@ -171,7 +175,7 @@
|
|
171 |
<?php endif; ?>
|
172 |
<ul>
|
173 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
174 |
-
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>"
|
175 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
176 |
<?php endif ?>
|
177 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
@@ -286,7 +290,10 @@
|
|
286 |
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make neccessary changes in your shipping address.'));
|
287 |
return false;
|
288 |
}
|
289 |
-
|
|
|
|
|
|
|
290 |
var shippingMethodSection = $('order-shipping-method-choose');
|
291 |
var carrierGroupCount = shippingMethodSection.select('.carrier-group-name').length;
|
292 |
var selectedMethods = 0;
|
39 |
<?php if (!($_shippingRateGroups = $this->getShippingRates())): ?>
|
40 |
<strong><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></strong>
|
41 |
<?php $_noRates = true; ?>
|
42 |
+
<?php $singleCGId = ''; ?>
|
43 |
<?php else: ?>
|
44 |
<dl class="sp-methods">
|
45 |
<?php $_sole = false; foreach ($_shippingRateGroups as $code => $_rates): ?>
|
46 |
+
<?php $singleCGId = $_rates[0]->getCarriergroupId(); ?>
|
47 |
+
|
48 |
+
<dt><?php echo $this->getCarrierName($code) ?>
|
49 |
<?php $showCarrierNotice = false; ?>
|
50 |
<?php if ($_showTooltip): ?>
|
51 |
<b class="helpcursor" title="<?php echo $this->getToolTipText() ?>">
|
67 |
<?php endif; ?>
|
68 |
<ul>
|
69 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
70 |
+
<div id="ship_options_<?php echo $code ?>" name="ship_options">
|
71 |
<div id="radio_choices_<?php echo $code ?>">
|
72 |
<?php endif ?>
|
73 |
<?php $_sole = false; foreach ($_rates as $_rate): ?>
|
129 |
</li>
|
130 |
</ul>
|
131 |
</dd>
|
132 |
+
<input type=hidden name="carriergroup_id" id="carriergroup_id" value='<?php echo $singleCGId; ?>' />
|
133 |
+
<?php endif; ?>
|
134 |
<?php endif; ?>
|
135 |
<?php else: ?>
|
136 |
<?php if (!($_carrierGroupRates = $this->getCarrierGroupRates())): ?>
|
175 |
<?php endif; ?>
|
176 |
<ul>
|
177 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
178 |
+
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>" class="ship_options">
|
179 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
180 |
<?php endif ?>
|
181 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
290 |
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make neccessary changes in your shipping address.'));
|
291 |
return false;
|
292 |
}
|
293 |
+
var isVirtual = '<?php echo $this->getQuote()->isVirtual(); ?>';
|
294 |
+
if (isVirtual) {
|
295 |
+
return true;
|
296 |
+
}
|
297 |
var shippingMethodSection = $('order-shipping-method-choose');
|
298 |
var carrierGroupCount = shippingMethodSection.select('.carrier-group-name').length;
|
299 |
var selectedMethods = 0;
|
app/design/adminhtml/default/default/template/shipperhq/migrate_extension.phtml
CHANGED
@@ -56,7 +56,6 @@
|
|
56 |
|
57 |
<script type="text/javascript">
|
58 |
//<![CDATA[
|
59 |
-
|
60 |
function migrateSelectClick(id, toid, totype)
|
61 |
{
|
62 |
var info = $(id).select('select');
|
56 |
|
57 |
<script type="text/javascript">
|
58 |
//<![CDATA[
|
|
|
59 |
function migrateSelectClick(id, toid, totype)
|
60 |
{
|
61 |
var info = $(id).select('select');
|
app/{code/community/Shipperhq/Pbint/Model/Mysql4/Inboundparcel.php → design/adminhtml/default/default/template/shipperhq/shipper/carrier/notify.phtml}
RENAMED
@@ -1,39 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
*
|
15 |
-
*
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
*
|
20 |
-
*
|
21 |
-
*
|
22 |
-
*
|
23 |
-
*
|
24 |
-
*
|
25 |
-
* @
|
26 |
-
* @
|
27 |
-
* @
|
28 |
-
* @
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Webshopapps Shipping Module
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* Shipper HQ Shipping
|
23 |
+
*
|
24 |
+
* @category ShipperHQ
|
25 |
+
* @package ShipperHQ_Shipping_Carrier
|
26 |
+
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
+
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
+
*/
|
30 |
+
/**
|
31 |
+
* @see Shipperhq_Shipper_Block_Adminhtml_Synchronize_Notify
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<div class="notification-global notification-global-notice">
|
35 |
+
<strong><?php echo $this->helper('adminhtml')->__('Your ShipperHQ credentials saved in Magento are invalid. You will no longer receive shipping rates until this is rectified') ?></strong>
|
36 |
+
<?php echo $this->helper('index')->__('Click here to go to <a href="%s">Shipping Method Configuration</a>.', $this->getConfigUrl());?>
|
37 |
+
</div>
|
38 |
+
|
|
app/design/adminhtml/default/default/template/shipperhq/shipper/synchronize/notify.phtml
CHANGED
@@ -32,7 +32,7 @@
|
|
32 |
*/
|
33 |
?>
|
34 |
<div class="notification-global notification-global-notice">
|
35 |
-
<strong><?php echo $this->helper('adminhtml')->__('You need to synchronize with ShipperHQ') ?></strong>
|
36 |
<?php echo $this->helper('index')->__('Click here to go to <a href="%s">ShipperHQ Synchronization</a>.', $this->getSynchUrl());?>
|
37 |
</div>
|
38 |
|
32 |
*/
|
33 |
?>
|
34 |
<div class="notification-global notification-global-notice">
|
35 |
+
<strong><?php echo $this->helper('adminhtml')->__('You may need to synchronize with ShipperHQ') ?></strong>
|
36 |
<?php echo $this->helper('index')->__('Click here to go to <a href="%s">ShipperHQ Synchronization</a>.', $this->getSynchUrl());?>
|
37 |
</div>
|
38 |
|
app/design/adminhtml/default/default/template/shipperhq/upload.phtml
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* Webshopapps Shipping Module
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/osl-3.0.php
|
12 |
-
* If you did not receive a copy of the license and are unable to
|
13 |
-
* obtain it through the world-wide-web, please send an email
|
14 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
-
*
|
16 |
-
* DISCLAIMER
|
17 |
-
*
|
18 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
-
* versions in the future. If you wish to customize Magento for your
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* Shipper HQ Shipping
|
23 |
-
*
|
24 |
-
* @category ShipperHQ
|
25 |
-
* @package ShipperHQ_Shipping_Carrier
|
26 |
-
* @copyright Copyright (c) 2014 Zowta LLC (http://www.ShipperHQ.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
* @author ShipperHQ Team sales@shipperhq.com
|
29 |
-
*/
|
30 |
-
?>
|
31 |
-
<?php
|
32 |
-
/**
|
33 |
-
* @see Shipperhq_Shipper_Block_Adminhtml_Carrier_Allowedmethods.php
|
34 |
-
*/
|
35 |
-
?>
|
36 |
-
|
37 |
-
<script type="text/javascript">
|
38 |
-
//<![CDATA[
|
39 |
-
function uploadCatalog() {
|
40 |
-
var elem = $('<?php echo $this->getHtmlId() ?>');
|
41 |
-
new Ajax.Request('<?php echo $this->getAjaxUrl() ?>', {
|
42 |
-
onSuccess: function(response) {
|
43 |
-
try {
|
44 |
-
response = response.responseText.evalJSON();
|
45 |
-
result = response.message;
|
46 |
-
if (response.result == 1) {
|
47 |
-
elem.removeClassName('fail').removeClassName('warning').addClassName('success')
|
48 |
-
|
49 |
-
}
|
50 |
-
else if(response.result == 2){
|
51 |
-
elem.removeClassName('success').removeClassName('fail').addClassName('warning')
|
52 |
-
}
|
53 |
-
else {
|
54 |
-
elem.removeClassName('success').removeClassName('warning').addClassName('fail')
|
55 |
-
}
|
56 |
-
} catch (e) {
|
57 |
-
console.log(e);
|
58 |
-
elem.removeClassName('success').addClassName('fail')
|
59 |
-
}
|
60 |
-
$('uploadcatalog_result').update(result);
|
61 |
-
var currentMessages = response.session_messages;
|
62 |
-
$('messages').update(currentMessages);
|
63 |
-
|
64 |
-
}
|
65 |
-
});
|
66 |
-
}
|
67 |
-
//]]>
|
68 |
-
</script>
|
69 |
-
<button onclick="javascript:uploadCatalog(); return false;" class="scalable" type="button" id="<?php echo $this->getHtmlId() ?>">
|
70 |
-
<span id="uploadcatalog_result"><?php echo $this->escapeHtml($this->getButtonLabel()) ?></span>
|
71 |
-
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/layout/shipperhq/pbint.xml
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<shipperhq_pbint_add_order_total>
|
4 |
-
<reference name="order_totals">
|
5 |
-
<block type="shipperhq_pbint/sales_order_duty" name="total_shqpbint_duty"/>
|
6 |
-
</reference>
|
7 |
-
</shipperhq_pbint_add_order_total>
|
8 |
-
<shipperhq_pbint_add_invoice_total>
|
9 |
-
<reference name="invoice_totals">
|
10 |
-
<block type="shipperhq_pbint/sales_order_duty" name="total_shqpbint_duty"/>
|
11 |
-
</reference>
|
12 |
-
</shipperhq_pbint_add_invoice_total>
|
13 |
-
<shipperhq_pbint_add_creditmemo_total>
|
14 |
-
<reference name="creditmemo_totals">
|
15 |
-
<block type="shipperhq_pbint/sales_order_duty" name="total_shqpbint_duty"/>
|
16 |
-
</reference>
|
17 |
-
</shipperhq_pbint_add_creditmemo_total>
|
18 |
-
|
19 |
-
<sales_order_view>
|
20 |
-
<update handle="shipperhq_pbint_add_order_total"/>
|
21 |
-
</sales_order_view>
|
22 |
-
<sales_order_invoice>
|
23 |
-
<update handle="shipperhq_pbint_add_invoice_total"/>
|
24 |
-
</sales_order_invoice>
|
25 |
-
<sales_order_creditmemo>
|
26 |
-
<update handle="shipperhq_pbint_add_creditmemo_total"/>
|
27 |
-
</sales_order_creditmemo>
|
28 |
-
<sales_order_print>
|
29 |
-
<update handle="shipperhq_pbint_add_order_total"/>
|
30 |
-
</sales_order_print>
|
31 |
-
<sales_order_printinvoice>
|
32 |
-
<update handle="shipperhq_pbint_add_invoice_total"/>
|
33 |
-
</sales_order_printinvoice>
|
34 |
-
<sales_order_printcreditmemo>
|
35 |
-
<update handle="shipperhq_pbint_add_creditmemo_total"/>
|
36 |
-
</sales_order_printcreditmemo>
|
37 |
-
<sales_email_order_items>
|
38 |
-
<update handle="shipperhq_pbint_add_order_total"/>
|
39 |
-
</sales_email_order_items>
|
40 |
-
<sales_email_order_invoice_items>
|
41 |
-
<update handle="shipperhq_pbint_add_invoice_total"/>
|
42 |
-
</sales_email_order_invoice_items>
|
43 |
-
<sales_email_order_creditmemo_items>
|
44 |
-
<update handle="shipperhq_pbint_add_creditmemo_total"/>
|
45 |
-
</sales_email_order_creditmemo_items>
|
46 |
-
<sales_guest_view>
|
47 |
-
<update handle="shipperhq_pbint_add_order_total"/>
|
48 |
-
</sales_guest_view>
|
49 |
-
<sales_guest_invoice>
|
50 |
-
<update handle="shipperhq_pbint_add_invoice_total"/>
|
51 |
-
</sales_guest_invoice>
|
52 |
-
<sales_guest_creditmemo>
|
53 |
-
<update handle="shipperhq_pbint_add_creditmemo_total"/>
|
54 |
-
</sales_guest_creditmemo>
|
55 |
-
<sales_guest_print>
|
56 |
-
<update handle="shipperhq_pbint_add_order_total"/>
|
57 |
-
</sales_guest_print>
|
58 |
-
<sales_guest_printinvoice>
|
59 |
-
<update handle="shipperhq_pbint_add_invoice_total"/>
|
60 |
-
</sales_guest_printinvoice>
|
61 |
-
<sales_guest_printcreditmemo>
|
62 |
-
<update handle="shipperhq_pbint_add_creditmemo_total"/>
|
63 |
-
</sales_guest_printcreditmemo>
|
64 |
-
|
65 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/shipperhq/checkout/cart/rwd/shipping.phtml
CHANGED
@@ -107,11 +107,20 @@
|
|
107 |
<?php endif; ?>
|
108 |
<?php if ($this->helper('shipperhq_freight')->isInsideDeliveryEnabled()): ?>
|
109 |
<div class="a-left input-checkbox">
|
|
|
110 |
<input type="checkbox" name="inside_delivery" id="inside_delivery"
|
111 |
value="1" <?php if ($this->helper('shipperhq_freight')->getInsideDelivery()): ?> checked="checked"<?php endif; ?> />
|
112 |
<label for="inside_delivery"><?php echo $this->__('Inside Delivery?') ?></label>
|
113 |
</div>
|
114 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
<?php else: ?>
|
116 |
</ul>
|
117 |
<?php endif; ?>
|
@@ -142,7 +151,7 @@
|
|
142 |
<?php echo $this->escapeHtml($_rate->getErrorMessage()) ?>
|
143 |
<?php else: ?>
|
144 |
<input name="estimate_method" type="radio" value="<?php echo $this->escapeHtml($_rate->getCode()) ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" />
|
145 |
-
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo
|
146 |
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
147 |
-
|
148 |
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
@@ -150,6 +159,11 @@
|
|
150 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
151 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
152 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
153 |
</label>
|
154 |
<?php endif ?>
|
155 |
</li>
|
107 |
<?php endif; ?>
|
108 |
<?php if ($this->helper('shipperhq_freight')->isInsideDeliveryEnabled()): ?>
|
109 |
<div class="a-left input-checkbox">
|
110 |
+
<input type="hidden" name="inside_delivery" value="0">
|
111 |
<input type="checkbox" name="inside_delivery" id="inside_delivery"
|
112 |
value="1" <?php if ($this->helper('shipperhq_freight')->getInsideDelivery()): ?> checked="checked"<?php endif; ?> />
|
113 |
<label for="inside_delivery"><?php echo $this->__('Inside Delivery?') ?></label>
|
114 |
</div>
|
115 |
<?php endif; ?>
|
116 |
+
<?php if ($this->helper('shipperhq_freight')->isLimitedDeliveryEnabled()): ?>
|
117 |
+
<div class="a-left input-checkbox">
|
118 |
+
<input type="hidden" name="limited_delivery" value="0">
|
119 |
+
<input type="checkbox" name="limited_delivery" id="limited_delivery"
|
120 |
+
value="1" <?php if ($this->helper('shipperhq_freight')->getLimitedDelivery()): ?> checked="checked"<?php endif; ?> />
|
121 |
+
<label for="limited_delivery"><?php echo $this->__('Limited Access Delivery?') ?></label>
|
122 |
+
</div>
|
123 |
+
<?php endif; ?>
|
124 |
<?php else: ?>
|
125 |
</ul>
|
126 |
<?php endif; ?>
|
151 |
<?php echo $this->escapeHtml($_rate->getErrorMessage()) ?>
|
152 |
<?php else: ?>
|
153 |
<input name="estimate_method" type="radio" value="<?php echo $this->escapeHtml($_rate->getCode()) ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" />
|
154 |
+
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo Mage::helper('shipperhq_shipper')->getMethodTitle($_rate->getMethodTitle(), $_rate->getMethodDescription(), true) ?>
|
155 |
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
156 |
-
|
157 |
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
159 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
160 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
161 |
<?php endif; ?>
|
162 |
+
<?php if ($_rate->getTooltip()): ?>
|
163 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
164 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
165 |
+
</span>
|
166 |
+
<?php endif; ?>
|
167 |
</label>
|
168 |
<?php endif ?>
|
169 |
</li>
|
app/design/frontend/base/default/template/shipperhq/checkout/cart/shipping.phtml
CHANGED
@@ -103,11 +103,20 @@
|
|
103 |
<?php endif; ?>
|
104 |
<?php if ($this->helper('shipperhq_freight')->isInsideDeliveryEnabled()): ?>
|
105 |
<div class="a-left input-checkbox">
|
|
|
106 |
<input type="checkbox" name="inside_delivery" id="inside_delivery"
|
107 |
value="1" <?php if ($this->helper('shipperhq_freight')->getInsideDelivery()): ?> checked="checked"<?php endif; ?> />
|
108 |
<label for="inside_delivery"><?php echo $this->__('Inside Delivery?') ?></label>
|
109 |
</div>
|
110 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
<?php else: ?>
|
112 |
</ul>
|
113 |
<?php endif; ?>
|
@@ -136,13 +145,18 @@
|
|
136 |
<?php echo $this->escapeHtml($_rate->getErrorMessage()) ?>
|
137 |
<?php else: ?>
|
138 |
<input name="estimate_method" type="radio" value="<?php echo $this->escapeHtml($_rate->getCode()) ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" />
|
139 |
-
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo
|
140 |
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
141 |
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
142 |
<?php echo $_excl; ?>
|
143 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
144 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
145 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
146 |
</label>
|
147 |
<?php endif ?>
|
148 |
</li>
|
@@ -177,7 +191,7 @@
|
|
177 |
$('postcode').addClassName('required-entry');
|
178 |
}
|
179 |
return VarienForm.prototype.submit.bind(coShippingMethodForm)();
|
180 |
-
}
|
181 |
//]]>
|
182 |
</script>
|
183 |
</div>
|
103 |
<?php endif; ?>
|
104 |
<?php if ($this->helper('shipperhq_freight')->isInsideDeliveryEnabled()): ?>
|
105 |
<div class="a-left input-checkbox">
|
106 |
+
<input type="hidden" name="inside_delivery" value="0">
|
107 |
<input type="checkbox" name="inside_delivery" id="inside_delivery"
|
108 |
value="1" <?php if ($this->helper('shipperhq_freight')->getInsideDelivery()): ?> checked="checked"<?php endif; ?> />
|
109 |
<label for="inside_delivery"><?php echo $this->__('Inside Delivery?') ?></label>
|
110 |
</div>
|
111 |
<?php endif; ?>
|
112 |
+
<?php if ($this->helper('shipperhq_freight')->isLimitedDeliveryEnabled()): ?>
|
113 |
+
<div class="a-left input-checkbox">
|
114 |
+
<input type="hidden" name="limited_delivery" value="0">
|
115 |
+
<input type="checkbox" name="limited_delivery" id="limited_delivery"
|
116 |
+
value="1" <?php if ($this->helper('shipperhq_freight')->getLimitedDelivery()): ?> checked="checked"<?php endif; ?> />
|
117 |
+
<label for="limited_delivery"><?php echo $this->__('Limited Access Delivery?') ?></label>
|
118 |
+
</div>
|
119 |
+
<?php endif; ?>
|
120 |
<?php else: ?>
|
121 |
</ul>
|
122 |
<?php endif; ?>
|
145 |
<?php echo $this->escapeHtml($_rate->getErrorMessage()) ?>
|
146 |
<?php else: ?>
|
147 |
<input name="estimate_method" type="radio" value="<?php echo $this->escapeHtml($_rate->getCode()) ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" />
|
148 |
+
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo Mage::helper('shipperhq_shipper')->getMethodTitle($_rate->getMethodTitle(), $_rate->getMethodDescription(), true) ?>
|
149 |
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
150 |
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
151 |
<?php echo $_excl; ?>
|
152 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
153 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
154 |
<?php endif; ?>
|
155 |
+
<?php if ($_rate->getTooltip()): ?>
|
156 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
157 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
158 |
+
</span>
|
159 |
+
<?php endif; ?>
|
160 |
</label>
|
161 |
<?php endif ?>
|
162 |
</li>
|
191 |
$('postcode').addClassName('required-entry');
|
192 |
}
|
193 |
return VarienForm.prototype.submit.bind(coShippingMethodForm)();
|
194 |
+
};
|
195 |
//]]>
|
196 |
</script>
|
197 |
</div>
|
app/design/frontend/base/default/template/shipperhq/checkout/multishipping/shipping.phtml
CHANGED
@@ -73,13 +73,15 @@
|
|
73 |
<?php $isSplit = count($carrierGroupRates) > 1; ?>
|
74 |
<?php $cgCount = 1; ?>
|
75 |
<?php $totalCarrierGroups = count($carrierGroupRates); ?>
|
|
|
|
|
|
|
76 |
<?php foreach($carrierGroupRates as $cgkey => $_ratesAndShipInfo): ?>
|
77 |
<?php $additionalPrefix = 'ma'.$_address->getId(); ?>
|
78 |
<?php $shippingPrefix = $_address->getId(); ?>
|
79 |
-
|
80 |
<?php $additionalPrefix .= 'ZZ' .$cgkey; ?>
|
81 |
<?php $shippingPrefix .= 'ZZ' .$cgkey; ?>
|
82 |
-
<?php endif; ?>
|
83 |
<?php $_shippingRateGroups = $_ratesAndShipInfo['shipping']; ?>
|
84 |
<div class="col2-set">
|
85 |
<h2 class="legend"><?php echo $this->__('Address %s of %s', ($_index+1), $this->getAddressCount()) ; if($isSplit && $_ratesAndShipInfo['carriergroup_text'] != '' ) echo $this->__(' - %s %s of %s ', $_ratesAndShipInfo['carriergroup_text'], $cgCount, $totalCarrierGroups) ?></h2>
|
@@ -122,7 +124,7 @@
|
|
122 |
<?php endif; ?>
|
123 |
<ul>
|
124 |
<?php if($calendarRates || $isPickupCarrier): ?>
|
125 |
-
<div id="ship_options_<?php echo $additionalPrefix ?>_<?php echo $code ?>"
|
126 |
<div id="radio_choices_<?php echo $additionalPrefix ?>_<?php echo $code ?>">
|
127 |
<?php endif ?>
|
128 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
@@ -145,6 +147,11 @@
|
|
145 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
146 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
147 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
148 |
</label>
|
149 |
<?php endif ?>
|
150 |
</li>
|
73 |
<?php $isSplit = count($carrierGroupRates) > 1; ?>
|
74 |
<?php $cgCount = 1; ?>
|
75 |
<?php $totalCarrierGroups = count($carrierGroupRates); ?>
|
76 |
+
<?php if (!($carrierGroupRates) || count($carrierGroupRates) < 1): ?>
|
77 |
+
<p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
|
78 |
+
<?php endif ?>
|
79 |
<?php foreach($carrierGroupRates as $cgkey => $_ratesAndShipInfo): ?>
|
80 |
<?php $additionalPrefix = 'ma'.$_address->getId(); ?>
|
81 |
<?php $shippingPrefix = $_address->getId(); ?>
|
82 |
+
<!-- SHQ16-2023 removed check for ifSplit - always used carrierGroupId -->
|
83 |
<?php $additionalPrefix .= 'ZZ' .$cgkey; ?>
|
84 |
<?php $shippingPrefix .= 'ZZ' .$cgkey; ?>
|
|
|
85 |
<?php $_shippingRateGroups = $_ratesAndShipInfo['shipping']; ?>
|
86 |
<div class="col2-set">
|
87 |
<h2 class="legend"><?php echo $this->__('Address %s of %s', ($_index+1), $this->getAddressCount()) ; if($isSplit && $_ratesAndShipInfo['carriergroup_text'] != '' ) echo $this->__(' - %s %s of %s ', $_ratesAndShipInfo['carriergroup_text'], $cgCount, $totalCarrierGroups) ?></h2>
|
124 |
<?php endif; ?>
|
125 |
<ul>
|
126 |
<?php if($calendarRates || $isPickupCarrier): ?>
|
127 |
+
<div id="ship_options_<?php echo $additionalPrefix ?>_<?php echo $code ?>" class="ship_options">
|
128 |
<div id="radio_choices_<?php echo $additionalPrefix ?>_<?php echo $code ?>">
|
129 |
<?php endif ?>
|
130 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
147 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
148 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
149 |
<?php endif; ?>
|
150 |
+
<?php if ($_rate->getTooltip()): ?>
|
151 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
152 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
153 |
+
</span>
|
154 |
+
<?php endif; ?>
|
155 |
</label>
|
156 |
<?php endif ?>
|
157 |
</li>
|
app/design/frontend/base/default/template/shipperhq/checkout/onepage/shipping_method/available.phtml
CHANGED
@@ -58,8 +58,11 @@
|
|
58 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" name="disclaimer"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
59 |
<?php endif; ?>
|
60 |
<ul>
|
|
|
|
|
|
|
61 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
62 |
-
<div id="ship_options_<?php echo $code ?>"
|
63 |
<div id="radio_choices_<?php echo $code ?>">
|
64 |
<?php endif ?>
|
65 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
@@ -75,16 +78,21 @@
|
|
75 |
<?php else: ?>
|
76 |
<input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> />
|
77 |
<?php endif ?>
|
78 |
-
<label for="s_method_<?php echo $_rate->getCode() ?>"
|
79 |
<strong>
|
80 |
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
81 |
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
82 |
-
|
83 |
<?php echo $_excl; ?>
|
84 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
85 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
86 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
87 |
</strong>
|
|
|
88 |
</label>
|
89 |
<?php endif ?>
|
90 |
</li>
|
@@ -92,7 +100,6 @@
|
|
92 |
<?php if($calendarRates): ?>
|
93 |
</div>
|
94 |
</div>
|
95 |
-
<?php echo $this->getCalendarHtml('', $code, $_sole) ?>
|
96 |
<?php endif ?>
|
97 |
<?php if($isPickupCarrier || $isFreightCarrier): ?>
|
98 |
</div>
|
@@ -111,6 +118,11 @@
|
|
111 |
</dd>
|
112 |
<?php endforeach; ?>
|
113 |
</dl>
|
|
|
|
|
|
|
|
|
|
|
114 |
<?php endif; ?>
|
115 |
<?php else: ?>
|
116 |
<?php if (!($_carrierGroupRates = $this->getCarrierGroupRates())): ?>
|
@@ -155,7 +167,7 @@
|
|
155 |
<?php endif; ?>
|
156 |
<ul>
|
157 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
158 |
-
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>"
|
159 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
160 |
<?php endif ?>
|
161 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
@@ -180,6 +192,11 @@
|
|
180 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
181 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
182 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
183 |
</strong>
|
184 |
</label>
|
185 |
|
@@ -209,9 +226,12 @@
|
|
209 |
<?php endforeach; ?>
|
210 |
</dl>
|
211 |
<?php endforeach; ?>
|
212 |
-
<!-- <div class="dropship-text">
|
213 |
<?php echo $this->getExplanationText(); ?>
|
214 |
-
|
|
|
|
|
|
|
|
|
215 |
<?php endif; ?>
|
216 |
<?php endif; ?>
|
217 |
|
58 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" name="disclaimer"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
59 |
<?php endif; ?>
|
60 |
<ul>
|
61 |
+
<?php if($calendarRates): ?>
|
62 |
+
<?php echo $this->getCalendarHtml('', $code, $_sole) ?>
|
63 |
+
<?php endif ?>
|
64 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
65 |
+
<div id="ship_options_<?php echo $code ?>" name="ship_options">
|
66 |
<div id="radio_choices_<?php echo $code ?>">
|
67 |
<?php endif ?>
|
68 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
78 |
<?php else: ?>
|
79 |
<input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> />
|
80 |
<?php endif ?>
|
81 |
+
<label for="s_method_<?php echo $_rate->getCode() ?>">
|
82 |
<strong>
|
83 |
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
84 |
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
|
|
85 |
<?php echo $_excl; ?>
|
86 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
87 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
88 |
<?php endif; ?>
|
89 |
+
<?php if ($_rate->getTooltip()): ?>
|
90 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
91 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
92 |
+
</span>
|
93 |
+
<?php endif; ?>
|
94 |
</strong>
|
95 |
+
<?php echo $this->getMethodTitle($_rate->getMethodTitle(), $_rate->getMethodDescription(), true) ?>
|
96 |
</label>
|
97 |
<?php endif ?>
|
98 |
</li>
|
100 |
<?php if($calendarRates): ?>
|
101 |
</div>
|
102 |
</div>
|
|
|
103 |
<?php endif ?>
|
104 |
<?php if($isPickupCarrier || $isFreightCarrier): ?>
|
105 |
</div>
|
118 |
</dd>
|
119 |
<?php endforeach; ?>
|
120 |
</dl>
|
121 |
+
<?php if ($this->showDeliveryComments()): ?>
|
122 |
+
<dd>
|
123 |
+
<?php echo $this->getDeliveryCommentsHtml() ?>
|
124 |
+
</dd>
|
125 |
+
<?php endif ?>
|
126 |
<?php endif; ?>
|
127 |
<?php else: ?>
|
128 |
<?php if (!($_carrierGroupRates = $this->getCarrierGroupRates())): ?>
|
167 |
<?php endif; ?>
|
168 |
<ul>
|
169 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
170 |
+
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>" name="ship_options">
|
171 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
172 |
<?php endif ?>
|
173 |
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
192 |
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
193 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
194 |
<?php endif; ?>
|
195 |
+
<?php if ($_rate->getTooltip()): ?>
|
196 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
197 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
198 |
+
</span>
|
199 |
+
<?php endif; ?>
|
200 |
</strong>
|
201 |
</label>
|
202 |
|
226 |
<?php endforeach; ?>
|
227 |
</dl>
|
228 |
<?php endforeach; ?>
|
|
|
229 |
<?php echo $this->getExplanationText(); ?>
|
230 |
+
<?php if ($this->showDeliveryComments()): ?>
|
231 |
+
<dd>
|
232 |
+
<?php echo $this->getDeliveryCommentsHtml() ?>
|
233 |
+
</dd>
|
234 |
+
<?php endif ?>
|
235 |
<?php endif; ?>
|
236 |
<?php endif; ?>
|
237 |
|
app/design/frontend/base/default/template/shipperhq/checkout/onepage/shipping_method/comments.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="input-box">
|
2 |
+
<label for="delivery_comments"
|
3 |
+
id="delivery_comments_label"><?php echo $this->__('Delivery Comments') ?></label>
|
4 |
+
<div class="input-box">
|
5 |
+
<input type="text" class="input-text validation-passed"
|
6 |
+
value="<?php echo $this->getDeliveryCommentsInitialText() ?>" id="delivery_comments"
|
7 |
+
name="delivery_comments" />
|
8 |
+
</div>
|
9 |
+
</div>
|
10 |
+
|
11 |
+
|
12 |
+
<script type="text/javascript">
|
13 |
+
|
14 |
+
var deliveryComments = $j("#delivery_comments");
|
15 |
+
|
16 |
+
deliveryComments.on('focus', function() {
|
17 |
+
if(this.value==this.defaultValue){
|
18 |
+
this.value = '';
|
19 |
+
}
|
20 |
+
}
|
21 |
+
);
|
22 |
+
|
23 |
+
deliveryComments.on('blur', function() {
|
24 |
+
if(this.value=='') {
|
25 |
+
this.value=this.defaultValue;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
);
|
29 |
+
|
30 |
+
</script>
|
app/design/frontend/base/default/template/shipperhq/checkout/onestepcheckout/pickup_review.phtml
CHANGED
@@ -56,7 +56,6 @@ if(!empty($checkoutHelper->settings['addressreview']['enable_addressreview'])):?
|
|
56 |
</div>
|
57 |
<script type="text/javascript">
|
58 |
//<![CDATA[
|
59 |
-
|
60 |
<?php
|
61 |
if(Mage::getSingleton('customer/session')->isLoggedIn()){
|
62 |
$blacklist = array('entity_id','entity_type_id','attribute_set_id','increment_id','parent_id','created_at','updated_at','is_active','customer_id');
|
56 |
</div>
|
57 |
<script type="text/javascript">
|
58 |
//<![CDATA[
|
|
|
59 |
<?php
|
60 |
if(Mage::getSingleton('customer/session')->isLoggedIn()){
|
61 |
$blacklist = array('entity_id','entity_type_id','attribute_set_id','increment_id','parent_id','created_at','updated_at','is_active','customer_id');
|
app/design/frontend/base/default/template/shipperhq/checkout/onestepcheckout/shipping_method_osc_shq.phtml
CHANGED
@@ -62,7 +62,13 @@
|
|
62 |
<?php if($_rates[0]->getCarrierNotice() && !$showCarrierNotice): ?>
|
63 |
<?php $showCarrierNotice = $_rates[0]->getCarrierNotice(); ?>
|
64 |
<?php endif ?>
|
65 |
-
<label for="s_method<?php echo $carriergroupInsert ?>_<?php echo $code ?>"><?php echo $this->getCarrierName($code)
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
<?php echo $this->getShippingMethodsSelect("shipping_method_dropdown".$carriergroupInsert, "s_method_dropdown".$carriergroupInsert."_".$code, $this->getAddressShippingMethod(), $_rates, $_sole) ?>
|
67 |
<?php if($_rates[0]->getCustomDescription()): ?>
|
68 |
<p class="disclaimer" id="disclaimer_<?php echo $_carriergroupId ?>_<?php echo $code ?>" hidden="" name="disclaimer_<?php echo $_carriergroupId ?>"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
@@ -78,14 +84,14 @@
|
|
78 |
<?php endif ?>
|
79 |
<?php endif ?>
|
80 |
<?php if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Calendar') && Mage::helper('shipperhq_calendar')->hasCalendarDetails($_carriergroupId, $code, $_rates[0]->getCarrierType())) :?>
|
81 |
-
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>"
|
82 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
83 |
</div>
|
84 |
</div>
|
85 |
<?php echo $this->getCalendarHtml($_carriergroupId, $code) ?>
|
86 |
<?php endif ?>
|
87 |
<?php if ($this->isFreightCarrier($_rates[0])): ?>
|
88 |
-
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>"
|
89 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
90 |
</div>
|
91 |
</div>
|
@@ -123,6 +129,11 @@
|
|
123 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
124 |
<?php endif; ?>
|
125 |
</strong>
|
|
|
|
|
|
|
|
|
|
|
126 |
</label>
|
127 |
<?php endif ?>
|
128 |
</dt>
|
@@ -143,7 +154,13 @@
|
|
143 |
<?php if($_rates[0]->getCarrierNotice() && !$showCarrierNotice): ?>
|
144 |
<?php $showCarrierNotice = $_rates[0]->getCarrierNotice(); ?>
|
145 |
<?php endif ?>
|
146 |
-
<label for="s_method_<?php echo $code ?>"><?php echo $this->getCarrierName($code)
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
<?php echo $this->getShippingMethodsSelect("shipping_method_dropdown", "s_method_dropdown_".$code, $this->getAddressShippingMethod(), $_rates, $_sole) ?>
|
148 |
<?php if($_rates[0]->getCustomDescription()): ?>
|
149 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" hidden="" name="disclaimer"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
@@ -153,7 +170,7 @@
|
|
153 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" name="disclaimer" hidden=""><?php echo $showCarrierNotice; ?></p>
|
154 |
<?php endif ?>
|
155 |
<?php if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Calendar') && Mage::helper('shipperhq_calendar')->hasCalendarDetails('', $code, $_rates[0]->getCarrierType())) :?>
|
156 |
-
<div id="ship_options_<?php echo $code ?>"
|
157 |
<div id="radio_choices_<?php echo $code ?>">
|
158 |
</div>
|
159 |
</div>
|
@@ -166,7 +183,7 @@
|
|
166 |
<?php endif ?>
|
167 |
<?php endif ?>
|
168 |
<?php if ($this->isFreightCarrier($_rates[0])): ?>
|
169 |
-
<div id="ship_options_<?php echo $code ?>"
|
170 |
<div id="radio_choices_<?php echo $code ?>">
|
171 |
</div>
|
172 |
</div>
|
@@ -180,7 +197,6 @@
|
|
180 |
|
181 |
<script type="text/javascript">
|
182 |
//<![CDATA[
|
183 |
-
|
184 |
document.observe('dom:loaded', pageInit);
|
185 |
function pageInit()
|
186 |
{
|
@@ -234,7 +250,8 @@
|
|
234 |
var lastPartMethodName = methodName.substr(9);
|
235 |
var indexOfCarriergroupIdEnd = lastPartMethodName.indexOf('_');
|
236 |
var methodCarriergroupId = lastPartMethodName.substr(0, indexOfCarriergroupIdEnd);
|
237 |
-
|
|
|
238 |
var carriergroupInsert = '';
|
239 |
var methodCarriergroupId = '';
|
240 |
} else {
|
62 |
<?php if($_rates[0]->getCarrierNotice() && !$showCarrierNotice): ?>
|
63 |
<?php $showCarrierNotice = $_rates[0]->getCarrierNotice(); ?>
|
64 |
<?php endif ?>
|
65 |
+
<label for="s_method<?php echo $carriergroupInsert ?>_<?php echo $code ?>"><?php echo $this->getCarrierName($code) ?>
|
66 |
+
<?php if ($_rates[0]->getTooltip()): ?>
|
67 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rates[0]->getTooltip() ?>">
|
68 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
69 |
+
</span>
|
70 |
+
<?php endif; ?>
|
71 |
+
</label>
|
72 |
<?php echo $this->getShippingMethodsSelect("shipping_method_dropdown".$carriergroupInsert, "s_method_dropdown".$carriergroupInsert."_".$code, $this->getAddressShippingMethod(), $_rates, $_sole) ?>
|
73 |
<?php if($_rates[0]->getCustomDescription()): ?>
|
74 |
<p class="disclaimer" id="disclaimer_<?php echo $_carriergroupId ?>_<?php echo $code ?>" hidden="" name="disclaimer_<?php echo $_carriergroupId ?>"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
84 |
<?php endif ?>
|
85 |
<?php endif ?>
|
86 |
<?php if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Calendar') && Mage::helper('shipperhq_calendar')->hasCalendarDetails($_carriergroupId, $code, $_rates[0]->getCarrierType())) :?>
|
87 |
+
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>" class="ship_options">
|
88 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
89 |
</div>
|
90 |
</div>
|
91 |
<?php echo $this->getCalendarHtml($_carriergroupId, $code) ?>
|
92 |
<?php endif ?>
|
93 |
<?php if ($this->isFreightCarrier($_rates[0])): ?>
|
94 |
+
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>" class="ship_options">
|
95 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
96 |
</div>
|
97 |
</div>
|
129 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
130 |
<?php endif; ?>
|
131 |
</strong>
|
132 |
+
<?php if ($_rate->getTooltip()): ?>
|
133 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
134 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
135 |
+
</span>
|
136 |
+
<?php endif; ?>
|
137 |
</label>
|
138 |
<?php endif ?>
|
139 |
</dt>
|
154 |
<?php if($_rates[0]->getCarrierNotice() && !$showCarrierNotice): ?>
|
155 |
<?php $showCarrierNotice = $_rates[0]->getCarrierNotice(); ?>
|
156 |
<?php endif ?>
|
157 |
+
<label for="s_method_<?php echo $code ?>"><?php echo $this->getCarrierName($code) ?>
|
158 |
+
<?php if ($_rates[0]->getTooltip()): ?>
|
159 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rates[0]->getTooltip() ?>">
|
160 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
161 |
+
</span>
|
162 |
+
<?php endif; ?>
|
163 |
+
</label>
|
164 |
<?php echo $this->getShippingMethodsSelect("shipping_method_dropdown", "s_method_dropdown_".$code, $this->getAddressShippingMethod(), $_rates, $_sole) ?>
|
165 |
<?php if($_rates[0]->getCustomDescription()): ?>
|
166 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" hidden="" name="disclaimer"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
170 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" name="disclaimer" hidden=""><?php echo $showCarrierNotice; ?></p>
|
171 |
<?php endif ?>
|
172 |
<?php if(Mage::helper('shipperhq_shipper')->isModuleEnabled('Shipperhq_Calendar') && Mage::helper('shipperhq_calendar')->hasCalendarDetails('', $code, $_rates[0]->getCarrierType())) :?>
|
173 |
+
<div id="ship_options_<?php echo $code ?>" class="ship_options">
|
174 |
<div id="radio_choices_<?php echo $code ?>">
|
175 |
</div>
|
176 |
</div>
|
183 |
<?php endif ?>
|
184 |
<?php endif ?>
|
185 |
<?php if ($this->isFreightCarrier($_rates[0])): ?>
|
186 |
+
<div id="ship_options_<?php echo $code ?>" class="ship_options">
|
187 |
<div id="radio_choices_<?php echo $code ?>">
|
188 |
</div>
|
189 |
</div>
|
197 |
|
198 |
<script type="text/javascript">
|
199 |
//<![CDATA[
|
|
|
200 |
document.observe('dom:loaded', pageInit);
|
201 |
function pageInit()
|
202 |
{
|
250 |
var lastPartMethodName = methodName.substr(9);
|
251 |
var indexOfCarriergroupIdEnd = lastPartMethodName.indexOf('_');
|
252 |
var methodCarriergroupId = lastPartMethodName.substr(0, indexOfCarriergroupIdEnd);
|
253 |
+
var splitSGroup = methodCarriergroupId.indexOf('XXXX');
|
254 |
+
if (splitSGroup < 1 && (isNaN(methodCarriergroupId) || isNaN(parseInt(methodCarriergroupId)))) {
|
255 |
var carriergroupInsert = '';
|
256 |
var methodCarriergroupId = '';
|
257 |
} else {
|
app/design/frontend/base/default/template/shipperhq/checkout/onestepcheckout/shipping_method_osc_shq_radio.phtml
CHANGED
@@ -69,7 +69,7 @@
|
|
69 |
<p class="disclaimer" id="disclaimer_<?php echo $_carriergroupId ?>_<?php echo $code ?>" name="disclaimer_<?php echo $_carriergroupId ?>"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
70 |
<?php endif; ?>
|
71 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
72 |
-
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>"
|
73 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
74 |
<?php endif ?>
|
75 |
<?php foreach ($_rates as $_rate): ?>
|
@@ -88,6 +88,11 @@
|
|
88 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
89 |
<?php endif; ?>
|
90 |
</strong>
|
|
|
|
|
|
|
|
|
|
|
91 |
</label>
|
92 |
<?php endif ?>
|
93 |
</dt>
|
@@ -142,6 +147,11 @@
|
|
142 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
143 |
<?php endif; ?>
|
144 |
</strong>
|
|
|
|
|
|
|
|
|
|
|
145 |
</label>
|
146 |
<?php endif ?>
|
147 |
</dt>
|
@@ -165,7 +175,7 @@
|
|
165 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" name="disclaimer"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
166 |
<?php endif; ?>
|
167 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
168 |
-
<div id="ship_options_<?php echo $code ?>"
|
169 |
<div id="radio_choices_<?php echo $code ?>">
|
170 |
<?php endif ?>
|
171 |
<?php foreach ($_rates as $_rate): ?>
|
@@ -184,6 +194,11 @@
|
|
184 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
185 |
<?php endif; ?>
|
186 |
</strong>
|
|
|
|
|
|
|
|
|
|
|
187 |
</label>
|
188 |
<?php endif ?>
|
189 |
</dt>
|
@@ -215,7 +230,6 @@
|
|
215 |
|
216 |
<script type="text/javascript">
|
217 |
//<![CDATA[
|
218 |
-
|
219 |
document.observe('dom:loaded', pageInit);
|
220 |
function pageInit()
|
221 |
{
|
@@ -280,7 +294,8 @@ function setSelected(el)
|
|
280 |
var lastPartMethodName = methodName.substr(9);
|
281 |
var indexOfCarriergroupIdEnd = lastPartMethodName.indexOf('_');
|
282 |
var methodCarriergroupId = lastPartMethodName.substr(0, indexOfCarriergroupIdEnd);
|
283 |
-
|
|
|
284 |
var carriergroupInsert = '';
|
285 |
var methodCarriergroupId = '';
|
286 |
} else {
|
69 |
<p class="disclaimer" id="disclaimer_<?php echo $_carriergroupId ?>_<?php echo $code ?>" name="disclaimer_<?php echo $_carriergroupId ?>"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
70 |
<?php endif; ?>
|
71 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
72 |
+
<div id="ship_options_<?php echo $_carriergroupId ?>_<?php echo $code ?>" class="ship_options">
|
73 |
<div id="radio_choices_<?php echo $_carriergroupId ?>_<?php echo $code ?>">
|
74 |
<?php endif ?>
|
75 |
<?php foreach ($_rates as $_rate): ?>
|
88 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
89 |
<?php endif; ?>
|
90 |
</strong>
|
91 |
+
<?php if ($_rate->getTooltip()): ?>
|
92 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
93 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
94 |
+
</span>
|
95 |
+
<?php endif; ?>
|
96 |
</label>
|
97 |
<?php endif ?>
|
98 |
</dt>
|
147 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
148 |
<?php endif; ?>
|
149 |
</strong>
|
150 |
+
<?php if ($_rate->getTooltip()): ?>
|
151 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
152 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
153 |
+
</span>
|
154 |
+
<?php endif; ?>
|
155 |
</label>
|
156 |
<?php endif ?>
|
157 |
</dt>
|
175 |
<p class="disclaimer" id="disclaimer_<?php echo $code ?>" name="disclaimer"><?php echo $_rates[0]->getCustomDescription(); ?></p>
|
176 |
<?php endif; ?>
|
177 |
<?php if($calendarRates || $isPickupCarrier || $isFreightCarrier): ?>
|
178 |
+
<div id="ship_options_<?php echo $code ?>" class="ship_options">
|
179 |
<div id="radio_choices_<?php echo $code ?>">
|
180 |
<?php endif ?>
|
181 |
<?php foreach ($_rates as $_rate): ?>
|
194 |
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
195 |
<?php endif; ?>
|
196 |
</strong>
|
197 |
+
<?php if ($_rate->getTooltip()): ?>
|
198 |
+
<span style="float:right;" class="helpcursor" title="<?php echo $_rate->getTooltip() ?>">
|
199 |
+
<img src="<?php echo $this->getSkinUrl('images/shipperhq/tooltip.jpg') ?>">
|
200 |
+
</span>
|
201 |
+
<?php endif; ?>
|
202 |
</label>
|
203 |
<?php endif ?>
|
204 |
</dt>
|
230 |
|
231 |
<script type="text/javascript">
|
232 |
//<![CDATA[
|
|
|
233 |
document.observe('dom:loaded', pageInit);
|
234 |
function pageInit()
|
235 |
{
|
294 |
var lastPartMethodName = methodName.substr(9);
|
295 |
var indexOfCarriergroupIdEnd = lastPartMethodName.indexOf('_');
|
296 |
var methodCarriergroupId = lastPartMethodName.substr(0, indexOfCarriergroupIdEnd);
|
297 |
+
var splitSGroup = methodCarriergroupId.indexOf('XXXX');
|
298 |
+
if (splitSGroup < 1 && (isNaN(methodCarriergroupId) || isNaN(parseInt(methodCarriergroupId)))) {
|
299 |
var carriergroupInsert = '';
|
300 |
var methodCarriergroupId = '';
|
301 |
} else {
|
app/etc/modules/Shipperhq_Paypalexpress.xml
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Shipperhq_Paypalexpress>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>community</codePool>
|
7 |
-
<depends>
|
8 |
-
<Mage_Paypal />
|
9 |
-
</depends>
|
10 |
-
</Shipperhq_Paypalexpress>
|
11 |
-
</modules>
|
12 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Shipperhq_Pbint.xml
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Shipperhq_Pbint>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>community</codePool>
|
7 |
-
<depends>
|
8 |
-
</depends>
|
9 |
-
</Shipperhq_Pbint>
|
10 |
-
</modules>
|
11 |
-
</config>
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/locale/en_US/template/email/sales/shipperhq_pitney_shipment_new.html
DELETED
@@ -1,100 +0,0 @@
|
|
1 |
-
<!--@subject {{var store.getFrontendName()}}: Shipment # {{var shipment.increment_id}} for Order # {{var order.increment_id}} @-->
|
2 |
-
<!--@vars
|
3 |
-
{"store url=\"\"":"Store Url",
|
4 |
-
"var logo_url":"Email Logo Image Url",
|
5 |
-
"var logo_alt":"Email Logo Image Alt",
|
6 |
-
"htmlescape var=$order.getCustomerName()":"Customer Name",
|
7 |
-
"var store.getFrontendName()":"Store Name",
|
8 |
-
"store url=\"customer/account/\"":"Customer Account Url",
|
9 |
-
"var shipment.increment_id":"Shipment Id",
|
10 |
-
"var order.increment_id":"Order Id",
|
11 |
-
"var order.billing_address.format('html')":"Billing Address",
|
12 |
-
"var payment_html":"Payment Details",
|
13 |
-
"var order.shipping_address.format('html')":"Shipping Address",
|
14 |
-
"var order.shipping_description":"Shipping Description",
|
15 |
-
"layout handle=\"sales_email_order_shipment_items\" shipment=$shipment order=$order":"Shipment Items Grid",
|
16 |
-
"block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order":"Shipment Track Details",
|
17 |
-
"var comment":"Shipment Comment"}
|
18 |
-
@-->
|
19 |
-
<!--@styles
|
20 |
-
@-->
|
21 |
-
|
22 |
-
{{template config_path="design/email/header"}}
|
23 |
-
{{inlinecss file="email-inline.css"}}
|
24 |
-
|
25 |
-
<table cellpadding="0" cellspacing="0" border="0">
|
26 |
-
<tr>
|
27 |
-
<td>
|
28 |
-
<table cellpadding="0" cellspacing="0" border="0">
|
29 |
-
<tr>
|
30 |
-
<td class="email-heading">
|
31 |
-
<h1>Thank you for your order from {{var store.getFrontendName()}}.</h1>
|
32 |
-
<p>You can check the status of your order by <a href="{{store url="customer/account/"}}"">logging into your account</a>.</p>
|
33 |
-
</td>
|
34 |
-
<td class="store-info">
|
35 |
-
<h4>Order Questions?</h4>
|
36 |
-
<p>
|
37 |
-
{{depend store_phone}}
|
38 |
-
<b>Call Us:</b>
|
39 |
-
<a href="tel:{{var phone}}">{{var store_phone}}</a><br>
|
40 |
-
{{/depend}}
|
41 |
-
{{depend store_hours}}
|
42 |
-
<span class="no-link">{{var store_hours}}</span><br>
|
43 |
-
{{/depend}}
|
44 |
-
{{depend store_email}}
|
45 |
-
<b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
|
46 |
-
{{/depend}}
|
47 |
-
</p>
|
48 |
-
</td>
|
49 |
-
</tr>
|
50 |
-
</table>
|
51 |
-
</td>
|
52 |
-
</tr>
|
53 |
-
<tr>
|
54 |
-
<td class="order-details">
|
55 |
-
<h3>Your Shipment <span class="no-link">#{{var shipment.increment_id}}</span></h3>
|
56 |
-
<p>Your Order #{{var order.increment_id}} has been shipped from local warehouse to international shipment hub from where it will be shipped to your country.</p>
|
57 |
-
</td>
|
58 |
-
</tr>
|
59 |
-
<tr class="order-information">
|
60 |
-
<td>
|
61 |
-
{{if comment}}
|
62 |
-
<table cellspacing="0" cellpadding="0" class="message-container">
|
63 |
-
<tr>
|
64 |
-
<td>{{var comment}}</td>
|
65 |
-
</tr>
|
66 |
-
</table>
|
67 |
-
{{/if}}
|
68 |
-
{{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}}
|
69 |
-
<table cellpadding="0" cellspacing="0" border="0">
|
70 |
-
<tr>
|
71 |
-
<td class="address-details">
|
72 |
-
<h6>Bill to:</h6>
|
73 |
-
<p><span class="no-link">{{var order.billing_address.format('html')}}</span></p>
|
74 |
-
</td>
|
75 |
-
{{depend order.getIsNotVirtual()}}
|
76 |
-
<td class="address-details">
|
77 |
-
<h6>Ship to:</h6>
|
78 |
-
<p><span class="no-link">{{var order.shipping_address.format('html')}}</span></p>
|
79 |
-
</td>
|
80 |
-
{{/depend}}
|
81 |
-
</tr>
|
82 |
-
<tr>
|
83 |
-
{{depend order.getIsNotVirtual()}}
|
84 |
-
<td class="method-info">
|
85 |
-
<h6>Shipping method:</h6>
|
86 |
-
<p>{{var order.shipping_description}}</p>
|
87 |
-
</td>
|
88 |
-
{{/depend}}
|
89 |
-
<td class="method-info">
|
90 |
-
<h6>Payment method:</h6>
|
91 |
-
{{var payment_html}}
|
92 |
-
</td>
|
93 |
-
</tr>
|
94 |
-
</table>
|
95 |
-
{{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}
|
96 |
-
</td>
|
97 |
-
</tr>
|
98 |
-
</table>
|
99 |
-
|
100 |
-
{{template config_path="design/email/footer"}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/shipperhq/jquery-loader.js
CHANGED
@@ -4,7 +4,7 @@ if (!window.ShipperHQ) {
|
|
4 |
|
5 |
/**
|
6 |
* Init data for loading jQuery
|
7 |
-
*
|
8 |
* @param versionRequires
|
9 |
* @param urlPlaceholders
|
10 |
* @constructor
|
@@ -37,7 +37,7 @@ ShipperHQ.JQueryLoader.prototype.loadJquery = function () {
|
|
37 |
|
38 |
/**
|
39 |
* Requires script tag with jquery
|
40 |
-
*
|
41 |
*/
|
42 |
ShipperHQ.JQueryLoader.prototype.requireJquery = function () {
|
43 |
var realVersion = this.versionMap['jquery']['default'];
|
@@ -56,11 +56,11 @@ ShipperHQ.JQueryLoader.prototype.requireUi = function () {
|
|
56 |
if (this.jquery) {
|
57 |
version = this.jquery().jquery.split('.').slice(0, 2).join('.');
|
58 |
}
|
59 |
-
|
60 |
if (!this.versionMap['ui'][version]) {
|
61 |
version = 'default';
|
62 |
}
|
63 |
-
|
64 |
var realVersion = this.versionMap['ui'][version];
|
65 |
var scriptUrl = this.urlPlaceholders['ui'].replace('{version}', realVersion);
|
66 |
var styleUrl = this.urlPlaceholders['ui-style'].replace('{version}', realVersion);
|
@@ -73,12 +73,12 @@ ShipperHQ.JQueryLoader.prototype.requireUi = function () {
|
|
73 |
|
74 |
ShipperHQ.JQueryLoader.prototype.requireJavaScript = function (url, callback, styleUrl) {
|
75 |
var script = document.createElement("script");
|
76 |
-
script.type
|
77 |
var loadScope = this;
|
78 |
|
79 |
if (script.readyState){ //IE
|
80 |
script.onreadystatechange = function() {
|
81 |
-
var state = script.readyState
|
82 |
if (state == "loaded" ||
|
83 |
state == "complete"){
|
84 |
script.onreadystatechange = null;
|
@@ -91,7 +91,8 @@ ShipperHQ.JQueryLoader.prototype.requireJavaScript = function (url, callback, st
|
|
91 |
};
|
92 |
}
|
93 |
|
94 |
-
script.src
|
|
|
95 |
this.addHeadElement(script);
|
96 |
};
|
97 |
|
@@ -139,7 +140,7 @@ ShipperHQ.JQueryLoader.instance = function () {
|
|
139 |
if (!this.__instance) {
|
140 |
return false;
|
141 |
}
|
142 |
-
|
143 |
return this.__instance;
|
144 |
};
|
145 |
|
4 |
|
5 |
/**
|
6 |
* Init data for loading jQuery
|
7 |
+
*
|
8 |
* @param versionRequires
|
9 |
* @param urlPlaceholders
|
10 |
* @constructor
|
37 |
|
38 |
/**
|
39 |
* Requires script tag with jquery
|
40 |
+
*
|
41 |
*/
|
42 |
ShipperHQ.JQueryLoader.prototype.requireJquery = function () {
|
43 |
var realVersion = this.versionMap['jquery']['default'];
|
56 |
if (this.jquery) {
|
57 |
version = this.jquery().jquery.split('.').slice(0, 2).join('.');
|
58 |
}
|
59 |
+
|
60 |
if (!this.versionMap['ui'][version]) {
|
61 |
version = 'default';
|
62 |
}
|
63 |
+
|
64 |
var realVersion = this.versionMap['ui'][version];
|
65 |
var scriptUrl = this.urlPlaceholders['ui'].replace('{version}', realVersion);
|
66 |
var styleUrl = this.urlPlaceholders['ui-style'].replace('{version}', realVersion);
|
73 |
|
74 |
ShipperHQ.JQueryLoader.prototype.requireJavaScript = function (url, callback, styleUrl) {
|
75 |
var script = document.createElement("script");
|
76 |
+
script.setAttribute('type', "text/javascript");
|
77 |
var loadScope = this;
|
78 |
|
79 |
if (script.readyState){ //IE
|
80 |
script.onreadystatechange = function() {
|
81 |
+
var state = script.readyState;
|
82 |
if (state == "loaded" ||
|
83 |
state == "complete"){
|
84 |
script.onreadystatechange = null;
|
91 |
};
|
92 |
}
|
93 |
|
94 |
+
script.setAttribute('src', url);
|
95 |
+
//script.src = url;
|
96 |
this.addHeadElement(script);
|
97 |
};
|
98 |
|
140 |
if (!this.__instance) {
|
141 |
return false;
|
142 |
}
|
143 |
+
|
144 |
return this.__instance;
|
145 |
};
|
146 |
|
lib/ShipperHQ/Checkout/Cart.php
CHANGED
@@ -36,9 +36,6 @@ namespace ShipperHQ\Checkout;
|
|
36 |
*/
|
37 |
class Cart {
|
38 |
|
39 |
-
public $weight;
|
40 |
-
public $price;
|
41 |
-
public $qty;
|
42 |
public $declaredValue;
|
43 |
public $freeShipping;
|
44 |
public $items;
|
@@ -57,9 +54,6 @@ class Cart {
|
|
57 |
$this->declaredValue = $declaredValue;
|
58 |
$this->freeShipping = $freeShipping;
|
59 |
$this->items = $items;
|
60 |
-
$this->price = $price;
|
61 |
-
$this->qty = $qty;
|
62 |
-
$this->weight = $weight;
|
63 |
}
|
64 |
|
65 |
/**
|
@@ -110,51 +104,4 @@ class Cart {
|
|
110 |
return $this->items;
|
111 |
}
|
112 |
|
113 |
-
/**
|
114 |
-
* @param float $price
|
115 |
-
*/
|
116 |
-
public function setPrice(\float $price)
|
117 |
-
{
|
118 |
-
$this->price = $price;
|
119 |
-
}
|
120 |
-
|
121 |
-
/**
|
122 |
-
* @return float
|
123 |
-
*/
|
124 |
-
public function getPrice()
|
125 |
-
{
|
126 |
-
return $this->price;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* @param int $qty
|
131 |
-
*/
|
132 |
-
public function setQty(\integer $qty)
|
133 |
-
{
|
134 |
-
$this->qty = $qty;
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
* @return int
|
139 |
-
*/
|
140 |
-
public function getQty()
|
141 |
-
{
|
142 |
-
return $this->qty;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* @param float $weight
|
147 |
-
*/
|
148 |
-
public function setWeight(\float $weight)
|
149 |
-
{
|
150 |
-
$this->weight = $weight;
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @return float
|
155 |
-
*/
|
156 |
-
public function getWeight()
|
157 |
-
{
|
158 |
-
return $this->weight;
|
159 |
-
}
|
160 |
}
|
36 |
*/
|
37 |
class Cart {
|
38 |
|
|
|
|
|
|
|
39 |
public $declaredValue;
|
40 |
public $freeShipping;
|
41 |
public $items;
|
54 |
$this->declaredValue = $declaredValue;
|
55 |
$this->freeShipping = $freeShipping;
|
56 |
$this->items = $items;
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
/**
|
104 |
return $this->items;
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
lib/ShipperHQ/Checkout/Item.php
CHANGED
@@ -63,7 +63,6 @@ class Item
|
|
63 |
public $freeShipping;
|
64 |
// public $freeMethodWeight;
|
65 |
public $additionalAttributes;
|
66 |
-
public $legacyAttributes;
|
67 |
public $items;
|
68 |
public $type;
|
69 |
public $fixedPrice;
|
@@ -98,7 +97,6 @@ class Item
|
|
98 |
* @param float $taxPercentage
|
99 |
* @param string $type
|
100 |
* @param array $attributes
|
101 |
-
* @param array $legacyAttributes
|
102 |
* @param array $additionalAttributes
|
103 |
*/
|
104 |
function __construct($items = array(), $qty = 0, $weight = 0.0, $rowTotal = 0,
|
@@ -110,7 +108,7 @@ class Item
|
|
110 |
$name = "", $packageCurrency = "",$baseCurrency = "",
|
111 |
$storeBaseCurrency = "", $storeCurrentCurrency = "", $storePrice = 0.0, $taxInclBasePrice = 0.0,
|
112 |
$taxInclStorePrice = 0.0, $taxPercentage = 0.0, $type = "",
|
113 |
-
$attributes = array(), $
|
114 |
{
|
115 |
$this->additionalAttributes = $additionalAttributes;
|
116 |
$this->attributes = $attributes;
|
@@ -128,7 +126,6 @@ class Item
|
|
128 |
$this->freeShipping = $freeShipping;
|
129 |
$this->id = $id;
|
130 |
$this->items = $items;
|
131 |
-
$this->legacyAttributes = $legacyAttributes;
|
132 |
$this->name = $name;
|
133 |
$this->packageCurrency = $packageCurrency;
|
134 |
$this->qty = $qty;
|
@@ -399,22 +396,6 @@ class Item
|
|
399 |
return $this->items;
|
400 |
}
|
401 |
|
402 |
-
/**
|
403 |
-
* @param array $legacyAttributes
|
404 |
-
*/
|
405 |
-
public function setLegacyAttributes($legacyAttributes)
|
406 |
-
{
|
407 |
-
$this->legacyAttributes = $legacyAttributes;
|
408 |
-
}
|
409 |
-
|
410 |
-
/**
|
411 |
-
* @return array
|
412 |
-
*/
|
413 |
-
public function getLegacyAttributes()
|
414 |
-
{
|
415 |
-
return $this->legacyAttributes;
|
416 |
-
}
|
417 |
-
|
418 |
/**
|
419 |
* @param mixed $name
|
420 |
*/
|
63 |
public $freeShipping;
|
64 |
// public $freeMethodWeight;
|
65 |
public $additionalAttributes;
|
|
|
66 |
public $items;
|
67 |
public $type;
|
68 |
public $fixedPrice;
|
97 |
* @param float $taxPercentage
|
98 |
* @param string $type
|
99 |
* @param array $attributes
|
|
|
100 |
* @param array $additionalAttributes
|
101 |
*/
|
102 |
function __construct($items = array(), $qty = 0, $weight = 0.0, $rowTotal = 0,
|
108 |
$name = "", $packageCurrency = "",$baseCurrency = "",
|
109 |
$storeBaseCurrency = "", $storeCurrentCurrency = "", $storePrice = 0.0, $taxInclBasePrice = 0.0,
|
110 |
$taxInclStorePrice = 0.0, $taxPercentage = 0.0, $type = "",
|
111 |
+
$attributes = array(), $additionalAttributes = array())
|
112 |
{
|
113 |
$this->additionalAttributes = $additionalAttributes;
|
114 |
$this->attributes = $attributes;
|
126 |
$this->freeShipping = $freeShipping;
|
127 |
$this->id = $id;
|
128 |
$this->items = $items;
|
|
|
129 |
$this->name = $name;
|
130 |
$this->packageCurrency = $packageCurrency;
|
131 |
$this->qty = $qty;
|
396 |
return $this->items;
|
397 |
}
|
398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
/**
|
400 |
* @param mixed $name
|
401 |
*/
|
lib/ShipperHQ/WS/Client/WebServiceClient.php
CHANGED
@@ -18,9 +18,14 @@ class WebServiceClient {
|
|
18 |
|
19 |
$jsonRequest = json_encode($requestObj);
|
20 |
$debugRequest = $requestObj;
|
21 |
-
$debugRequest->credentials = null;
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
24 |
$debugData['url'] = $webServiceURL;
|
25 |
$responseBody = '';
|
26 |
|
18 |
|
19 |
$jsonRequest = json_encode($requestObj);
|
20 |
$debugRequest = $requestObj;
|
21 |
+
$debugRequest->credentials->password = null;
|
22 |
+
if (version_compare(PHP_VERSION, '5.4') >= 0) {
|
23 |
+
$jsonDebugRequest = json_encode($debugRequest, JSON_PRETTY_PRINT);
|
24 |
+
}
|
25 |
+
else {
|
26 |
+
$jsonDebugRequest = json_encode($debugRequest);
|
27 |
+
}
|
28 |
+
$debugData['json_request'] = $jsonDebugRequest;
|
29 |
$debugData['url'] = $webServiceURL;
|
30 |
$responseBody = '';
|
31 |
|
package.xml
CHANGED
@@ -1,71 +1,70 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
-
<name>
|
4 |
-
<version>2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>The Ultimate Shipping Rate Management Platform</summary>
|
10 |
-
<description><p>ShipperHQ is revolutionizing eCommerce shipping by putting you in control of the shipping in your cart. </p>
|
11 |

|
12 |
-
<p>
|
13 |

|
14 |
-
<p>With ShipperHQ
|
15 |

|
16 |
-
<p>Getting started is quick and easy!
|
17 |
-
|
18 |
-
<h2>Product Features</h2>
|
19 |
-
<strong>Live Rating</strong><br />
|
20 |
-
&bull; Get both international and domestic live rates from more than 20 carriers including LTL freight. <br />
|
21 |
<br />
|
22 |
-
&bull; Supported carriers include UPS, USPS, FedEx, FedEx Smartpost, Australia Post, DHL and more.<br />
|
23 |
<br />
|
24 |
-
&bull; Control what rates and options are shown and when, as well as surcharge and discount shipping at will.<br />
|
25 |
<br />
|
|
|
|
|
26 |
<br />
|
27 |
-
|
28 |
-

|
29 |
-
<strong>Custom-Defined Rating</strong><br />
|
30 |
-
&bull; Define your own shipping rates using a combination of factors including product type, cart quantity, value, weight and more.<br />
|
31 |
<br />
|
32 |
-
&bull; Define what prefered carriers, shipping methods, advanced discounts, promotions and markups you wish to use. <br />
|
33 |
<br />
|
34 |
-
&
|
|
|
|
|
|
|
|
|
35 |
<br />
|
36 |
<br />
|
37 |
-
|
38 |
-
<
|
39 |
-
&
|
|
|
40 |
<br />
|
41 |
-
&bull; Define rules for products allowing you to ship certain items separately or in multiple packages.<br />
|
42 |
<br />
|
43 |
-
&
|
|
|
|
|
|
|
44 |
<br />
|
45 |
<br />
|
46 |
-
|
47 |
-
<
|
48 |
-
&
|
49 |
<br />
|
50 |
-
&bull; Define service zones for each origin so you can rate shipments from the nearest warehouse to the customer if products are available from multiple origins.<br />
|
51 |
<br />
|
|
|
|
|
|
|
|
|
52 |
<br />
|
53 |
-

|
54 |
-
<strong>Date and Time</strong> <br />
|
55 |
-
&bull; Ship products that need to be delivered on a certain day.<br />
|
56 |
<br />
|
57 |
-
&
|
|
|
58 |
<br />
|
59 |
-
&bull; Set max time in transit for certain items so you can deliver perishable goods. <br />
|
60 |
<br />
|
61 |
-
|
62 |
-
<
|
63 |
-
|
64 |
-
<notes>Accessorial support in admin</notes>
|
65 |
<authors><author><name>Karen Baker</name><user>birches</user><email>sales@webshopapps.com</email></author></authors>
|
66 |
-
<date>
|
67 |
-
<time>
|
68 |
-
<contents><target name="magecommunity"><dir name="Shipperhq"><dir name="Frontend"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Shipping"><dir name="Method"><file name="Form.php" hash="acf58cf837883ffe86a0ec93fc58dc6a"/></dir></dir></dir></dir></dir></dir><dir name="Catalog"><file name="Helper.php" hash="779c54568b34017b9a73ff472e05b417"/><file name="Shipresults.php" hash="3c18bd471d6babcb74acfb6ff2597416"/></dir><dir name="Checkout"><file name="AbstractBlock.php" hash="38be0327c2879d2fd2ce317ecfe523ec"/><file name="Helper.php" hash="addb3e46b89a9e7de5365f98e31a3be3"/><dir name="Multishipping"><file name="Shipping.php" hash="2e50eeccb573767edee8de52dccf3a51"/></dir><dir name="Onepage"><file name="Progress.php" hash="f8fdd80c8b048e391f40e318662529d3"/><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="0b656c699c4df73032c0e924662d5b7a"/></dir></dir></dir></dir></dir><dir name="Model"><dir name="Checkout"><dir name="Type"><file name="Multishipping.php" hash="97ab5e52f7cdb2a63d9957cb8b46df06"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="5f102f883e9f8ad420c71db959130027"/></dir></dir><dir name="Migration"><dir name="Block"><dir name="Adminhtml"><dir name="Migration"><dir name="Edit"><file name="Form.php" hash="e65f945926e9e87d7dbab64eca85d80e"/></dir><file name="Migratable.php" hash="80cf105996a45d8f80e2dc9d0fa59241"/></dir><file name="Migration.php" hash="e807d394e08bf661325f5d397e0b2cc9"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d6f367eb9c8a5c1c10b4887ae8c6ef9c"/></dir><dir name="Model"><file name="Migrate.php" hash="4318876db788e11d054ee7869927c223"/><dir name="Product"><file name="Action.php" hash="e2edf8a97c568c2ec4201a9b1e08bcfe"/></dir><dir name="Resource"><dir name="Iterator"><file name="Batched.php" hash="a2ce45abd2d287442e892e5fea25762f"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Shqmigration"><file name="AjaxController.php" hash="eea6197d6715c1f4fe5fc92f6bf2397b"/></dir><file name="ShqmigrationController.php" hash="4e9b9063dc2a109de9d15d73026625ff"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="c7bb5a66a08161508040dcfa296d7440"/><file name="config.xml" hash="0c350c6eb97ab451f2c2a605149021be"/><file name="migrate.xml" hash="3839d9641e4f3462cfee032880898373"/></dir></dir><dir name="Paypalexpress"><dir name="Model"><dir name="Express"><file name="Checkout.php" hash="af2940c17b7143566779becb1bd77bb2"/></dir></dir><dir name="etc"><file name="config.xml" hash="e4a294cd10539111fe5ac2ec9a622bd5"/></dir></dir><dir name="Pbint"><dir name="Block"><dir name="Adminhtml"><dir name="System"><file name="Upload.php" hash="4111f7f5b317ae6bb10851968cb3ffd0"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Duty.php" hash="c98c5b932ea5aec9f4c81022a1192883"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="dc91bbc0715676e9c91aebd8ad95bca2"/></dir><dir name="Model"><dir name="Catalog"><file name="Category.php" hash="63f3bef38a5c42546fa258693995730a"/><file name="Cron.php" hash="e9a7ca4367d161ae60304454cf4e28f0"/><file name="File.php" hash="38f44a92aa5f50403ab5b896415fb2df"/><file name="Product.php" hash="41941c4effb18e144803ecf6046fd6b5"/></dir><file name="Credentials.php" hash="2b24579bb81f1e72c6b3fdef9d40117c"/><dir name="Creditmemo"><file name="Duty.php" hash="13cc01a5f3b34820aac55b56d0e39fc6"/></dir><file name="Helper.php" hash="edfb41014fea57732ce28961eb76610d"/><file name="Inboundparcel.php" hash="92e6707f1b1f6c0452f0046c6e7e3023"/><dir name="Invoice"><file name="Duty.php" hash="8f2dc4d61c51d25ccf41d8b6298d5797"/></dir><dir name="Mysql4"><dir name="Inboundparcel"><file name="Collection.php" hash="0e92ce7706a35f437648bc8fc1af8589"/></dir><file name="Inboundparcel.php" hash="5a67896ab136658e5ab3e8a3bdc439d8"/><dir name="Ordernumber"><file name="Collection.php" hash="44bd744bffbf379a53ded9d0e224d73b"/></dir><file name="Ordernumber.php" hash="4c41a456de939e0466a4538d041cd6a6"/><dir name="Variable"><file name="Collection.php" hash="604ca08469673a0de3d2664dc3c0a25e"/></dir><file name="Variable.php" hash="15668dac4e171b7dfbefc9a70d498d38"/></dir><file name="Observer.php" hash="922202255e95b71f04cad56add80de20"/><file name="Ordernumber.php" hash="1aa67b1a078b1cdb8abec0dea1eb99c6"/><dir name="Pdf"><file name="Duty.php" hash="6915797cd492c6c4a7d5fa0ea5fd105d"/></dir><dir name="Quote"><file name="Duty.php" hash="96c704986c3f35df5aa8f27f02a0c0cd"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="b5afbd3be52a805717bd8d724cfdc236"/></dir></dir><file name="Variable.php" hash="21d95419fedbc5d8b203a63192ce64a5"/></dir><file name="README" hash="5baea7c4c231d8cda23465a1abd5427e"/><file name="changelog.txt" hash="d41d8cd98f00b204e9800998ecf8427e"/><dir name="controllers"><dir name="Adminhtml"><file name="ShqpitneyController.php" hash="2c9ca33469cd59a58f5203a34cc82321"/></dir></dir><dir name="etc"><file name="config.xml" hash="dfe35e6b0f1ba4ae78021425d67cfa12"/><file name="system.xml" hash="59f31bab9846e7fbd5849cc6f73b244a"/></dir><dir name="sql"><dir name="shqpbint_setup"><file name="mysql4-install-1.0.0.php" hash="1ef775be6c786160e59c521f3cd10a4e"/><file name="mysql4-install-1.0.1.php" hash="9cab52a13bdd3af8baf02a0f9acf7698"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="702a242cb4610160325413b94800423e"/></dir></dir></dir><dir name="Shipper"><dir name="Block"><dir name="Adminhtml"><dir name="Carrier"><file name="About.php" hash="4304689cd98ea6b9cf1c7c697496c7ad"/><file name="Heading.php" hash="eaaf1bdc23b6aae54b2ba4660b8eca20"/><file name="Refreshcarriers.php" hash="eb0f72734d22c1a50ae6a41ed0adb8d8"/></dir><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Dimensional.php" hash="825921f0e09e109301c9f4271705c70f"/></dir></dir></dir></dir><dir name="Synchronize"><file name="Grid.php" hash="bdfbb07a87dfacb4d44e3f72928bf211"/><file name="Notify.php" hash="ed840b2996454b11d332c175da066b92"/></dir><file name="Synchronize.php" hash="1f33ea7eba5b56f4debdc1426b86179f"/><dir name="System"><dir name="Config"><dir name="Fieldset"><dir name="Shipper"><file name="Hint.php" hash="c8cd2e8f91be03c4aa55637ca3e618da"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="0a6c7d4ddf425d897126a7a2b036ea97"/><file name="Mapper.php" hash="f817cbd7a779273d27f8d0a7efd02eb3"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Carriers.php" hash="fcc5cb5fd2d36c1e8f3a85724482c8b3"/><file name="Environmentscope.php" hash="555a4ba95d622ecd6c52ec9ba51901a7"/></dir></dir></dir></dir><file name="Attributeupdate.php" hash="fbdcc89a3d40635dec8fb435b0152996"/><dir name="Carrier"><file name="Backup.php" hash="63c7e73014106b9293c844bc61c8bf02"/><dir name="Convert"><file name="AddressMapper.php" hash="3791c4c9aeb9546b4c2f9a43dec5a1bc"/><file name="OrderMapper.php" hash="5e12dc5eb3baac6314ab0b8b11ebe3fb"/><file name="ShipmentMapper.php" hash="ad82204fc273f205bb788e95fb8ed9a5"/><file name="ShipperMapper.php" hash="80b6bdb13385f044154a5dd4c558e952"/></dir><file name="Shipper.php" hash="b022b58be8f72b1d37f64d4a3d090b14"/><file name="Shipperadmin.php" hash="fd5720c180dc819e89bbe02ef455d836"/></dir><dir name="Checkout"><file name="Helper.php" hash="17835e9e5a3e73af3260a0408e82b2b6"/></dir><dir name="Observer"><file name="Order.php" hash="0e36b1d6dd4dde18c5ba73fdd7058321"/><file name="Shipment.php" hash="82864cc0980c69f460f0e4868b862148"/></dir><file name="Observer.php" hash="1e35810b858ec6e7e987bd39e9629569"/><dir name="Order"><file name="Packages.php" hash="9e5e2f2247f075ed7412a3368dcfdc11"/></dir><dir name="Quote"><file name="Packages.php" hash="f4856c7ddb605d8057a4ce2726ee4c55"/></dir><dir name="Rate"><file name="Result.php" hash="9a5982a06bc339f69a741cd142ed86c7"/></dir><dir name="Resource"><dir name="Attributeupdate"><file name="Collection.php" hash="9ac1acf4e1afed74d4fe8c88b9ba06b9"/></dir><file name="Attributeupdate.php" hash="0fc727f72ad1266b3575645c24dc90fa"/><dir name="Order"><dir name="Packages"><file name="Collection.php" hash="37a8a9936e4ccd405870b4bdc112d6f8"/></dir><file name="Packages.php" hash="8f04c5cce0319703e1ca687a86b66bc8"/></dir><dir name="Quote"><dir name="Packages"><file name="Collection.php" hash="45293d05b079de5a9cdf13a0a4171b39"/></dir><file name="Packages.php" hash="84a1d81e7b19b0d98f7476f2b5a59f6f"/></dir><file name="Storage.php" hash="2f5f9b5a7422deced69f5df9f95f0149"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><file name="Rate.php" hash="5932a041db0ed4b4b3d181add36a2b7a"/></dir></dir></dir><file name="Session.php" hash="6d5d017d8f1b8aeeff869ca6e005c8af"/><dir name="Source"><dir name="Freight"><file name="Freightclass.php" hash="aceaeecaa62ebc9f843ac7ef03df26f2"/></dir><dir name="Validation"><file name="Result.php" hash="4318cc4232fd6aa24f603299dc060a66"/></dir></dir><dir name="Storage"><file name="Manager.php" hash="19a7613a55c66f7c3d4bd8529a6c8d87"/></dir><file name="Storage.php" hash="8523438e72510a0a7eb188402187383b"/><file name="Synchronize.php" hash="b91475d87c9791f116400726bff7b2f6"/></dir><file name="changelog.txt" hash="e351c93a0b34065dcae0ab9d1ba873c8"/><dir name="controllers"><dir name="Adminhtml"><file name="ShqajaxController.php" hash="07022609db6b92529d7b4b792586f188"/><file name="ShqsynchronizeController.php" hash="bd2d2d10d7b8a55d8708e7be0fe4ff5b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ef30d556114e2f7eae48210162b80472"/><file name="config.xml" hash="0d69fd71d8922ae3cf52bc901e23b6bc"/><file name="system.xml" hash="5b4cf0375eaa44309c9b7d76254326a2"/></dir><dir name="sql"><dir name="shipperhq_shipper_setup"><file name="mysql4-install-0.0.10.php" hash="fa0617c03bfee8e117ae376d5e5dfe17"/><file name="mysql4-install-0.0.11.php" hash="98e5a874f60adee12da831c3a6ef488d"/><file name="mysql4-install-0.0.12.php" hash="9e3ef4c29d83febaff74399dd1f0cc91"/><file name="mysql4-install-0.0.13.php" hash="093df5f7b577c24ec7d81686aa1ef7d2"/><file name="mysql4-install-0.0.14.php" hash="6a46a227ac7b1a868252352f0e503c4a"/><file name="mysql4-install-0.0.15.php" hash="a270a571d929ec215c7d7c3d92259e6d"/><file name="mysql4-install-0.0.16.php" hash="8f1bc1254e0941db2662d3734f0124f3"/><file name="mysql4-install-0.0.17.php" hash="69470881a23aa23af723cfb676424d1a"/><file name="mysql4-install-0.0.18.php" hash="ad02ae013579ebfb571ca04cf1bd449f"/><file name="mysql4-install-0.0.19.php" hash="df6e3f3a2b11cacd6c30e78ec27120b4"/><file name="mysql4-install-0.0.20.php" hash="a95bd37a86cc383bfb6f6ffc0bdc53b2"/><file name="mysql4-install-0.0.21.php" hash="f8555e5d7ba9fbfb54258d38480f0766"/><file name="mysql4-install-0.0.22.php" hash="6dc64e38df396ae28e8c12e48a4fca14"/><file name="mysql4-install-0.0.23.php" hash="c09d0b920acd392bea7646565018643b"/><file name="mysql4-install-0.0.24.php" hash="bbe3bdd5df750629eec5e21e467d88c0"/><file name="mysql4-install-0.0.25.php" hash="a25f7704e8001be72dd55dcd1f681852"/><file name="mysql4-install-0.0.26.php" hash="cbdc4b509674438d6db842cb2830702b"/><file name="mysql4-install-0.0.27.php" hash="375c3f49209ce6d843af891e22fdfca4"/><file name="mysql4-install-0.0.28.php" hash="04c6c5b0cc40bb17d674959b9d1e6e1d"/><file name="mysql4-install-0.0.29.php" hash="0805c6bc54d77dbb562e5b4d57f5b42a"/><file name="mysql4-install-0.0.30.php" hash="29588d8b85f58e10e98646a290bb3bc4"/><file name="mysql4-install-0.0.8.php" hash="32f338aac46f40fd5b494fcdfff4c2af"/><file name="mysql4-install-0.0.9.php" hash="35e480613ed20d01c9336191c82b3b52"/><file name="mysql4-upgrade-0.0.10-0.0.11.php" hash="dddddbd76a09c29a5c66d001c44875a8"/><file name="mysql4-upgrade-0.0.11-0.0.12.php" hash="68691b1aa419721185b7894b432a6fbc"/><file name="mysql4-upgrade-0.0.12-0.0.13.php" hash="52fdb7496189b23058d8d9eb7a207dd0"/><file name="mysql4-upgrade-0.0.13-0.0.14.php" hash="5d44ca4716c8c09b193c996113c10364"/><file name="mysql4-upgrade-0.0.14-0.0.15.php" hash="ff819b6264851da586137b4e06f96910"/><file name="mysql4-upgrade-0.0.15-0.0.16.php" hash="4cb72fe71080b33fca58af2f9a603686"/><file name="mysql4-upgrade-0.0.16-0.0.17.php" hash="4d465e6ce08c9c165d0037e7d1bb175f"/><file name="mysql4-upgrade-0.0.17-0.0.18.php" hash="bc287efe97d6dc7c7c259ece7fa7a99a"/><file name="mysql4-upgrade-0.0.18-0.0.19.php" hash="f4da98e326e1bb99dc997dc044e196b4"/><file name="mysql4-upgrade-0.0.19-0.0.20.php" hash="5363b535bd3e271e7ac77a784ce324f2"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="46b488056d65c651cdfb0ae5cfe38b8d"/><file name="mysql4-upgrade-0.0.20-0.0.21.php" hash="7e89ad55723df152fd34b47c37d61cee"/><file name="mysql4-upgrade-0.0.21-0.0.22.php" hash="d2dd4a70cc242235985b13097bfbc928"/><file name="mysql4-upgrade-0.0.22-0.0.23.php" hash="06116fffaf4ffa2d68eed20e5d02ae11"/><file name="mysql4-upgrade-0.0.23-0.0.24.php" hash="ca3e92947c6545bf5f0b96957ee5a4ab"/><file name="mysql4-upgrade-0.0.24-0.0.25.php" hash="1df7cd63d709640db0cda91248f1cc30"/><file name="mysql4-upgrade-0.0.25-0.0.26.php" hash="94adac7f508deb487e714d47a189c97f"/><file name="mysql4-upgrade-0.0.26-0.0.27.php" hash="b45b3ea8a9eb245e650fb45462a67ce9"/><file name="mysql4-upgrade-0.0.27-0.0.28.php" hash="605fdb4ec7840d574596f113ce021477"/><file name="mysql4-upgrade-0.0.28-0.0.29.php" hash="732dd1dbc1cc4cfe81638f5c9c2c84fc"/><file name="mysql4-upgrade-0.0.29-0.0.30.php" hash="20c5de6ac85c92049d043ccf07741c86"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="a8e259c10737f5fe60b76c7f292846c5"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="18d854af6943f37b9556017d93647e9f"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="c81d14178543d57ff75af01ae31683a4"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="bd2b6c9e4aef8b9cfda89f9a5d428265"/><file name="mysql4-upgrade-0.0.7-0.0.8.php" hash="55bc901aae3ff2ad9a0c9961c9f2d6b9"/><file name="mysql4-upgrade-0.0.8-0.0.9.php" hash="161bd7971bff62cb249fc5e8631d1674"/><file name="mysql4-upgrade-0.0.9-0.0.10.php" hash="63417ee4d41313682226525aa11db652"/></dir></dir></dir><dir name="ShipperTest"><dir name="Helper"><file name="Data.php" hash="23ca518832cfe928da0fe069da1deacd"/></dir><dir name="Test"><dir name="Model"><dir name="Carrier"><file name="Shippertest.php" hash="07e50b6c7255d3c134e77910562a4f8d"/><dir name="_data"><file name="ex-testGetQuotes.yaml" hash="6c1f1fd9c90c9dfff6e638e37db9462f"/><file name="fx-config.yaml" hash="5894a20423a95bb99c416e8d6736936e"/></dir></dir><dir name="Migration"><file name="Migration.php" hash="2044f30d71cc51485f425c94badede54"/></dir><dir name="Shipper"><file name="Shippertest.php" hash="3271357942303631c8c9e85732028cca"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="56a27533a8c0e77d62d1c7794b1b09ff"/></dir></dir></dir><dir name="Webshopapps"><dir name="Adminshortcut"><dir name="Helper"><file name="Data.php" hash="e0b3d57fb624622b400e601f2229e991"/></dir><file name="changelog.txt" hash="0716b4fd8f070dd826fa9ccd4577bc2c"/><dir name="etc"><file name="adminhtml.xml" hash="80b231894e0108aa914715da3b42bf5e"/><file name="config.xml" hash="4222cc2209d41b89d24f47f7b7342bb7"/></dir></dir><dir name="Wsalogger"><dir name="Adminhtml"><dir name="Block"><dir name="Log"><dir name="Grid"><dir name="Renderer"><file name="Actions.php" hash="473872b8e0c6b55242a47ff77bd2248d"/></dir></dir><file name="Grid.php" hash="c69c4d94766ae37a2d9a51743c40ade3"/><file name="View.php" hash="0373fda90bb41844369ad18fac2146c7"/></dir><file name="Log.php" hash="54c644b5977ce506ca0dd0bd962e7589"/><dir name="Notification"><dir name="Grid"><dir name="Renderer"><file name="Code.php" hash="3b0dd6a7d11fe0520b36bb92e699ebbc"/><file name="Notice.php" hash="6b95f97727f126b5a674a6cb22176978"/><file name="Severity.php" hash="7f9b5985ce5b60c57a841192e3f29a4e"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Modules"><file name="DisableLogging.php" hash="7aae4ca58f704045267c9b556c2be3e6"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="783fe47d8bfc6d24c5fb73912d29c5bc"/><file name="Log.php" hash="47084ce5034469a32802b6674d9eeff7"/></dir><dir name="Model"><file name="Log.php" hash="ab6a7a9431aaf7d0cc90c46c5b494818"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="f86775cc279d3e2a84006309a991e197"/></dir><file name="Log.php" hash="d3bc2f0d28ae634a7aa7bc622fc5c7fa"/></dir><file name="Observer.php" hash="58c79f3b39fa2a6f14d9fc074be02a75"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Severities.php" hash="b0f96c4ebe133ae8dbdd762a5947ff6f"/></dir></dir></dir></dir><file name="changelog.txt" hash="130376ec2e3b4e290daa092e1178f00f"/><dir name="controllers"><dir name="Adminhtml"><file name="WsaloggerController.php" hash="eed6f300259745ad2fdb284ac5bd7d50"/></dir><file name="IndexController.php" hash="adac20244d34c93051807b65ca015f9d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="53378e5eb78f6c73eb00991976bb69bb"/><file name="config.xml" hash="98315ca9b8f69d05997e66c12a3dcf1e"/><file name="system.xml" hash="a5410b5eb9739f6a5222334ae2a3b7fc"/></dir><dir name="sql"><dir name="wsalogger_setup"><file name="mysql4-install-1.0.0.php" hash="32db82e8865ef799c4d4d64e7b4042e4"/><file name="mysql4-install-1.0.1.php" hash="386616525a4b4be6b2d94955e4f2ec81"/><file name="mysql4-install-1.0.2.php" hash="386616525a4b4be6b2d94955e4f2ec81"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="c0c3b4fd38f3ab92eab2b6fd0b556701"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="9f0c4f258368c9130e41f5731f27ed5b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="shipperhq"><file name="pbint.xml" hash="7fc736fd75e3212477c27eead9239bbe"/><file name="shipper.xml" hash="380b5112521b2b7e1a6d4cd035609f4e"/><file name="shipper_migration.xml" hash="6f1e05b87674005436742c2a0231d4a9"/></dir><file name="webshopapps_wsalogger.xml" hash="7bdcb195f5273ff1ece6ced0b56eaad2"/></dir><dir name="template"><dir name="shipperhq"><dir name="frontend"><dir name="js"><file name="bottom.phtml" hash="0995ca67eb260cf362a550a7a19f8fcb"/></dir><dir name="sales"><dir name="order"><dir name="create"><dir name="shipping_method"><file name="available.phtml" hash="62e73f804ef6b49dcfc419e5e30e5036"/></dir></dir><dir name="view"><file name="info.phtml" hash="09264456fc3ae6904fe3b19fbcbdcf28"/></dir></dir></dir></dir><file name="migrate_extension.phtml" hash="e03c21de8c61b3f003d6dacf31fb8214"/><dir name="shipper"><dir name="catalog"><dir name="product"><dir name="edit"><file name="shipping.phtml" hash="a073e968b33f21e588a7b836d3d08122"/></dir></dir></dir><dir name="synchronize"><file name="notify.phtml" hash="204eb93b7ece37b882f75e8d709676fa"/></dir><dir name="system"><dir name="carrier"><file name="refreshcarriers.phtml" hash="d29c86d513c627236e90d50284d9ba10"/></dir></dir></dir><file name="upload.phtml" hash="32b85eb77ff17a7529f0540f3a688357"/></dir><dir name="webshopapps_wsalogger"><file name="grid.phtml" hash="2701b7834b1ce350a2e941e5d4d76ca6"/><file name="view.phtml" hash="ea079e0f9e00ebdb1180b1d5ab51af66"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="shipperhq"><file name="pbint.xml" hash="489798a2a177778a17dad3bcf6a6d514"/></dir></dir><dir name="template"><dir name="shipperhq"><dir name="catalog"><file name="shipresults.phtml" hash="fcc977996f280f3805ba6a81a4b73eed"/></dir><dir name="checkout"><dir name="cart"><dir name="rwd"><file name="shipping.phtml" hash="0f1fb789c6bbd936ef6f98c4c549eab4"/></dir><file name="shipping.phtml" hash="336b2adf15c740df5e2ebcd3e6a46b7d"/></dir><dir name="multishipping"><file name="overview.phtml" hash="508833ff506d4aaba2c02ab9f361e0bb"/><file name="shipping.phtml" hash="001e6801dca1f6e6468d9d295845195b"/></dir><dir name="onepage"><dir name="shipping_method"><file name="available.phtml" hash="186b9de610e356855aeb766807c1690e"/></dir></dir><dir name="onestepcheckout"><file name="pickup_review.phtml" hash="797be6ca50e905e091f645a08978183a"/><file name="shipping_method_osc_shq.phtml" hash="88f7a942924a75cedb3cdbc3cf8b1f5d"/><file name="shipping_method_osc_shq_radio.phtml" hash="f9c7bddff7451043c11e4aecadd575e6"/></dir></dir><dir name="js"><file name="bottom.phtml" hash="0995ca67eb260cf362a550a7a19f8fcb"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shipperhq_Frontend.xml" hash="0ea0c10aaf125db468f22f7465fac76f"/><file name="Shipperhq_Migration.xml" hash="38bf92228885ea2d3e5b78655014eae2"/><file name="Shipperhq_Paypalexpress.xml" hash="ac91b998f0280f62227ca3944f9d8c9b"/><file name="Shipperhq_Pbint.xml" hash="4bf75884da281c5ecbc7ff7eac2ce3ef"/><file name="Shipperhq_Shipper.xml" hash="c219d3092fd0d15c7bd5c47aa3de1fbc"/><file name="Webshopapps_Wsalogger.xml" hash="199d449ef7cf012fcfc32357de430cfd"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="sales"><file name="shipperhq_pitney_shipment_new.html" hash="ba44eb91c2ccc7772f47adf1c9f61e0b"/></dir><file name="webshopapps_log_email.html" hash="c85b0d27c9ecdb9c227d99cd0aaa86fb"/></dir></dir><file name="Shipperhq_Shipper.csv" hash="ba037cbb5dfe5ead2edf805a62ecbfbd"/></dir></target><target name="mage"><dir name="js"><dir name="shipperhq"><file name="jquery-loader.js" hash="1dd39146fe9c907f50747bd418be1ff9"/></dir></dir></target><target name="magelib"><dir name="ShipperHQ"><file name="CHANGELOG" hash="0987223093a0f7203a5b184953061048"/><dir name="Checkout"><file name="Cart.php" hash="3040b909017ca7728bc813791073dc66"/><file name="Item.php" hash="b1f5a8a2e9b7da5353bee664cec5fbb9"/><file name="ItemAttribute.php" hash="ceae511d7d1d62b2821cdf5052c55109"/></dir><dir name="Shipping"><file name="Accessorials.php" hash="48f96d92236e636b2596b07157c907eb"/><file name="Address.php" hash="a7b77d3ef89dd3c879aa5d317b3f730a"/><file name="SelectedOptions.php" hash="1d248c30d33e8487ee975b4bfd3a435c"/></dir><dir name="User"><file name="Credentials.php" hash="db3331cbbdf02b690e5b0efbf211a21f"/><file name="SiteDetails.php" hash="6d52462b7021f1c5a60d328d5ae345cc"/></dir><dir name="Validation"><file name="Address.php" hash="5d1efe3091d0516447a5d58348677b67"/></dir><dir name="WS"><dir name="Client"><file name="WebServiceClient.php" hash="681426cc856570af1b72800c3a08daad"/></dir><dir name="Request"><file name="AbstractWebServiceRequest.php" hash="a8eb81c9a708ac54f79d33750f3c4ff2"/><dir name="Rate"><file name="CustomerDetails.php" hash="adf5e4e7c2e05205a4e383af344f1724"/><file name="CustomerGroup.php" hash="799d15d8603f35cda92084fbe638cd83"/><file name="InfoRequest.php" hash="002f93754191f8fb20285ba0a34c836b"/><file name="RateRequest.php" hash="38ef8eb23eeb462c2ad8441dbb0669d7"/><file name="ShipDetails.php" hash="128e2060216075fffb123c4ad9e0fdb3"/><file name="ShipmentAddonRequest.php" hash="f64a3a36bc783b7fd4f3a894bdda361d"/><file name="ShipmentCustomerDetails.php" hash="5b67a971d867d0121de0317746e8c6dd"/><file name="ShipmentRequest.php" hash="b2db65e1b398b258461ed18c83be2761"/></dir><dir name="UPS"><dir name="registration"><file name="UPSRegistrationRequest.php" hash="d470c6a7cbc94e21e41ab88dbc3558d6"/></dir></dir><dir name="Validation"><file name="Request.php" hash="5484da6fb582d854a5383a1b2aed4d06"/></dir><file name="WebServiceRequest.php" hash="e342ae20cee6a2799adfcdfa36688e2c"/></dir><dir name="Response"><file name="AbstractWebServiceResponse.php" hash="fcfccb9715bb10174f6d6fd41daf0aa4"/><file name="ErrorMessages.php" hash="53b6dce12e4024c1e727a8aefb5cddca"/><file name="ResponseSummary.php" hash="98af5f450f8700308b3384fda2c7db21"/><dir name="UPS"><dir name="Registration"><file name="UPSRegistrationResponse.php" hash="7776f2a4adb472ace875a8c470a6b06a"/></dir></dir><file name="WebServiceError.php" hash="ed4e0051391c6e9cb047236273c4e048"/><file name="WebServiceResponse.php" hash="6a69713d0843cfc8dfb166b20d2d8a9f"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="shipperhq"><dir name="css"><file name="shipperhq_migration.css" hash="d7e6eb30477722bfa10fc901875a192e"/></dir><dir name="images"><file name="shq-logo.png" hash="45c4d0cc3836bf59db50d4c148cde600"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="shipperhq"><file name="calendarbase.css" hash="407f287cddd1ea678a4cd9c3f8d993a0"/><file name="storepickup.css" hash="783022d69d9543ff4a8b204d264c06ca"/></dir></dir><dir name="images"><dir name="shipperhq"><file name="tooltip.jpg" hash="c93990a2e5705f4771c8e87b14643a74"/><file name="ups.gif" hash="0654a9638a3b7787f35495ad17dc7363"/></dir></dir></dir></dir></dir></target></contents>
|
69 |
<compatible/>
|
70 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
71 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
+
<name>shipperhq_shipperhq</name>
|
4 |
+
<version>2.151.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>The Ultimate Shipping Rate Management Platform</summary>
|
10 |
+
<description><p>ShipperHQ is revolutionizing eCommerce shipping by putting you in control of the shipping in your cart. We have taken all that you love about WebShopApps and combined it into one easy-to-use solution that is available for Magento 1 and 2. We offer our customers a <strong>30-day free trial with subscriptions starting at $50/month</strong>.</p>
|
11 |

|
12 |
+
<p>Now you can address the unnerving issue of cart abandonment by fully customizing the rates and options you offer to your customers. Our advanced rules engine allows you to provide customers worldwide with live rates from one or multiple major carriers or custom rates, giving them a wider range of options.</p>
|
13 |

|
14 |
+
<p>With ShipperHQ you set the rules - you can apply discounts, promotions, restrictions and markups to ensure you cover your costs.</p>
|
15 |

|
16 |
+
<p>Getting started is quick and easy! Sign up for a 30-day free trial, and if you are currently using one of our WebShopApps extensions, we will help you migrate to ShipperHQ.</p>
|
17 |
+
<a href="http://www.shipperhq.com"><img src="https://example4937.files.wordpress.com/2016/03/button1.jpg" alt="button" width="836" height="45" /></a>
|
|
|
|
|
|
|
18 |
<br />
|
|
|
19 |
<br />
|
|
|
20 |
<br />
|
21 |
+
<h2>Support for 30+ Major Carriers</h2>
|
22 |
+
<img src="https://example42273.files.wordpress.com/2016/08/screen-shot-2016-08-16-at-17-41-45.png" alt="Screen Shot 2016-08-16 at 17.41.45" width="836" height="200" />
|
23 |
<br />
|
24 |
+
<div>UPS, FedEx, USPS, DHL, FedEx SmartPost, Australia Post, GSO, Startrack, fastway, Cerasis, Echo Global Logistics, UPS Freight, FedEx Freight, Old Dominion, ReTrans Freight, Estes, Primus, XPOLogistics, YRC Freight and more!</div>
|
|
|
|
|
|
|
25 |
<br />
|
|
|
26 |
<br />
|
27 |
+
<h2>Enterprise-Grade Features Include:</h2>
|
28 |
+
<strong>Live Rating</strong>
|
29 |
+
<br />•Get both international and domestic live rates from more than 30 carriers including LTL freight. 
|
30 |
+
<br />•Supported carriers include UPS, USPS, FedEx, FedEx Smartpost, Australia Post, DHL and more.
|
31 |
+
<br />•Control what rates and options are shown and when, as well as surcharge and discount shipping at will. 
|
32 |
<br />
|
33 |
<br />
|
34 |
+
<strong>Custom-Defined Rating</strong>
|
35 |
+
<br />•Define your own shipping rates using a combination of factors including product type, cart quantity, value, weight and more. 
|
36 |
+
<br />•Define what prefered carriers, shipping methods, advanced discounts, promotions and markups you wish to use. 
|
37 |
+
<br />•Manage your rates on the fly in ShipperHQ’s dashboard or use CSV files to define complex tables of rates.
|
38 |
<br />
|
|
|
39 |
<br />
|
40 |
+
<strong>Dimensional Shipping</strong>
|
41 |
+
<br />•Define your product and package dimensions and ShipperHQ will workout the best box or boxes to use for each customer’s order in real-time.
|
42 |
+
<br />•Define rules for products allowing you to ship certain items separately or in multiple packages.
|
43 |
+
<br />•Get accurate rates on bulky and oddly shaped products by adding box packing weight, per-box surcharges, max quantities and limiting products packed in specific boxes. 
|
44 |
<br />
|
45 |
<br />
|
46 |
+
<strong>Multi-Origin Shipping</strong>
|
47 |
+
<br />•Ship products from multiple warehouses or dropship vendors. 
|
48 |
+
<br />•Define service zones for each origin so you can rate shipments from the nearest warehouse to the customer if products are available from multiple origins.
|
49 |
<br />
|
|
|
50 |
<br />
|
51 |
+
<strong>Date and Time</strong> 
|
52 |
+
<br />•Ship products that need to be delivered on a certain day. 
|
53 |
+
<br />•Display a calendar to your customers so they can choose their delivery date, provide estimated delivery dates or show Time in Transit. 
|
54 |
+
<br />•Set max time in transit for certain items so you can deliver perishable goods. 
|
55 |
<br />
|
|
|
|
|
|
|
56 |
<br />
|
57 |
+
<strong>Magento 2</strong>
|
58 |
+
<br />•ShipperHQ is also available on Magento 2. You can download the ShipperHQ Magento 2 extension at <a href="http://www.shipperhq.com/magento2">ShipperHQ.com/Magento2</a>.
|
59 |
<br />
|
|
|
60 |
<br />
|
61 |
+
<br />
|
62 |
+
<a href="http://www.shipperhq.com"><img src="https://example4937.files.wordpress.com/2016/03/bottom-banner-listing3.jpg" alt="Bottom Banner listing" width="836" height="300" /></a></description>
|
63 |
+
<notes>Fixed issue with inside delivery and limited delivery not being able to be deselected</notes>
|
|
|
64 |
<authors><author><name>Karen Baker</name><user>birches</user><email>sales@webshopapps.com</email></author></authors>
|
65 |
+
<date>2017-06-14</date>
|
66 |
+
<time>16:19:36</time>
|
67 |
+
<contents><target name="magecommunity"><dir name="Shipperhq"><dir name="Frontend"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Shipping"><dir name="Method"><file name="Form.php" hash="acf58cf837883ffe86a0ec93fc58dc6a"/></dir></dir></dir></dir></dir></dir><dir name="Catalog"><file name="Helper.php" hash="779c54568b34017b9a73ff472e05b417"/><file name="Shipresults.php" hash="3c18bd471d6babcb74acfb6ff2597416"/></dir><dir name="Checkout"><file name="AbstractBlock.php" hash="1b3daa068568402b1642743d3d1590c1"/><file name="Helper.php" hash="d401e88fa32ae79ef5be955a476e3a63"/><dir name="Multishipping"><file name="Shipping.php" hash="2e50eeccb573767edee8de52dccf3a51"/></dir><dir name="Onepage"><file name="Progress.php" hash="f8fdd80c8b048e391f40e318662529d3"/><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="796eb396945a4759a43eed1e52af26d8"/><file name="Comments.php" hash="bbc29e1359ea398c060c1e42f7fbfe5e"/></dir></dir></dir></dir></dir><dir name="Model"><dir name="Checkout"><dir name="Type"><file name="Multishipping.php" hash="97ab5e52f7cdb2a63d9957cb8b46df06"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="5f102f883e9f8ad420c71db959130027"/></dir></dir><dir name="Migration"><dir name="Block"><dir name="Adminhtml"><dir name="Migration"><dir name="Edit"><file name="Form.php" hash="e65f945926e9e87d7dbab64eca85d80e"/></dir><file name="Migratable.php" hash="80cf105996a45d8f80e2dc9d0fa59241"/></dir><file name="Migration.php" hash="e807d394e08bf661325f5d397e0b2cc9"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d6f367eb9c8a5c1c10b4887ae8c6ef9c"/></dir><dir name="Model"><file name="Migrate.php" hash="4318876db788e11d054ee7869927c223"/><dir name="Product"><file name="Action.php" hash="e2edf8a97c568c2ec4201a9b1e08bcfe"/></dir><dir name="Resource"><dir name="Iterator"><file name="Batched.php" hash="a2ce45abd2d287442e892e5fea25762f"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Shqmigration"><file name="AjaxController.php" hash="eea6197d6715c1f4fe5fc92f6bf2397b"/></dir><file name="ShqmigrationController.php" hash="4e9b9063dc2a109de9d15d73026625ff"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="c7bb5a66a08161508040dcfa296d7440"/><file name="config.xml" hash="0c350c6eb97ab451f2c2a605149021be"/><file name="migrate.xml" hash="3839d9641e4f3462cfee032880898373"/></dir></dir><dir name="Shipper"><dir name="Block"><dir name="Adminhtml"><dir name="Carrier"><file name="About.php" hash="4304689cd98ea6b9cf1c7c697496c7ad"/><file name="Aboutblank.php" hash="36317177d6a1e69a340c58439c614318"/><file name="Heading.php" hash="eaaf1bdc23b6aae54b2ba4660b8eca20"/><file name="Notify.php" hash="c0525fb956f7f48b24868e3f08b01889"/><file name="Refreshcarriers.php" hash="eb0f72734d22c1a50ae6a41ed0adb8d8"/></dir><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Dimensional.php" hash="825921f0e09e109301c9f4271705c70f"/></dir></dir></dir></dir><dir name="Synchronize"><file name="Grid.php" hash="bdfbb07a87dfacb4d44e3f72928bf211"/><file name="Notify.php" hash="f65d3545eb29e78e8aa8d1c9472e8e50"/></dir><file name="Synchronize.php" hash="1f33ea7eba5b56f4debdc1426b86179f"/><dir name="System"><dir name="Config"><dir name="Fieldset"><dir name="Shipper"><file name="Hint.php" hash="c8cd2e8f91be03c4aa55637ca3e618da"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="3521c4426de3c035f65dc25da0914cb9"/><file name="Mapper.php" hash="f817cbd7a779273d27f8d0a7efd02eb3"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Carriers.php" hash="fcc5cb5fd2d36c1e8f3a85724482c8b3"/><file name="Environmentscope.php" hash="555a4ba95d622ecd6c52ec9ba51901a7"/><dir name="Shipping"><file name="Allmethods.php" hash="bb158fb804c88384c517675821ac15b1"/></dir></dir></dir></dir></dir><file name="Attributeupdate.php" hash="fbdcc89a3d40635dec8fb435b0152996"/><dir name="Carrier"><file name="Backup.php" hash="c87547d407ad3d9197b3a7326cdc2bfd"/><dir name="Convert"><file name="AddressMapper.php" hash="76c0ebb62df00cf163a402960f562dab"/><file name="OrderMapper.php" hash="38760ff1275cd234149b4fc05c68633b"/><file name="ShipmentMapper.php" hash="1f812c21c60149a563587e2a70aa5b93"/><file name="ShipperMapper.php" hash="9c1d67c54120e572d920cb20772398e0"/></dir><file name="Shipper.php" hash="51d34206d63dc3533975e6759253e151"/><file name="Shipperadmin.php" hash="fd5720c180dc819e89bbe02ef455d836"/></dir><dir name="Checkout"><file name="Helper.php" hash="a17e48fe2f738697ea2fbfea2355d2be"/></dir><dir name="Observer"><file name="Order.php" hash="080a0d7e9e820dfb79777ec64223b2c4"/><file name="Shipment.php" hash="82864cc0980c69f460f0e4868b862148"/></dir><file name="Observer.php" hash="2f69eb20e4f0ad7e26a61ef7fafe1f04"/><dir name="Order"><file name="Packages.php" hash="9e5e2f2247f075ed7412a3368dcfdc11"/></dir><dir name="Quote"><file name="Packages.php" hash="f4856c7ddb605d8057a4ce2726ee4c55"/></dir><dir name="Rate"><file name="Result.php" hash="9a5982a06bc339f69a741cd142ed86c7"/></dir><dir name="Resource"><dir name="Attributeupdate"><file name="Collection.php" hash="9ac1acf4e1afed74d4fe8c88b9ba06b9"/></dir><file name="Attributeupdate.php" hash="0fc727f72ad1266b3575645c24dc90fa"/><dir name="Order"><dir name="Packages"><file name="Collection.php" hash="37a8a9936e4ccd405870b4bdc112d6f8"/></dir><file name="Packages.php" hash="6e00e6556c5e7b25ffbcd0411eb87e9d"/></dir><dir name="Quote"><dir name="Packages"><file name="Collection.php" hash="45293d05b079de5a9cdf13a0a4171b39"/></dir><file name="Packages.php" hash="a98c3648bd171ed77b289f821e12032a"/></dir><file name="Storage.php" hash="2f5f9b5a7422deced69f5df9f95f0149"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><file name="Rate.php" hash="f90dec32c4bcb1b7ee29ca3596942d70"/></dir></dir></dir><file name="Session.php" hash="6d5d017d8f1b8aeeff869ca6e005c8af"/><dir name="Source"><dir name="Freight"><file name="Freightclass.php" hash="2df1fa5cef3d64c20701d416ee7f9a56"/></dir><dir name="Validation"><file name="Result.php" hash="4318cc4232fd6aa24f603299dc060a66"/></dir></dir><dir name="Storage"><file name="Manager.php" hash="19a7613a55c66f7c3d4bd8529a6c8d87"/></dir><file name="Storage.php" hash="8523438e72510a0a7eb188402187383b"/><file name="Synchronize.php" hash="3fc77f7d298e52f9222dbd33a3d5c495"/></dir><file name="changelog.txt" hash="316cdc24426ad481ad5e7ca074f01212"/><dir name="controllers"><dir name="Adminhtml"><file name="ShqajaxController.php" hash="bf238c7a8f0e0f269ca12c5ff083f0c0"/><file name="ShqsynchronizeController.php" hash="bd2d2d10d7b8a55d8708e7be0fe4ff5b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ef30d556114e2f7eae48210162b80472"/><file name="config.xml" hash="dd6f6af6f1c984c426623fa0b13f91e8"/><file name="system.xml" hash="ad065e4241cbcebe0058bd425671e027"/></dir><dir name="sql"><dir name="shipperhq_shipper_setup"><file name="mysql4-install-0.0.10.php" hash="fa0617c03bfee8e117ae376d5e5dfe17"/><file name="mysql4-install-0.0.11.php" hash="98e5a874f60adee12da831c3a6ef488d"/><file name="mysql4-install-0.0.12.php" hash="9e3ef4c29d83febaff74399dd1f0cc91"/><file name="mysql4-install-0.0.13.php" hash="093df5f7b577c24ec7d81686aa1ef7d2"/><file name="mysql4-install-0.0.14.php" hash="6a46a227ac7b1a868252352f0e503c4a"/><file name="mysql4-install-0.0.15.php" hash="a270a571d929ec215c7d7c3d92259e6d"/><file name="mysql4-install-0.0.16.php" hash="8f1bc1254e0941db2662d3734f0124f3"/><file name="mysql4-install-0.0.17.php" hash="69470881a23aa23af723cfb676424d1a"/><file name="mysql4-install-0.0.18.php" hash="ad02ae013579ebfb571ca04cf1bd449f"/><file name="mysql4-install-0.0.19.php" hash="df6e3f3a2b11cacd6c30e78ec27120b4"/><file name="mysql4-install-0.0.20.php" hash="a95bd37a86cc383bfb6f6ffc0bdc53b2"/><file name="mysql4-install-0.0.21.php" hash="f8555e5d7ba9fbfb54258d38480f0766"/><file name="mysql4-install-0.0.22.php" hash="6dc64e38df396ae28e8c12e48a4fca14"/><file name="mysql4-install-0.0.23.php" hash="c09d0b920acd392bea7646565018643b"/><file name="mysql4-install-0.0.24.php" hash="bbe3bdd5df750629eec5e21e467d88c0"/><file name="mysql4-install-0.0.25.php" hash="a25f7704e8001be72dd55dcd1f681852"/><file name="mysql4-install-0.0.26.php" hash="cbdc4b509674438d6db842cb2830702b"/><file name="mysql4-install-0.0.27.php" hash="375c3f49209ce6d843af891e22fdfca4"/><file name="mysql4-install-0.0.28.php" hash="04c6c5b0cc40bb17d674959b9d1e6e1d"/><file name="mysql4-install-0.0.29.php" hash="0805c6bc54d77dbb562e5b4d57f5b42a"/><file name="mysql4-install-0.0.30.php" hash="29588d8b85f58e10e98646a290bb3bc4"/><file name="mysql4-install-0.0.31.php" hash="c61ab232f6b2558378883e633b8f06d2"/><file name="mysql4-install-0.0.32.php" hash="c61ab232f6b2558378883e633b8f06d2"/><file name="mysql4-install-0.0.33.php" hash="e9b3117360036b35153010d624df3222"/><file name="mysql4-install-0.0.34.php" hash="ecc6ede87fdf3848b58b1b2921ba2a0f"/><file name="mysql4-install-0.0.8.php" hash="32f338aac46f40fd5b494fcdfff4c2af"/><file name="mysql4-install-0.0.9.php" hash="35e480613ed20d01c9336191c82b3b52"/><file name="mysql4-upgrade-0.0.10-0.0.11.php" hash="dddddbd76a09c29a5c66d001c44875a8"/><file name="mysql4-upgrade-0.0.11-0.0.12.php" hash="68691b1aa419721185b7894b432a6fbc"/><file name="mysql4-upgrade-0.0.12-0.0.13.php" hash="52fdb7496189b23058d8d9eb7a207dd0"/><file name="mysql4-upgrade-0.0.13-0.0.14.php" hash="5d44ca4716c8c09b193c996113c10364"/><file name="mysql4-upgrade-0.0.14-0.0.15.php" hash="ff819b6264851da586137b4e06f96910"/><file name="mysql4-upgrade-0.0.15-0.0.16.php" hash="4cb72fe71080b33fca58af2f9a603686"/><file name="mysql4-upgrade-0.0.16-0.0.17.php" hash="4d465e6ce08c9c165d0037e7d1bb175f"/><file name="mysql4-upgrade-0.0.17-0.0.18.php" hash="bc287efe97d6dc7c7c259ece7fa7a99a"/><file name="mysql4-upgrade-0.0.18-0.0.19.php" hash="f4da98e326e1bb99dc997dc044e196b4"/><file name="mysql4-upgrade-0.0.19-0.0.20.php" hash="5363b535bd3e271e7ac77a784ce324f2"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="46b488056d65c651cdfb0ae5cfe38b8d"/><file name="mysql4-upgrade-0.0.20-0.0.21.php" hash="7e89ad55723df152fd34b47c37d61cee"/><file name="mysql4-upgrade-0.0.21-0.0.22.php" hash="d2dd4a70cc242235985b13097bfbc928"/><file name="mysql4-upgrade-0.0.22-0.0.23.php" hash="06116fffaf4ffa2d68eed20e5d02ae11"/><file name="mysql4-upgrade-0.0.23-0.0.24.php" hash="ca3e92947c6545bf5f0b96957ee5a4ab"/><file name="mysql4-upgrade-0.0.24-0.0.25.php" hash="1df7cd63d709640db0cda91248f1cc30"/><file name="mysql4-upgrade-0.0.25-0.0.26.php" hash="94adac7f508deb487e714d47a189c97f"/><file name="mysql4-upgrade-0.0.26-0.0.27.php" hash="b45b3ea8a9eb245e650fb45462a67ce9"/><file name="mysql4-upgrade-0.0.27-0.0.28.php" hash="605fdb4ec7840d574596f113ce021477"/><file name="mysql4-upgrade-0.0.28-0.0.29.php" hash="732dd1dbc1cc4cfe81638f5c9c2c84fc"/><file name="mysql4-upgrade-0.0.29-0.0.30.php" hash="20c5de6ac85c92049d043ccf07741c86"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="a8e259c10737f5fe60b76c7f292846c5"/><file name="mysql4-upgrade-0.0.30-0.0.31.php" hash="8848e4d05b53ab3d3da91442cdc79693"/><file name="mysql4-upgrade-0.0.31-0.0.32.php" hash="58e34abea2c3bb7b021efb1653e9a999"/><file name="mysql4-upgrade-0.0.32-0.0.33.php" hash="f42c6d91345530c2acea877e6ea9117e"/><file name="mysql4-upgrade-0.0.33-0.0.34.php" hash="baf184eb90a7a414a0c9a036f6ea9ac4"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="18d854af6943f37b9556017d93647e9f"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="c81d14178543d57ff75af01ae31683a4"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="bd2b6c9e4aef8b9cfda89f9a5d428265"/><file name="mysql4-upgrade-0.0.7-0.0.8.php" hash="55bc901aae3ff2ad9a0c9961c9f2d6b9"/><file name="mysql4-upgrade-0.0.8-0.0.9.php" hash="161bd7971bff62cb249fc5e8631d1674"/><file name="mysql4-upgrade-0.0.9-0.0.10.php" hash="63417ee4d41313682226525aa11db652"/></dir></dir></dir><dir name="ShipperTest"><dir name="Helper"><file name="Data.php" hash="23ca518832cfe928da0fe069da1deacd"/></dir><dir name="Test"><dir name="Model"><dir name="Carrier"><file name="Shippertest.php" hash="07e50b6c7255d3c134e77910562a4f8d"/><dir name="_data"><file name="ex-testGetQuotes.yaml" hash="6c1f1fd9c90c9dfff6e638e37db9462f"/><file name="fx-config.yaml" hash="5894a20423a95bb99c416e8d6736936e"/></dir></dir><dir name="Migration"><file name="Migration.php" hash="2044f30d71cc51485f425c94badede54"/></dir><dir name="Shipper"><file name="Shippertest.php" hash="3271357942303631c8c9e85732028cca"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="56a27533a8c0e77d62d1c7794b1b09ff"/></dir></dir></dir><dir name="Webshopapps"><dir name="Wsalogger"><dir name="Adminhtml"><dir name="Block"><dir name="Log"><dir name="Grid"><dir name="Renderer"><file name="Actions.php" hash="473872b8e0c6b55242a47ff77bd2248d"/></dir></dir><file name="Grid.php" hash="c69c4d94766ae37a2d9a51743c40ade3"/><file name="View.php" hash="0373fda90bb41844369ad18fac2146c7"/></dir><file name="Log.php" hash="54c644b5977ce506ca0dd0bd962e7589"/><dir name="Notification"><dir name="Grid"><dir name="Renderer"><file name="Code.php" hash="3b0dd6a7d11fe0520b36bb92e699ebbc"/><file name="Notice.php" hash="6b95f97727f126b5a674a6cb22176978"/><file name="Severity.php" hash="7f9b5985ce5b60c57a841192e3f29a4e"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Modules"><file name="DisableLogging.php" hash="7aae4ca58f704045267c9b556c2be3e6"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="783fe47d8bfc6d24c5fb73912d29c5bc"/><file name="Log.php" hash="47084ce5034469a32802b6674d9eeff7"/></dir><dir name="Model"><file name="Log.php" hash="ab6a7a9431aaf7d0cc90c46c5b494818"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="f86775cc279d3e2a84006309a991e197"/></dir><file name="Log.php" hash="d3bc2f0d28ae634a7aa7bc622fc5c7fa"/></dir><file name="Observer.php" hash="58c79f3b39fa2a6f14d9fc074be02a75"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Severities.php" hash="b0f96c4ebe133ae8dbdd762a5947ff6f"/></dir></dir></dir></dir><file name="changelog.txt" hash="130376ec2e3b4e290daa092e1178f00f"/><dir name="controllers"><dir name="Adminhtml"><file name="WsaloggerController.php" hash="eed6f300259745ad2fdb284ac5bd7d50"/></dir><file name="IndexController.php" hash="adac20244d34c93051807b65ca015f9d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="53378e5eb78f6c73eb00991976bb69bb"/><file name="config.xml" hash="98315ca9b8f69d05997e66c12a3dcf1e"/><file name="system.xml" hash="a5410b5eb9739f6a5222334ae2a3b7fc"/></dir><dir name="sql"><dir name="wsalogger_setup"><file name="mysql4-install-1.0.0.php" hash="32db82e8865ef799c4d4d64e7b4042e4"/><file name="mysql4-install-1.0.1.php" hash="386616525a4b4be6b2d94955e4f2ec81"/><file name="mysql4-install-1.0.2.php" hash="386616525a4b4be6b2d94955e4f2ec81"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="c0c3b4fd38f3ab92eab2b6fd0b556701"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="9f0c4f258368c9130e41f5731f27ed5b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="shipperhq"><file name="shipper.xml" hash="363cb64a61674d803ea03a3577fe1cee"/><file name="shipper_migration.xml" hash="6f1e05b87674005436742c2a0231d4a9"/></dir><file name="webshopapps_wsalogger.xml" hash="7bdcb195f5273ff1ece6ced0b56eaad2"/></dir><dir name="template"><dir name="shipperhq"><dir name="frontend"><dir name="js"><file name="bottom.phtml" hash="0995ca67eb260cf362a550a7a19f8fcb"/></dir><dir name="sales"><dir name="order"><dir name="create"><dir name="shipping_method"><file name="available.phtml" hash="6f38540339944c7e9355dc0078020ed3"/></dir></dir><dir name="view"><file name="info.phtml" hash="09264456fc3ae6904fe3b19fbcbdcf28"/></dir></dir></dir></dir><file name="migrate_extension.phtml" hash="3811ef77e76355adbb197495f737c168"/><dir name="shipper"><dir name="carrier"><file name="notify.phtml" hash="84b31cb7eaf14dc511d9dd818a5b8528"/></dir><dir name="catalog"><dir name="product"><dir name="edit"><file name="shipping.phtml" hash="a073e968b33f21e588a7b836d3d08122"/></dir></dir></dir><dir name="synchronize"><file name="notify.phtml" hash="ec3eb3d634e18d8a0cee0b7b87a26857"/></dir><dir name="system"><dir name="carrier"><file name="refreshcarriers.phtml" hash="d29c86d513c627236e90d50284d9ba10"/></dir></dir></dir></dir><dir name="webshopapps_wsalogger"><file name="grid.phtml" hash="2701b7834b1ce350a2e941e5d4d76ca6"/><file name="view.phtml" hash="ea079e0f9e00ebdb1180b1d5ab51af66"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="shipperhq"><dir name="catalog"><file name="shipresults.phtml" hash="fcc977996f280f3805ba6a81a4b73eed"/></dir><dir name="checkout"><dir name="cart"><dir name="rwd"><file name="shipping.phtml" hash="713a533bddc4108451a79075988ce2dd"/></dir><file name="shipping.phtml" hash="10ad5ed05c179b9ce8fb30b72ef9635b"/></dir><dir name="multishipping"><file name="overview.phtml" hash="508833ff506d4aaba2c02ab9f361e0bb"/><file name="shipping.phtml" hash="bc2c2e9fa04ac18f07e6719224a1825d"/></dir><dir name="onepage"><dir name="shipping_method"><file name="available.phtml" hash="5e624695c5df441c33e83dcd2f16aa4d"/><file name="comments.phtml" hash="9e68606e8a7da681c87fbe8948407973"/></dir></dir><dir name="onestepcheckout"><file name="pickup_review.phtml" hash="aa427bc3be1579630598cd08fc2765dd"/><file name="shipping_method_osc_shq.phtml" hash="5896adeeb4fc0a0796bd870465fd6d6e"/><file name="shipping_method_osc_shq_radio.phtml" hash="109c9f6b9d3b241fdd8dd5a5f0135d14"/></dir></dir><dir name="js"><file name="bottom.phtml" hash="0995ca67eb260cf362a550a7a19f8fcb"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shipperhq_Frontend.xml" hash="0ea0c10aaf125db468f22f7465fac76f"/><file name="Shipperhq_Migration.xml" hash="38bf92228885ea2d3e5b78655014eae2"/><file name="Shipperhq_Shipper.xml" hash="c219d3092fd0d15c7bd5c47aa3de1fbc"/><file name="Webshopapps_Wsalogger.xml" hash="199d449ef7cf012fcfc32357de430cfd"/></dir></target><target name="magelib"><dir name="ShipperHQ"><file name="CHANGELOG" hash="0987223093a0f7203a5b184953061048"/><dir name="Checkout"><file name="Cart.php" hash="8c9a945750c6f57936449aa6169abde8"/><file name="Item.php" hash="de5848a1887084f36332638898ad555d"/><file name="ItemAttribute.php" hash="ceae511d7d1d62b2821cdf5052c55109"/></dir><dir name="Shipping"><file name="Accessorials.php" hash="48f96d92236e636b2596b07157c907eb"/><file name="Address.php" hash="a7b77d3ef89dd3c879aa5d317b3f730a"/><file name="SelectedOptions.php" hash="1d248c30d33e8487ee975b4bfd3a435c"/></dir><dir name="User"><file name="Credentials.php" hash="db3331cbbdf02b690e5b0efbf211a21f"/><file name="SiteDetails.php" hash="6d52462b7021f1c5a60d328d5ae345cc"/></dir><dir name="Validation"><file name="Address.php" hash="5d1efe3091d0516447a5d58348677b67"/></dir><dir name="WS"><dir name="Client"><file name="WebServiceClient.php" hash="233ea2297b1ee373b1efd7b0d785c420"/></dir><dir name="Request"><file name="AbstractWebServiceRequest.php" hash="a8eb81c9a708ac54f79d33750f3c4ff2"/><dir name="Rate"><file name="CustomerDetails.php" hash="adf5e4e7c2e05205a4e383af344f1724"/><file name="CustomerGroup.php" hash="799d15d8603f35cda92084fbe638cd83"/><file name="InfoRequest.php" hash="002f93754191f8fb20285ba0a34c836b"/><file name="RateRequest.php" hash="38ef8eb23eeb462c2ad8441dbb0669d7"/><file name="ShipDetails.php" hash="128e2060216075fffb123c4ad9e0fdb3"/><file name="ShipmentAddonRequest.php" hash="f64a3a36bc783b7fd4f3a894bdda361d"/><file name="ShipmentCustomerDetails.php" hash="5b67a971d867d0121de0317746e8c6dd"/><file name="ShipmentRequest.php" hash="b2db65e1b398b258461ed18c83be2761"/></dir><dir name="UPS"><dir name="registration"><file name="UPSRegistrationRequest.php" hash="d470c6a7cbc94e21e41ab88dbc3558d6"/></dir></dir><dir name="Validation"><file name="Request.php" hash="5484da6fb582d854a5383a1b2aed4d06"/></dir><file name="WebServiceRequest.php" hash="e342ae20cee6a2799adfcdfa36688e2c"/></dir><dir name="Response"><file name="AbstractWebServiceResponse.php" hash="fcfccb9715bb10174f6d6fd41daf0aa4"/><file name="ErrorMessages.php" hash="53b6dce12e4024c1e727a8aefb5cddca"/><file name="ResponseSummary.php" hash="98af5f450f8700308b3384fda2c7db21"/><dir name="UPS"><dir name="Registration"><file name="UPSRegistrationResponse.php" hash="7776f2a4adb472ace875a8c470a6b06a"/></dir></dir><file name="WebServiceError.php" hash="ed4e0051391c6e9cb047236273c4e048"/><file name="WebServiceResponse.php" hash="6a69713d0843cfc8dfb166b20d2d8a9f"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Shipperhq_Shipper.csv" hash="ba037cbb5dfe5ead2edf805a62ecbfbd"/><dir name="template"><dir name="email"><file name="webshopapps_log_email.html" hash="c85b0d27c9ecdb9c227d99cd0aaa86fb"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="shipperhq"><dir name="css"><file name="calendarbase.css" hash="720271892278dde8fec497b4a6964a90"/><file name="shipperhq_migration.css" hash="d7e6eb30477722bfa10fc901875a192e"/><file name="storepickup.css" hash="edfdcff01ec619a3b53e492e7c45b9d2"/></dir><dir name="images"><file name="shq-logo.png" hash="45c4d0cc3836bf59db50d4c148cde600"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="shipperhq"><file name="calendarbase.css" hash="720271892278dde8fec497b4a6964a90"/><file name="storepickup.css" hash="edfdcff01ec619a3b53e492e7c45b9d2"/></dir></dir><dir name="images"><dir name="shipperhq"><file name="calendar-blk.svg" hash="f260d467196ecb3cac5e680d3d6f0e61"/><file name="calendar-wht.svg" hash="2f3b38e806a86625bb6927267787ac24"/><file name="clock-blk.svg" hash="de67ce7177bde74064115d3910a0df16"/><file name="clock-wht.svg" hash="e83c3d21bcd8f15ae9bda45a7d354d90"/><file name="location-blk.svg" hash="d878740f55fa39f06aad243b0cb3b95a"/><file name="location-wht.svg" hash="86bce49b1c43baae00add73d2313392f"/><file name="tooltip.jpg" hash="c93990a2e5705f4771c8e87b14643a74"/><file name="ups.gif" hash="0654a9638a3b7787f35495ad17dc7363"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="shipperhq"><file name="jquery-loader.js" hash="75ec37606883cf37f0bd15b1ffaf1f13"/></dir></dir></target></contents>
|
68 |
<compatible/>
|
69 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
70 |
</package>
|
skin/adminhtml/default/default/shipperhq/css/calendarbase.css
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Old Calendar Styles */
|
2 |
+
|
3 |
+
.left {float:left;}
|
4 |
+
|
5 |
+
.right {float: right;}
|
6 |
+
|
7 |
+
#co-shipping-method-form .sp-methods dd .location_label label {
|
8 |
+
min-width: 100px;
|
9 |
+
background: none !important;
|
10 |
+
padding: 0;
|
11 |
+
}
|
12 |
+
|
13 |
+
.location.left {width:100%;}
|
14 |
+
|
15 |
+
.location.left .input-box {
|
16 |
+
margin-bottom: 8px;
|
17 |
+
float: none !important;
|
18 |
+
display: block !important;
|
19 |
+
}
|
20 |
+
|
21 |
+
.location_label {display:inline-block;}
|
22 |
+
|
23 |
+
.location label {margin-right:10px;}
|
24 |
+
|
25 |
+
.overlay-container {
|
26 |
+
position:relative;
|
27 |
+
}
|
28 |
+
|
29 |
+
.overlay-calendar {
|
30 |
+
position:absolute;
|
31 |
+
width:19.2em;
|
32 |
+
visibility: hidden;
|
33 |
+
z-index: 101;
|
34 |
+
}
|
35 |
+
|
36 |
+
.overlay-text {
|
37 |
+
position:relative;
|
38 |
+
top:45%;
|
39 |
+
left:15%;
|
40 |
+
font-size:16px;
|
41 |
+
font-weight:bold;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
/* Calendar Styles V2 */
|
46 |
+
.opc .shq-custom-method select,
|
47 |
+
#onestepcheckout-form .shq-custom-method select,
|
48 |
+
.multiple-checkout .shq-custom-method select {max-width: 100% !important; width: 100% !important; }
|
49 |
+
|
50 |
+
.opc .shq-custom-method select,
|
51 |
+
.opc .shq-custom-method input,
|
52 |
+
#onestepcheckout-form .shq-custom-method select,
|
53 |
+
#onestepcheckout-form .shq-custom-method input,
|
54 |
+
.multiple-checkout .shq-custom-method select,
|
55 |
+
.multiple-checkout .shq-custom-method input {
|
56 |
+
font-size: 12px !important;
|
57 |
+
height: 30px !important;
|
58 |
+
border: 1px solid #ddd !important;
|
59 |
+
max-width: 100%;
|
60 |
+
float: left;
|
61 |
+
color:#555;
|
62 |
+
line-height: 30px;
|
63 |
+
padding-left: 5px;
|
64 |
+
padding-right: 5px;
|
65 |
+
}
|
66 |
+
|
67 |
+
.calendar-blk, .clock-blk, .location-blk {fill:#555;}
|
68 |
+
|
69 |
+
.shq-custom-method {
|
70 |
+
width: 100%;
|
71 |
+
max-width: 480px;
|
72 |
+
display: inline-block;
|
73 |
+
color:#555 !important;
|
74 |
+
}
|
75 |
+
.shq-optn-50l,
|
76 |
+
.shq-optn-50r,
|
77 |
+
.shq-optn-100 {
|
78 |
+
float: left;
|
79 |
+
margin-bottom: 20px;
|
80 |
+
font-size: 12px;
|
81 |
+
}
|
82 |
+
|
83 |
+
.shq-optn-50l {width: 46%; padding-right: 4%; box-sizing: content-box;}
|
84 |
+
.shq-optn-50r {width: 46%; padding-left: 4%; box-sizing: content-box;}
|
85 |
+
.shq-optn-100 {width: 100%;}
|
86 |
+
|
87 |
+
#onestepcheckout-form .shq-optn-50l,
|
88 |
+
.multiple-checkout .shq-optn-50l {width: 100%;padding-right:0;}
|
89 |
+
|
90 |
+
#onestepcheckout-form .shq-optn-50r,
|
91 |
+
.multiple-checkout .shq-optn-50r {width: 100%;padding-left:0;}
|
92 |
+
|
93 |
+
.shq-custom-method label.shq-title,
|
94 |
+
.shq-custom-method label.shq-input {
|
95 |
+
padding:0 !important;
|
96 |
+
background: none !important;
|
97 |
+
}
|
98 |
+
.shq-custom-method label.shq-input input {width: auto; float: left;}
|
99 |
+
.shq-custom-method label.shq-title:hover,
|
100 |
+
.shq-custom-method label.shq-input:hover {
|
101 |
+
background:none !important;
|
102 |
+
}
|
103 |
+
|
104 |
+
.shq-title,
|
105 |
+
.shq-input {
|
106 |
+
float: left;
|
107 |
+
width:100%;
|
108 |
+
font-weight: normal !important;
|
109 |
+
color: #555 !important;
|
110 |
+
font-size: 12px;
|
111 |
+
}
|
112 |
+
|
113 |
+
.shq-input {margin-top:5px;}
|
114 |
+
.shq-input .shq-input {margin-top:0;}
|
115 |
+
.shq-input .shq-input .shq-input {margin-top:0;}
|
116 |
+
|
117 |
+
.shq-ico-calendar {
|
118 |
+
background: transparent url('../../images/shipperhq/calendar-blk.svg') center center no-repeat;
|
119 |
+
}
|
120 |
+
|
121 |
+
.shq-ico-clock {
|
122 |
+
background: transparent url('../../images/shipperhq/clock-blk.svg') center center no-repeat;
|
123 |
+
}
|
124 |
+
|
125 |
+
.shq-ico-r {
|
126 |
+
margin: 8px 0 0 5px !important;
|
127 |
+
}
|
128 |
+
|
129 |
+
@media only screen and (max-width: 480px) {
|
130 |
+
|
131 |
+
.shq-optn-50l {width: 100%; padding-right: 0;}
|
132 |
+
.shq-optn-50r {width: 100%; padding-left: 0;}
|
133 |
+
}
|
skin/adminhtml/default/default/shipperhq/css/storepickup.css
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Old Pickup Styles */
|
2 |
+
.map-top-border {
|
3 |
+
border-top: 1px solid #efefef;
|
4 |
+
padding-top: 15px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.map_canvas {
|
8 |
+
float: right;
|
9 |
+
width: 48%;
|
10 |
+
height: 180px;
|
11 |
+
padding: 0 0 0 2%;
|
12 |
+
}
|
13 |
+
|
14 |
+
.map_address {
|
15 |
+
float: left;
|
16 |
+
width: 50%;
|
17 |
+
font-size: 12px;
|
18 |
+
}
|
19 |
+
|
20 |
+
#onestepcheckout-form .map_canvas,
|
21 |
+
.multiple-checkout .map_canvas {
|
22 |
+
float: right;
|
23 |
+
width: 100%;
|
24 |
+
height: 180px;
|
25 |
+
padding: 0;
|
26 |
+
margin-top:10px;
|
27 |
+
}
|
28 |
+
#onestepcheckout-form .map_address,
|
29 |
+
.multiple-checkout .map_address {
|
30 |
+
float: left;
|
31 |
+
width: 100%;
|
32 |
+
}
|
33 |
+
|
34 |
+
.left {float:left;}
|
35 |
+
|
36 |
+
.right {float: right;}
|
37 |
+
|
38 |
+
#co-shipping-method-form .sp-methods dd .location_label label {
|
39 |
+
min-width: 100px;
|
40 |
+
background: none !important;
|
41 |
+
padding: 0;
|
42 |
+
}
|
43 |
+
|
44 |
+
/*#opc-co-shipping-method-form .sp-methods dd .location_label label,*/
|
45 |
+
|
46 |
+
.location.left {width:100%;}
|
47 |
+
|
48 |
+
.location.left .input-box {
|
49 |
+
margin-bottom: 8px;
|
50 |
+
float: none !important;
|
51 |
+
display: block !important;
|
52 |
+
}
|
53 |
+
|
54 |
+
.location_label {display:inline-block;}
|
55 |
+
|
56 |
+
.location label {
|
57 |
+
margin-right:10px;
|
58 |
+
}
|
59 |
+
|
60 |
+
.location_address {
|
61 |
+
width: 300px;
|
62 |
+
}
|
63 |
+
|
64 |
+
.location .ui-datepicker-trigger {
|
65 |
+
display: inline;
|
66 |
+
padding-left: 5px;
|
67 |
+
}
|
68 |
+
|
69 |
+
.overlay-container {position:relative;}
|
70 |
+
|
71 |
+
.overlay-bg {
|
72 |
+
position:absolute;
|
73 |
+
width:19.2em;
|
74 |
+
height:195px;
|
75 |
+
background-color:transparent;
|
76 |
+
visibility: hidden;
|
77 |
+
z-index: 101;
|
78 |
+
}
|
79 |
+
|
80 |
+
.overlay-pickup {
|
81 |
+
position:absolute;
|
82 |
+
width:19.2em;
|
83 |
+
visibility: hidden;
|
84 |
+
z-index: 101;
|
85 |
+
}
|
86 |
+
|
87 |
+
.overlay-text {
|
88 |
+
position:relative;
|
89 |
+
top:45%;
|
90 |
+
left:15%;
|
91 |
+
font-size:16px;
|
92 |
+
font-weight:bold;
|
93 |
+
}
|
94 |
+
|
95 |
+
.collapsable_heading {
|
96 |
+
cursor: pointer;
|
97 |
+
color: #696;
|
98 |
+
font-weight:bold;
|
99 |
+
background-image:url(../../../../default/default/images/i_desc_arrow.gif);
|
100 |
+
background-repeat:no-repeat;
|
101 |
+
text-indent:23px;
|
102 |
+
background-position:4px 8px;
|
103 |
+
}
|
104 |
+
.open {
|
105 |
+
background-image:url(../../../../default/default/images/i_asc_arrow.gif);
|
106 |
+
background-repeat:no-repeat;
|
107 |
+
text-indent:23px;
|
108 |
+
background-position:4px 8px;
|
109 |
+
);
|
110 |
+
}
|
111 |
+
|
112 |
+
.ups_logo {
|
113 |
+
height:36px;
|
114 |
+
width:30px;
|
115 |
+
padding: 10px 10px;
|
116 |
+
}
|
117 |
+
|
118 |
+
.trademark {font-size:9px; /*Font Size of Trademark Text*/}
|
119 |
+
|
120 |
+
.disclaimer {font-size:9px; /*Font Size of Trademark Text*/}
|
121 |
+
|
122 |
+
.location-map {margin: 12px 0;}
|
123 |
+
|
124 |
+
|
125 |
+
/* New Pickup Styles */
|
126 |
+
.opc .shq-custom-method select,
|
127 |
+
#onestepcheckout-form .shq-custom-method select,
|
128 |
+
.multiple-checkout .shq-custom-method select {max-width: 100% !important; width: 100% !important; }
|
129 |
+
|
130 |
+
.opc .shq-custom-method select,
|
131 |
+
.opc .shq-custom-method input,
|
132 |
+
#onestepcheckout-form .shq-custom-method select,
|
133 |
+
#onestepcheckout-form .shq-custom-method input,
|
134 |
+
.multiple-checkout .shq-custom-method select,
|
135 |
+
.multiple-checkout .shq-custom-method input {
|
136 |
+
font-size: 12px !important;
|
137 |
+
height: 30px !important;
|
138 |
+
border: 1px solid #ddd !important;
|
139 |
+
max-width: 100%;
|
140 |
+
float: left;
|
141 |
+
color:#555;
|
142 |
+
line-height: 30px;
|
143 |
+
padding-left: 5px;
|
144 |
+
padding-right: 5px;
|
145 |
+
}
|
146 |
+
|
147 |
+
.calendar-blk, .clock-blk, .location-blk {fill:#555;}
|
148 |
+
|
149 |
+
.shq-custom-method {
|
150 |
+
width: 100%;
|
151 |
+
max-width: 480px;
|
152 |
+
display: inline-block;
|
153 |
+
color:#555 !important;
|
154 |
+
margin-top: 10px;
|
155 |
+
}
|
156 |
+
.shq-optn-50l,
|
157 |
+
.shq-optn-50r,
|
158 |
+
.shq-optn-100 {
|
159 |
+
float: left;
|
160 |
+
margin-bottom: 20px;
|
161 |
+
font-size: 12px;
|
162 |
+
}
|
163 |
+
|
164 |
+
.shq-optn-50l {width: 46%; padding-right: 4%; box-sizing: content-box;}
|
165 |
+
.shq-optn-50r {width: 46%; padding-left: 4%; box-sizing: content-box;}
|
166 |
+
.shq-optn-100 {width: 100%;}
|
167 |
+
|
168 |
+
#onestepcheckout-form .shq-optn-50l,
|
169 |
+
.multiple-checkout .shq-optn-50l {width: 100%;padding-right:0;}
|
170 |
+
|
171 |
+
#onestepcheckout-form .shq-optn-50r,
|
172 |
+
.multiple-checkout .shq-optn-50r {width: 100%;padding-left:0;}
|
173 |
+
|
174 |
+
.shq-custom-method label.shq-title,
|
175 |
+
.shq-custom-method label.shq-input {
|
176 |
+
padding:0 !important;
|
177 |
+
background: none !important;
|
178 |
+
}
|
179 |
+
.shq-custom-method label.shq-input input {width: auto; float: left;}
|
180 |
+
.shq-custom-method label.shq-title:hover,
|
181 |
+
.shq-custom-method label.shq-input:hover {
|
182 |
+
background:none !important;
|
183 |
+
}
|
184 |
+
|
185 |
+
.shq-title,
|
186 |
+
.shq-input {
|
187 |
+
float: left;
|
188 |
+
width:100%;
|
189 |
+
font-weight: normal !important;
|
190 |
+
color: #555 !important;
|
191 |
+
font-size: 12px;
|
192 |
+
}
|
193 |
+
|
194 |
+
.shq-input {margin-top:5px;}
|
195 |
+
.shq-input .shq-input {margin-top:0;}
|
196 |
+
.shq-input .shq-input .shq-input {margin-top:0;}
|
197 |
+
|
198 |
+
.shq-ico-location,
|
199 |
+
.shq-ico-calendar,
|
200 |
+
.shq-ico-clock {
|
201 |
+
width: 14px;
|
202 |
+
height: 14px;
|
203 |
+
float: left;
|
204 |
+
display: inline-block;
|
205 |
+
margin: 0 5px 0 0;
|
206 |
+
background-size: 14px 14px;
|
207 |
+
}
|
208 |
+
.shq-ico-calendar {
|
209 |
+
background: transparent url('../../images/shipperhq/calendar-blk.svg') center center no-repeat;
|
210 |
+
}
|
211 |
+
|
212 |
+
.shq-ico-clock {
|
213 |
+
background: transparent url('../../images/shipperhq/clock-blk.svg') center center no-repeat;
|
214 |
+
}
|
215 |
+
|
216 |
+
.shq-ico-location {
|
217 |
+
background: transparent url('../../images/shipperhq/location-blk.svg') center center no-repeat;
|
218 |
+
}
|
219 |
+
|
220 |
+
.shq-ico-r {
|
221 |
+
margin: 8px 0 0 5px !important;
|
222 |
+
}
|
223 |
+
.shq-map-insert {
|
224 |
+
position: relative;
|
225 |
+
width: 100%;
|
226 |
+
height: 100%;
|
227 |
+
overflow: hidden;
|
228 |
+
}
|
229 |
+
shq-map-popup {
|
230 |
+
width: 600px;
|
231 |
+
height: 400px;
|
232 |
+
}
|
233 |
+
|
234 |
+
@media only screen and (max-width: 480px) {
|
235 |
+
|
236 |
+
.shq-optn-50l {width: 100%; padding-right: 0;}
|
237 |
+
.shq-optn-50r {width: 100%; padding-left: 0;}
|
238 |
+
|
239 |
+
.map_canvas {
|
240 |
+
float: right;
|
241 |
+
width: 100%;
|
242 |
+
height: 180px;
|
243 |
+
padding: 0;
|
244 |
+
margin-top:10px;
|
245 |
+
}
|
246 |
+
|
247 |
+
.map_address {
|
248 |
+
float: left;
|
249 |
+
width: 100%;
|
250 |
+
}
|
251 |
+
|
252 |
+
}
|
skin/frontend/base/default/css/shipperhq/calendarbase.css
CHANGED
@@ -1,18 +1,39 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
position:relative;
|
4 |
}
|
5 |
|
6 |
-
.overlay-calendar
|
7 |
-
{
|
8 |
position:absolute;
|
9 |
width:19.2em;
|
10 |
visibility: hidden;
|
11 |
z-index: 101;
|
12 |
}
|
13 |
|
14 |
-
.overlay-text
|
15 |
-
{
|
16 |
position:relative;
|
17 |
top:45%;
|
18 |
left:15%;
|
@@ -20,9 +41,93 @@
|
|
20 |
font-weight:bold;
|
21 |
}
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Old Calendar Styles */
|
2 |
+
|
3 |
+
.left {float:left;}
|
4 |
+
|
5 |
+
.right {float: right;}
|
6 |
+
|
7 |
+
#co-shipping-method-form .sp-methods dd .location_label label {
|
8 |
+
min-width: 100px;
|
9 |
+
background: none !important;
|
10 |
+
padding: 0;
|
11 |
+
}
|
12 |
+
|
13 |
+
.location.left {width:100%;}
|
14 |
+
|
15 |
+
.location.left .input-box {
|
16 |
+
margin-bottom: 8px;
|
17 |
+
float: none !important;
|
18 |
+
display: block !important;
|
19 |
+
}
|
20 |
+
|
21 |
+
.location_label {display:inline-block;}
|
22 |
+
|
23 |
+
.location label {margin-right:10px;}
|
24 |
+
|
25 |
+
.overlay-container {
|
26 |
position:relative;
|
27 |
}
|
28 |
|
29 |
+
.overlay-calendar {
|
|
|
30 |
position:absolute;
|
31 |
width:19.2em;
|
32 |
visibility: hidden;
|
33 |
z-index: 101;
|
34 |
}
|
35 |
|
36 |
+
.overlay-text {
|
|
|
37 |
position:relative;
|
38 |
top:45%;
|
39 |
left:15%;
|
41 |
font-weight:bold;
|
42 |
}
|
43 |
|
44 |
+
|
45 |
+
/* Calendar Styles V2 */
|
46 |
+
.opc .shq-custom-method select,
|
47 |
+
#onestepcheckout-form .shq-custom-method select,
|
48 |
+
.multiple-checkout .shq-custom-method select {max-width: 100% !important; width: 100% !important; }
|
49 |
+
|
50 |
+
.opc .shq-custom-method select,
|
51 |
+
.opc .shq-custom-method input,
|
52 |
+
#onestepcheckout-form .shq-custom-method select,
|
53 |
+
#onestepcheckout-form .shq-custom-method input,
|
54 |
+
.multiple-checkout .shq-custom-method select,
|
55 |
+
.multiple-checkout .shq-custom-method input {
|
56 |
+
font-size: 12px !important;
|
57 |
+
height: 30px !important;
|
58 |
+
border: 1px solid #ddd !important;
|
59 |
+
max-width: 100%;
|
60 |
+
float: left;
|
61 |
+
color:#555;
|
62 |
+
line-height: 30px;
|
63 |
+
padding-left: 5px;
|
64 |
+
padding-right: 5px;
|
65 |
+
}
|
66 |
+
|
67 |
+
.calendar-blk, .clock-blk, .location-blk {fill:#555;}
|
68 |
+
|
69 |
+
.shq-custom-method {
|
70 |
+
width: 100%;
|
71 |
+
max-width: 480px;
|
72 |
+
display: inline-block;
|
73 |
+
color:#555 !important;
|
74 |
+
}
|
75 |
+
.shq-optn-50l,
|
76 |
+
.shq-optn-50r,
|
77 |
+
.shq-optn-100 {
|
78 |
+
float: left;
|
79 |
+
margin-bottom: 20px;
|
80 |
+
font-size: 12px;
|
81 |
+
}
|
82 |
+
|
83 |
+
.shq-optn-50l {width: 46%; padding-right: 4%; box-sizing: content-box;}
|
84 |
+
.shq-optn-50r {width: 46%; padding-left: 4%; box-sizing: content-box;}
|
85 |
+
.shq-optn-100 {width: 100%;}
|
86 |
+
|
87 |
+
#onestepcheckout-form .shq-optn-50l,
|
88 |
+
.multiple-checkout .shq-optn-50l {width: 100%;padding-right:0;}
|
89 |
+
|
90 |
+
#onestepcheckout-form .shq-optn-50r,
|
91 |
+
.multiple-checkout .shq-optn-50r {width: 100%;padding-left:0;}
|
92 |
+
|
93 |
+
.shq-custom-method label.shq-title,
|
94 |
+
.shq-custom-method label.shq-input {
|
95 |
+
padding:0 !important;
|
96 |
+
background: none !important;
|
97 |
+
}
|
98 |
+
.shq-custom-method label.shq-input input {width: auto; float: left;}
|
99 |
+
.shq-custom-method label.shq-title:hover,
|
100 |
+
.shq-custom-method label.shq-input:hover {
|
101 |
+
background:none !important;
|
102 |
+
}
|
103 |
+
|
104 |
+
.shq-title,
|
105 |
+
.shq-input {
|
106 |
+
float: left;
|
107 |
+
width:100%;
|
108 |
+
font-weight: normal !important;
|
109 |
+
color: #555 !important;
|
110 |
+
font-size: 12px;
|
111 |
+
}
|
112 |
+
|
113 |
+
.shq-input {margin-top:5px;}
|
114 |
+
.shq-input .shq-input {margin-top:0;}
|
115 |
+
.shq-input .shq-input .shq-input {margin-top:0;}
|
116 |
+
|
117 |
+
.shq-ico-calendar {
|
118 |
+
background: transparent url('../../images/shipperhq/calendar-blk.svg') center center no-repeat;
|
119 |
+
}
|
120 |
+
|
121 |
+
.shq-ico-clock {
|
122 |
+
background: transparent url('../../images/shipperhq/clock-blk.svg') center center no-repeat;
|
123 |
+
}
|
124 |
+
|
125 |
+
.shq-ico-r {
|
126 |
+
margin: 8px 0 0 5px !important;
|
127 |
+
}
|
128 |
+
|
129 |
+
@media only screen and (max-width: 480px) {
|
130 |
+
|
131 |
+
.shq-optn-50l {width: 100%; padding-right: 0;}
|
132 |
+
.shq-optn-50r {width: 100%; padding-left: 0;}
|
133 |
+
}
|
skin/frontend/base/default/css/shipperhq/storepickup.css
CHANGED
@@ -1,94 +1,74 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
.onestepcheckout-shipping-method-block .map_canvas {
|
6 |
-
width: 218px;
|
7 |
-
height: 150px;
|
8 |
-
padding: 0px 0px 0px 5px;
|
9 |
-
}
|
10 |
-
|
11 |
-
.box-content .location-select {
|
12 |
-
width: 229px;
|
13 |
-
}
|
14 |
-
|
15 |
-
.box-content .map_canvas {
|
16 |
-
width: 221px;
|
17 |
-
height: 150px;
|
18 |
-
padding: 0px 0px 0px 5px;
|
19 |
}
|
20 |
|
21 |
.map_canvas {
|
22 |
float: right;
|
23 |
-
width:
|
24 |
-
height:
|
25 |
-
padding:
|
26 |
}
|
27 |
|
28 |
-
.
|
29 |
-
|
30 |
-
|
|
|
31 |
}
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
.
|
39 |
-
width: 140px;
|
40 |
-
}
|
41 |
|
42 |
-
.
|
43 |
-
width: 140px;
|
44 |
-
}
|
45 |
|
46 |
-
.
|
47 |
-
width:
|
|
|
|
|
48 |
}
|
49 |
|
|
|
50 |
|
51 |
-
.
|
52 |
|
53 |
-
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
.
|
56 |
-
float:left;
|
57 |
-
}
|
58 |
-
.right {
|
59 |
-
float: right;
|
60 |
-
}
|
61 |
-
.outer {
|
62 |
-
overflow: hidden;
|
63 |
-
}
|
64 |
-
.location {
|
65 |
-
padding: 2px 5px;
|
66 |
-
}
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
padding-left: 10px;
|
71 |
}
|
72 |
|
73 |
-
.
|
74 |
-
|
75 |
}
|
76 |
|
77 |
.location .ui-datepicker-trigger {
|
78 |
display: inline;
|
79 |
padding-left: 5px;
|
80 |
-
font-size:20px;
|
81 |
-
height: 25px;
|
82 |
-
width: 25px;
|
83 |
}
|
84 |
|
85 |
-
.overlay-container
|
86 |
-
{
|
87 |
-
position:relative;
|
88 |
-
}
|
89 |
|
90 |
-
.overlay-bg
|
91 |
-
{
|
92 |
position:absolute;
|
93 |
width:19.2em;
|
94 |
height:195px;
|
@@ -97,16 +77,14 @@
|
|
97 |
z-index: 101;
|
98 |
}
|
99 |
|
100 |
-
.overlay-pickup
|
101 |
-
{
|
102 |
position:absolute;
|
103 |
width:19.2em;
|
104 |
visibility: hidden;
|
105 |
z-index: 101;
|
106 |
}
|
107 |
|
108 |
-
.overlay-text
|
109 |
-
{
|
110 |
position:relative;
|
111 |
top:45%;
|
112 |
left:15%;
|
@@ -130,21 +108,145 @@
|
|
130 |
background-position:4px 8px;
|
131 |
);
|
132 |
}
|
133 |
-
.trademark
|
134 |
-
{
|
135 |
-
font-size:9px; /*Font Size of Trademark Text*/
|
136 |
-
}
|
137 |
|
138 |
-
.ups_logo
|
139 |
-
{
|
140 |
height:36px;
|
141 |
width:30px;
|
142 |
padding: 10px 10px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
|
146 |
-
.
|
147 |
-
{
|
148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Old Pickup Styles */
|
2 |
+
.map-top-border {
|
3 |
+
border-top: 1px solid #efefef;
|
4 |
+
padding-top: 15px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
|
7 |
.map_canvas {
|
8 |
float: right;
|
9 |
+
width: 48%;
|
10 |
+
height: 180px;
|
11 |
+
padding: 0 0 0 2%;
|
12 |
}
|
13 |
|
14 |
+
.map_address {
|
15 |
+
float: left;
|
16 |
+
width: 50%;
|
17 |
+
font-size: 12px;
|
18 |
}
|
19 |
|
20 |
+
#onestepcheckout-form .map_canvas,
|
21 |
+
.multiple-checkout .map_canvas {
|
22 |
+
float: right;
|
23 |
+
width: 100%;
|
24 |
+
height: 180px;
|
25 |
+
padding: 0;
|
26 |
+
margin-top:10px;
|
27 |
+
}
|
28 |
+
#onestepcheckout-form .map_address,
|
29 |
+
.multiple-checkout .map_address {
|
30 |
+
float: left;
|
31 |
+
width: 100%;
|
32 |
+
}
|
33 |
|
34 |
+
.left {float:left;}
|
|
|
|
|
35 |
|
36 |
+
.right {float: right;}
|
|
|
|
|
37 |
|
38 |
+
#co-shipping-method-form .sp-methods dd .location_label label {
|
39 |
+
min-width: 100px;
|
40 |
+
background: none !important;
|
41 |
+
padding: 0;
|
42 |
}
|
43 |
|
44 |
+
/*#opc-co-shipping-method-form .sp-methods dd .location_label label,*/
|
45 |
|
46 |
+
.location.left {width:100%;}
|
47 |
|
48 |
+
.location.left .input-box {
|
49 |
+
margin-bottom: 8px;
|
50 |
+
float: none !important;
|
51 |
+
display: block !important;
|
52 |
+
}
|
53 |
|
54 |
+
.location_label {display:inline-block;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
+
.location label {
|
57 |
+
margin-right:10px;
|
|
|
58 |
}
|
59 |
|
60 |
+
.location_address {
|
61 |
+
width: 300px;
|
62 |
}
|
63 |
|
64 |
.location .ui-datepicker-trigger {
|
65 |
display: inline;
|
66 |
padding-left: 5px;
|
|
|
|
|
|
|
67 |
}
|
68 |
|
69 |
+
.overlay-container {position:relative;}
|
|
|
|
|
|
|
70 |
|
71 |
+
.overlay-bg {
|
|
|
72 |
position:absolute;
|
73 |
width:19.2em;
|
74 |
height:195px;
|
77 |
z-index: 101;
|
78 |
}
|
79 |
|
80 |
+
.overlay-pickup {
|
|
|
81 |
position:absolute;
|
82 |
width:19.2em;
|
83 |
visibility: hidden;
|
84 |
z-index: 101;
|
85 |
}
|
86 |
|
87 |
+
.overlay-text {
|
|
|
88 |
position:relative;
|
89 |
top:45%;
|
90 |
left:15%;
|
108 |
background-position:4px 8px;
|
109 |
);
|
110 |
}
|
|
|
|
|
|
|
|
|
111 |
|
112 |
+
.ups_logo {
|
|
|
113 |
height:36px;
|
114 |
width:30px;
|
115 |
padding: 10px 10px;
|
116 |
+
}
|
117 |
+
|
118 |
+
.trademark {font-size:9px; /*Font Size of Trademark Text*/}
|
119 |
+
|
120 |
+
.disclaimer {font-size:9px; /*Font Size of Trademark Text*/}
|
121 |
+
|
122 |
+
.location-map {margin: 12px 0;}
|
123 |
+
|
124 |
|
125 |
+
/* New Pickup Styles */
|
126 |
+
.opc .shq-custom-method select,
|
127 |
+
#onestepcheckout-form .shq-custom-method select,
|
128 |
+
.multiple-checkout .shq-custom-method select {max-width: 100% !important; width: 100% !important; }
|
129 |
+
|
130 |
+
.opc .shq-custom-method select,
|
131 |
+
.opc .shq-custom-method input,
|
132 |
+
#onestepcheckout-form .shq-custom-method select,
|
133 |
+
#onestepcheckout-form .shq-custom-method input,
|
134 |
+
.multiple-checkout .shq-custom-method select,
|
135 |
+
.multiple-checkout .shq-custom-method input {
|
136 |
+
font-size: 12px !important;
|
137 |
+
height: 30px !important;
|
138 |
+
border: 1px solid #ddd !important;
|
139 |
+
max-width: 100%;
|
140 |
+
float: left;
|
141 |
+
color:#555;
|
142 |
+
line-height: 30px;
|
143 |
+
padding-left: 5px;
|
144 |
+
padding-right: 5px;
|
145 |
+
}
|
146 |
+
|
147 |
+
.calendar-blk, .clock-blk, .location-blk {fill:#555;}
|
148 |
+
|
149 |
+
.shq-custom-method {
|
150 |
+
width: 100%;
|
151 |
+
max-width: 480px;
|
152 |
+
display: inline-block;
|
153 |
+
color:#555 !important;
|
154 |
+
margin-top: 10px;
|
155 |
+
}
|
156 |
+
.shq-optn-50l,
|
157 |
+
.shq-optn-50r,
|
158 |
+
.shq-optn-100 {
|
159 |
+
float: left;
|
160 |
+
margin-bottom: 20px;
|
161 |
+
font-size: 12px;
|
162 |
+
}
|
163 |
+
|
164 |
+
.shq-optn-50l {width: 46%; padding-right: 4%; box-sizing: content-box;}
|
165 |
+
.shq-optn-50r {width: 46%; padding-left: 4%; box-sizing: content-box;}
|
166 |
+
.shq-optn-100 {width: 100%;}
|
167 |
+
|
168 |
+
#onestepcheckout-form .shq-optn-50l,
|
169 |
+
.multiple-checkout .shq-optn-50l {width: 100%;padding-right:0;}
|
170 |
+
|
171 |
+
#onestepcheckout-form .shq-optn-50r,
|
172 |
+
.multiple-checkout .shq-optn-50r {width: 100%;padding-left:0;}
|
173 |
+
|
174 |
+
.shq-custom-method label.shq-title,
|
175 |
+
.shq-custom-method label.shq-input {
|
176 |
+
padding:0 !important;
|
177 |
+
background: none !important;
|
178 |
+
}
|
179 |
+
.shq-custom-method label.shq-input input {width: auto; float: left;}
|
180 |
+
.shq-custom-method label.shq-title:hover,
|
181 |
+
.shq-custom-method label.shq-input:hover {
|
182 |
+
background:none !important;
|
183 |
}
|
184 |
|
185 |
+
.shq-title,
|
186 |
+
.shq-input {
|
187 |
+
float: left;
|
188 |
+
width:100%;
|
189 |
+
font-weight: normal !important;
|
190 |
+
color: #555 !important;
|
191 |
+
font-size: 12px;
|
192 |
+
}
|
193 |
+
|
194 |
+
.shq-input {margin-top:5px;}
|
195 |
+
.shq-input .shq-input {margin-top:0;}
|
196 |
+
.shq-input .shq-input .shq-input {margin-top:0;}
|
197 |
+
|
198 |
+
.shq-ico-location,
|
199 |
+
.shq-ico-calendar,
|
200 |
+
.shq-ico-clock {
|
201 |
+
width: 14px;
|
202 |
+
height: 14px;
|
203 |
+
float: left;
|
204 |
+
display: inline-block;
|
205 |
+
margin: 0 5px 0 0;
|
206 |
+
background-size: 14px 14px;
|
207 |
+
}
|
208 |
+
.shq-ico-calendar {
|
209 |
+
background: transparent url('../../images/shipperhq/calendar-blk.svg') center center no-repeat;
|
210 |
}
|
211 |
|
212 |
+
.shq-ico-clock {
|
213 |
+
background: transparent url('../../images/shipperhq/clock-blk.svg') center center no-repeat;
|
214 |
+
}
|
215 |
+
|
216 |
+
.shq-ico-location {
|
217 |
+
background: transparent url('../../images/shipperhq/location-blk.svg') center center no-repeat;
|
218 |
+
}
|
219 |
+
|
220 |
+
.shq-ico-r {
|
221 |
+
margin: 8px 0 0 5px !important;
|
222 |
+
}
|
223 |
+
.shq-map-insert {
|
224 |
+
position: relative;
|
225 |
+
width: 100%;
|
226 |
+
height: 100%;
|
227 |
+
overflow: hidden;
|
228 |
+
}
|
229 |
+
shq-map-popup {
|
230 |
+
width: 600px;
|
231 |
+
height: 400px;
|
232 |
+
}
|
233 |
+
|
234 |
+
@media only screen and (max-width: 480px) {
|
235 |
+
|
236 |
+
.shq-optn-50l {width: 100%; padding-right: 0;}
|
237 |
+
.shq-optn-50r {width: 100%; padding-left: 0;}
|
238 |
+
|
239 |
+
.map_canvas {
|
240 |
+
float: right;
|
241 |
+
width: 100%;
|
242 |
+
height: 180px;
|
243 |
+
padding: 0;
|
244 |
+
margin-top:10px;
|
245 |
+
}
|
246 |
+
|
247 |
+
.map_address {
|
248 |
+
float: left;
|
249 |
+
width: 100%;
|
250 |
+
}
|
251 |
+
|
252 |
+
}
|
skin/frontend/base/default/images/shipperhq/calendar-blk.svg
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
|
5 |
+
<g>
|
6 |
+
<path class="calendar-blk" d="M3.7,16.7H6c0.2,0,0.4-0.2,0.4-0.4V14c0-0.2-0.2-0.4-0.4-0.4H3.7c-0.2,0-0.4,0.2-0.4,0.4v2.3C3.3,16.5,3.5,16.7,3.7,16.7z"
|
7 |
+
/>
|
8 |
+
<path class="calendar-blk" d="M8.8,16.7H11c0.2,0,0.4-0.2,0.4-0.4V14c0-0.2-0.2-0.4-0.4-0.4H8.8c-0.2,0-0.4,0.2-0.4,0.4v2.3C8.4,16.5,8.5,16.7,8.8,16.7z
|
9 |
+
"/>
|
10 |
+
<path class="calendar-blk" d="M13.8,16.7h2.3c0.2,0,0.4-0.2,0.4-0.4V14c0-0.2-0.2-0.4-0.4-0.4h-2.3c-0.2,0-0.4,0.2-0.4,0.4v2.3
|
11 |
+
C13.4,16.5,13.6,16.7,13.8,16.7z"/>
|
12 |
+
<path class="calendar-blk" d="M3.7,11.9H6c0.2,0,0.4-0.2,0.4-0.4V9.2C6.4,9,6.2,8.8,6,8.8H3.7C3.5,8.8,3.3,9,3.3,9.2v2.3C3.3,11.7,3.5,11.9,3.7,11.9z"/>
|
13 |
+
<path class="calendar-blk" d="M8.8,11.9H11c0.2,0,0.4-0.2,0.4-0.4V9.2c0-0.2-0.2-0.4-0.4-0.4H8.8C8.5,8.8,8.4,9,8.4,9.2v2.3C8.4,11.7,8.5,11.9,8.8,11.9z
|
14 |
+
"/>
|
15 |
+
<path class="calendar-blk" d="M13.8,11.9h2.3c0.2,0,0.4-0.2,0.4-0.4V9.2c0-0.2-0.2-0.4-0.4-0.4h-2.3c-0.2,0-0.4,0.2-0.4,0.4v2.3
|
16 |
+
C13.4,11.7,13.6,11.9,13.8,11.9z"/>
|
17 |
+
<path class="calendar-blk" d="M14.4,3.8h1.2c0.2,0,0.4-0.2,0.4-0.4V2.2V0.4C16,0.2,15.8,0,15.6,0h-1.2C14.2,0,14,0.2,14,0.4v1.8v1.3
|
18 |
+
C14,3.7,14.2,3.8,14.4,3.8z"/>
|
19 |
+
<path class="calendar-blk" d="M4.3,3.8h1.2c0.2,0,0.4-0.2,0.4-0.4V2.2V0.4C5.9,0.2,5.8,0,5.5,0H4.3C4.1,0,3.9,0.2,3.9,0.4v1.8v1.3
|
20 |
+
C3.9,3.7,4.1,3.8,4.3,3.8z"/>
|
21 |
+
<path class="calendar-blk" d="M18.9,2.2h-1.6v1.7c0,0.7-0.4,1.1-1.1,1.1h-2.5c-0.7,0-1.1-0.4-1.1-1.1V2.2H7.2v1.7c0,0.7-0.4,1.1-1.1,1.1H3.7
|
22 |
+
C3,4.9,2.6,4.6,2.6,3.9V2.2H0.8C0.3,2.2,0,2.5,0,2.9v16.3C0,19.7,0.3,20,0.8,20h18.5c0.4,0,0.8-0.3,0.8-0.8v-16
|
23 |
+
C20,2.7,19.5,2.2,18.9,2.2z M18.5,18.5h-17V7h17V18.5z"/>
|
24 |
+
</g>
|
25 |
+
</svg>
|
skin/frontend/base/default/images/shipperhq/calendar-wht.svg
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{fill:#FFFFFF;}
|
7 |
+
</style>
|
8 |
+
<g>
|
9 |
+
<path class="st0" d="M3.7,16.7H6c0.2,0,0.4-0.2,0.4-0.4V14c0-0.2-0.2-0.4-0.4-0.4H3.7c-0.2,0-0.4,0.2-0.4,0.4v2.3
|
10 |
+
C3.3,16.5,3.5,16.7,3.7,16.7z"/>
|
11 |
+
<path class="st0" d="M8.8,16.7H11c0.2,0,0.4-0.2,0.4-0.4V14c0-0.2-0.2-0.4-0.4-0.4H8.8c-0.2,0-0.4,0.2-0.4,0.4v2.3
|
12 |
+
C8.4,16.5,8.5,16.7,8.8,16.7z"/>
|
13 |
+
<path class="st0" d="M13.8,16.7h2.3c0.2,0,0.4-0.2,0.4-0.4V14c0-0.2-0.2-0.4-0.4-0.4h-2.3c-0.2,0-0.4,0.2-0.4,0.4v2.3
|
14 |
+
C13.4,16.5,13.6,16.7,13.8,16.7z"/>
|
15 |
+
<path class="st0" d="M3.7,11.9H6c0.2,0,0.4-0.2,0.4-0.4V9.2C6.4,9,6.2,8.8,6,8.8H3.7C3.5,8.8,3.3,9,3.3,9.2v2.3
|
16 |
+
C3.3,11.7,3.5,11.9,3.7,11.9z"/>
|
17 |
+
<path class="st0" d="M8.8,11.9H11c0.2,0,0.4-0.2,0.4-0.4V9.2c0-0.2-0.2-0.4-0.4-0.4H8.8C8.5,8.8,8.4,9,8.4,9.2v2.3
|
18 |
+
C8.4,11.7,8.5,11.9,8.8,11.9z"/>
|
19 |
+
<path class="st0" d="M13.8,11.9h2.3c0.2,0,0.4-0.2,0.4-0.4V9.2c0-0.2-0.2-0.4-0.4-0.4h-2.3c-0.2,0-0.4,0.2-0.4,0.4v2.3
|
20 |
+
C13.4,11.7,13.6,11.9,13.8,11.9z"/>
|
21 |
+
<path class="st0" d="M14.4,3.8h1.2c0.2,0,0.4-0.2,0.4-0.4V2.2V0.4C16,0.2,15.8,0,15.6,0h-1.2C14.2,0,14,0.2,14,0.4v1.8v1.3
|
22 |
+
C14,3.7,14.2,3.8,14.4,3.8z"/>
|
23 |
+
<path class="st0" d="M4.3,3.8h1.2c0.2,0,0.4-0.2,0.4-0.4V2.2V0.4C5.9,0.2,5.8,0,5.5,0H4.3C4.1,0,3.9,0.2,3.9,0.4v1.8v1.3
|
24 |
+
C3.9,3.7,4.1,3.8,4.3,3.8z"/>
|
25 |
+
<path class="st0" d="M18.9,2.2h-1.6v1.7c0,0.7-0.4,1.1-1.1,1.1h-2.5c-0.7,0-1.1-0.4-1.1-1.1V2.2H7.2v1.7c0,0.7-0.4,1.1-1.1,1.1H3.7
|
26 |
+
C3,4.9,2.6,4.6,2.6,3.9V2.2H0.8C0.3,2.2,0,2.5,0,2.9v16.3C0,19.7,0.3,20,0.8,20h18.5c0.4,0,0.8-0.3,0.8-0.8v-16
|
27 |
+
C20,2.7,19.5,2.2,18.9,2.2z M18.5,18.5h-17V7h17V18.5z"/>
|
28 |
+
</g>
|
29 |
+
</svg>
|
skin/frontend/base/default/images/shipperhq/clock-blk.svg
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
|
5 |
+
<path class="clock-blk" d="M10,2c4.4,0,8,3.6,8,8s-3.6,8-8,8s-8-3.6-8-8S5.6,2,10,2 M10,0C4.5,0,0,4.5,0,10c0,5.5,4.5,10,10,10s10-4.5,10-10
|
6 |
+
C20,4.5,15.5,0,10,0L10,0z"/>
|
7 |
+
<path class="clock-blk" d="M14.7,11H9V5.2c0-0.6,0.4-1,1-1s1,0.4,1,1V9h3.7c0.6,0,1,0.4,1,1S15.3,11,14.7,11z"/>
|
8 |
+
</svg>
|
skin/frontend/base/default/images/shipperhq/clock-wht.svg
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{fill:#FFFFFF;}
|
7 |
+
</style>
|
8 |
+
<path class="st0" d="M10,2c4.4,0,8,3.6,8,8s-3.6,8-8,8s-8-3.6-8-8S5.6,2,10,2 M10,0C4.5,0,0,4.5,0,10c0,5.5,4.5,10,10,10
|
9 |
+
s10-4.5,10-10C20,4.5,15.5,0,10,0L10,0z"/>
|
10 |
+
<path class="st0" d="M14.7,11H9V5.2c0-0.6,0.4-1,1-1s1,0.4,1,1V9h3.7c0.6,0,1,0.4,1,1S15.3,11,14.7,11z"/>
|
11 |
+
</svg>
|
skin/frontend/base/default/images/shipperhq/location-blk.svg
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
|
5 |
+
<g>
|
6 |
+
<path class="location-blk" d="M16.7,6.7c0,0.9-0.1,1.7-0.4,2.3l-4.7,10.1c-0.1,0.3-0.3,0.5-0.6,0.7C10.6,19.9,10.3,20,10,20c-0.3,0-0.6-0.1-0.9-0.2
|
7 |
+
c-0.3-0.2-0.5-0.4-0.6-0.7L3.8,9C3.5,8.4,3.3,7.6,3.3,6.7c0-1.8,0.7-3.4,2-4.7C6.6,0.7,8.2,0,10,0s3.4,0.7,4.7,2
|
8 |
+
C16,3.3,16.7,4.8,16.7,6.7z M12.4,9c0.7-0.7,1-1.4,1-2.4S13,5,12.4,4.3c-0.7-0.7-1.4-1-2.4-1c-0.9,0-1.7,0.3-2.4,1
|
9 |
+
C7,5,6.7,5.7,6.7,6.7S7,8.4,7.6,9c0.7,0.7,1.4,1,2.4,1C10.9,10,11.7,9.7,12.4,9z"/>
|
10 |
+
</g>
|
11 |
+
</svg>
|
skin/frontend/base/default/images/shipperhq/location-wht.svg
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{fill:#FFFFFF;}
|
7 |
+
</style>
|
8 |
+
<g>
|
9 |
+
<path class="st0" d="M16.7,6.7c0,0.9-0.1,1.7-0.4,2.3l-4.7,10.1c-0.1,0.3-0.3,0.5-0.6,0.7C10.6,19.9,10.3,20,10,20
|
10 |
+
c-0.3,0-0.6-0.1-0.9-0.2c-0.3-0.2-0.5-0.4-0.6-0.7L3.8,9C3.5,8.4,3.3,7.6,3.3,6.7c0-1.8,0.7-3.4,2-4.7C6.6,0.7,8.2,0,10,0
|
11 |
+
s3.4,0.7,4.7,2C16,3.3,16.7,4.8,16.7,6.7z M12.4,9c0.7-0.7,1-1.4,1-2.4S13,5,12.4,4.3c-0.7-0.7-1.4-1-2.4-1c-0.9,0-1.7,0.3-2.4,1
|
12 |
+
C7,5,6.7,5.7,6.7,6.7S7,8.4,7.6,9c0.7,0.7,1.4,1,2.4,1C10.9,10,11.7,9.7,12.4,9z"/>
|
13 |
+
</g>
|
14 |
+
</svg>
|