pitneybowes_gsp - Version 1.4.3

Version Notes

1 Fixed error with the AddCommodity At Checkout. Changed the category_name in merchantCatRefId to the category_id. This ensures that the proper catalog reference is consumed by the PB processor.
2 Added category_name_rev array to reverse the category listing in the api call. This is done to ensure that the appropriate categories are consumed by the processor when there are many layers of categories a product is assigned.
3 Fixed checkout code to accurately use customer email address on API call when properly set for create order call. 
4 Add logic to enable/disable seller object 
5 Add commodity dimension and weight and COO values to seller object. When seller object is enabled, these values will be passsed to the api on checkout. 
6 Addon logic to not attempt ASN generation if order is already completed 
7 Disabled products will now not be added to the catalog export
8 Adjusted code in token regeneration logic to use the magento cache object. Now tokens are shared for all users on site vs. being individually generated for each user session.
9 Optimized code for catalog export by loading all child products of a configurable product in one call
10 Miscellaneous code comment cleanup.

Download this release

Release Info

Developer Shane Bogdan
Extension pitneybowes_gsp
Version 1.4.3
Comparing to
See all releases


Code changes from version 1.4.2 to 1.4.3

Files changed (59) hide show
  1. app/code/local/Pb/.DS_Store +0 -0
  2. app/code/local/Pb/Pbgsp/.DS_Store +0 -0
  3. app/code/local/Pb/Pbgsp/Block/Adminhtml/Categorysettings.php +3 -3
  4. app/code/local/Pb/Pbgsp/Block/Adminhtml/Categorysettings/Grid.php +3 -3
  5. app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Invoice/Totals.php +3 -3
  6. app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Totals.php +3 -3
  7. app/code/local/Pb/Pbgsp/Block/Adminhtml/Version.php +3 -3
  8. app/code/local/Pb/Pbgsp/Block/Checkout/Shipping/Method/Available.php +3 -3
  9. app/code/local/Pb/Pbgsp/Block/Sales/Order/Invoice/Totals.php +3 -3
  10. app/code/local/Pb/Pbgsp/Block/Sales/Order/Totals.php +6 -5
  11. app/code/local/Pb/Pbgsp/Block/Tax/Checkout/Tax.php +3 -3
  12. app/code/local/Pb/Pbgsp/Helper/Data.php +3 -3
  13. app/code/local/Pb/Pbgsp/Model/.DS_Store +0 -0
  14. app/code/local/Pb/Pbgsp/Model/Api.php +102 -28
  15. app/code/local/Pb/Pbgsp/Model/Carrier/ShippingMethod.php +9 -6
  16. app/code/local/Pb/Pbgsp/Model/Catalog/Category.php +5 -37
  17. app/code/local/Pb/Pbgsp/Model/Catalog/Cron.php +3 -3
  18. app/code/local/Pb/Pbgsp/Model/Catalog/File.php +39 -23
  19. app/code/local/Pb/Pbgsp/Model/Catalog/Product.php +3 -3
  20. app/code/local/Pb/Pbgsp/Model/Credentials.php +3 -3
  21. app/code/local/Pb/Pbgsp/Model/Creditmemo/Duty.php +3 -3
  22. app/code/local/Pb/Pbgsp/Model/Environmentconfig.php +3 -3
  23. app/code/local/Pb/Pbgsp/Model/Handledata.php +3 -3
  24. app/code/local/Pb/Pbgsp/Model/Handlingoptions.php +3 -3
  25. app/code/local/Pb/Pbgsp/Model/Helper.php +3 -3
  26. app/code/local/Pb/Pbgsp/Model/Inboundparcel.php +4 -4
  27. app/code/local/Pb/Pbgsp/Model/Invoice/Duty.php +3 -3
  28. app/code/local/Pb/Pbgsp/Model/Messages.php +3 -3
  29. app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel.php +3 -3
  30. app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel/Collection.php +3 -3
  31. app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber.php +3 -3
  32. app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber/Collection.php +3 -3
  33. app/code/local/Pb/Pbgsp/Model/Mysql4/Shipmentemail.php +3 -3
  34. app/code/local/Pb/Pbgsp/Model/Mysql4/Shipmentemail/Collection.php +3 -3
  35. app/code/local/Pb/Pbgsp/Model/Mysql4/Variable.php +3 -3
  36. app/code/local/Pb/Pbgsp/Model/Mysql4/Variable/Collection.php +3 -3
  37. app/code/local/Pb/Pbgsp/Model/Newhandlingoptions.php +3 -3
  38. app/code/local/Pb/Pbgsp/Model/Observer.php +97 -26
  39. app/code/local/Pb/Pbgsp/Model/Ordernumber.php +3 -3
  40. app/code/local/Pb/Pbgsp/Model/Pdf/Tax.php +3 -3
  41. app/code/local/Pb/Pbgsp/Model/Productattributesource/Productconditions.php +3 -3
  42. app/code/local/Pb/Pbgsp/Model/Quote/Duty.php +3 -3
  43. app/code/local/Pb/Pbgsp/Model/Resource/Mysql4/Setup.php +3 -3
  44. app/code/local/Pb/Pbgsp/Model/Sales/Order/Shipment.php +3 -3
  45. app/code/local/Pb/Pbgsp/Model/Shipmentemail.php +3 -3
  46. app/code/local/Pb/Pbgsp/Model/Util.php +8 -3
  47. app/code/local/Pb/Pbgsp/Model/Variable.php +3 -3
  48. app/code/local/Pb/Pbgsp/controllers/Adminhtml/CategorysettingsController.php +3 -3
  49. app/code/local/Pb/Pbgsp/data/pb_pbgsp_setup/data-install-1.0.0.php +3 -3
  50. app/code/local/Pb/Pbgsp/etc/config.xml +18 -18
  51. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php +3 -3
  52. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.0.0-1.0.1.php +3 -3
  53. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.1.1-1.1.2.php +3 -3
  54. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.2.0-1.2.1.php +3 -3
  55. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.3.0-1.3.1.php +3 -3
  56. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.3.5-1.3.6.php +3 -3
  57. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.4.0-1.4.1.php +3 -3
  58. app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.4.1-1.4.2.php +3 -3
  59. package.xml +15 -9
app/code/local/Pb/.DS_Store ADDED
Binary file
app/code/local/Pb/Pbgsp/.DS_Store ADDED
Binary file
app/code/local/Pb/Pbgsp/Block/Adminhtml/Categorysettings.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  */
7
 
8
  class Pb_Pbgsp_Block_Adminhtml_Categorysettings extends Mage_Adminhtml_Block_Widget_Grid_Container {
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  */
7
 
8
  class Pb_Pbgsp_Block_Adminhtml_Categorysettings extends Mage_Adminhtml_Block_Widget_Grid_Container {
app/code/local/Pb/Pbgsp/Block/Adminhtml/Categorysettings/Grid.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  */
7
 
8
  class Pb_Pbgsp_Block_Adminhtml_Categorysettings_Grid extends Mage_Adminhtml_Block_Widget_Grid {
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  */
7
 
8
  class Pb_Pbgsp_Block_Adminhtml_Categorysettings_Grid extends Mage_Adminhtml_Block_Widget_Grid {
app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Invoice/Totals.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Invoice/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Invoice/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Totals.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Adminhtml/Sales/Order/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Block/Adminhtml/Version.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
 
7
 
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
 
7
 
8
  */
app/code/local/Pb/Pbgsp/Block/Checkout/Shipping/Method/Available.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  /**
4
- * Product: Pb_Pbgsp (1.4.2)
5
- * Packaged: 2016-09-21T11:45:00+00:00
6
- * Last Modified: 2016-09-13T10:50:00+00:00
7
  * File: app/code/local/Pb/Pbgsp/Block/Checkout/Shipping/Method/Available.php
8
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
9
  */
1
  <?php
2
 
3
  /**
4
+ * Product: Pb_Pbgsp (1.4.3)
5
+ * Packaged: 2016-12-06T09:30:00+00:00
6
+ * Last Modified: 2016-09-21T11:45:00+00:00
7
  * File: app/code/local/Pb/Pbgsp/Block/Checkout/Shipping/Method/Available.php
8
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
9
  */
app/code/local/Pb/Pbgsp/Block/Sales/Order/Invoice/Totals.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Sales/Order/Invoice/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Sales/Order/Invoice/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Block/Sales/Order/Totals.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Sales/Order/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
@@ -31,8 +31,9 @@ class Pb_Pbgsp_Block_Sales_Order_Totals extends Mage_Sales_Block_Order_Totals {
31
 
32
  $shipMethod = $this->getOrder()->getShippingMethod();
33
  $taxAmount = $this->getOrder()->getTaxAmount();
 
34
  Pb_Pbgsp_Model_Util::log("Add Duty & Taxes at Order");
35
- $total = self::addDuties($total,$after,$shipMethod,$taxAmount);
36
  return parent::addTotal($total,$after);
37
 
38
  }
@@ -46,7 +47,7 @@ class Pb_Pbgsp_Block_Sales_Order_Totals extends Mage_Sales_Block_Order_Totals {
46
  if(array_key_exists("shipping",$totals)) {
47
  $shipping = $totals['shipping'];
48
  $shipping->setLabel('Transportation Charges');
49
- }
50
  }
51
 
52
  return $totals;
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Block/Sales/Order/Totals.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
31
 
32
  $shipMethod = $this->getOrder()->getShippingMethod();
33
  $taxAmount = $this->getOrder()->getTaxAmount();
34
+ $taxBaseAmount = $this->getOrder()->getBaseTaxAmount();
35
  Pb_Pbgsp_Model_Util::log("Add Duty & Taxes at Order");
36
+ $total = self::addDuties($total,$after,$shipMethod,$taxAmount,$taxBaseAmount);
37
  return parent::addTotal($total,$after);
38
 
39
  }
47
  if(array_key_exists("shipping",$totals)) {
48
  $shipping = $totals['shipping'];
49
  $shipping->setLabel('Transportation Charges');
50
+ }
51
  }
52
 
53
  return $totals;
app/code/local/Pb/Pbgsp/Block/Tax/Checkout/Tax.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  /**
4
- * Product: Pb_Pbgsp (1.4.2)
5
- * Packaged: 2016-09-21T11:45:00+00:00
6
- * Last Modified: 2016-09-13T10:50:00+00:00
7
  */
8
  class Pb_Pbgsp_Block_Tax_Checkout_Tax extends Mage_Tax_Block_Checkout_Tax
9
  {
1
  <?php
2
 
3
  /**
4
+ * Product: Pb_Pbgsp (1.4.3)
5
+ * Packaged: 2016-12-06T09:30:00+00:00
6
+ * Last Modified: 2016-09-21T11:45:00+00:00
7
  */
8
  class Pb_Pbgsp_Block_Tax_Checkout_Tax extends Mage_Tax_Block_Checkout_Tax
9
  {
app/code/local/Pb/Pbgsp/Helper/Data.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
 
7
  */
8
 
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
 
7
  */
8
 
app/code/local/Pb/Pbgsp/Model/.DS_Store ADDED
Binary file
app/code/local/Pb/Pbgsp/Model/Api.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
 
7
 
8
 
@@ -14,8 +14,9 @@
14
  class Pb_Pbgsp_Model_Api
15
  {
16
 
 
17
 
18
- public static function CallAPI($method, $url, $data = false,$isSecondCall=false)
19
  {
20
  $curl = curl_init();
21
  $headers = array();
@@ -69,11 +70,18 @@ class Pb_Pbgsp_Model_Api
69
  {
70
  Pb_Pbgsp_Model_Util::log("Http Status: $status");
71
  Pb_Pbgsp_Model_Util::log("body : $result");
72
- if($status == 401 && !$isSecondCall) {
 
 
 
73
  //token expired regenerat it
 
74
  Pb_Pbgsp_Model_Util::log("Regenerating token");
75
- Mage::getSingleton("customer/session")->setPbToken(false);
76
- self::CallAPI($method,$url,$data,true);
 
 
 
77
  }
78
  if($status == 404){
79
  return $result;
@@ -87,11 +95,16 @@ class Pb_Pbgsp_Model_Api
87
  }
88
 
89
  public static function getToken() {
90
- $token = Mage::getSingleton("customer/session")->getPbToken();
 
 
 
 
 
91
  if(!$token) {
92
  $curl = curl_init();
93
  curl_setopt($curl, CURLOPT_POST, 1);
94
- $username = trim(Pb_Pbgsp_Model_Credentials::getUsername());
95
  $password = trim(Pb_Pbgsp_Model_Credentials::getPassword());
96
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
97
  curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
@@ -120,7 +133,10 @@ class Pb_Pbgsp_Model_Api
120
  curl_close($curl);
121
  $token = json_decode($body,true);
122
  $token['cookie'] = $cookies['cookie'];
123
- Mage::getSingleton("customer/session")->setPbToken($token);
 
 
 
124
  }
125
  return $token;
126
  }
@@ -143,7 +159,7 @@ class Pb_Pbgsp_Model_Api
143
  $ipaddress = '0.0.0.0';
144
  return $ipaddress;
145
  }
146
- protected static function makeBasket($products, $address,$method='STANDARD')
147
  {
148
  $basketLines = array();
149
  $totalProducts = 0;
@@ -182,6 +198,7 @@ class Pb_Pbgsp_Model_Api
182
  $_cat = Mage::getModel('catalog/category')->load($category_id) ;
183
  $category_name[]= array("merchantCatRefId" =>$_cat->getId());
184
  }
 
185
  $shortDescription = Pb_Pbgsp_Model_Util::stripHtml($actualProduct -> getShortDescription());
186
  $shortDescription = preg_replace("/[^A-Za-z0-9 .\-\+=;:\\(){}\[\]@?%$#]/",'',$shortDescription);
187
  if (strlen($shortDescription) >= 2000) {
@@ -193,14 +210,59 @@ class Pb_Pbgsp_Model_Api
193
  "name" => $product->getName(),
194
  "shortDescription" => $shortDescription
195
  ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  array_push($basketLines, array(
197
  "lineId" => $product->getSku(),
198
- "commodity" => array(
199
- 'merchantComRefId' => $product->getSku(),
200
- "descriptions" =>$arDescriptions,
201
- "commodityUrl" => $actualProduct->getProductUrl(),
202
- "categories" => $category_name,
203
- ),
204
  "unitPrice" => array('price' => array('value' => $price)),
205
  "quantity" => intval($product->getQty())
206
 
@@ -240,6 +302,9 @@ class Pb_Pbgsp_Model_Api
240
  if(!$email)
241
  $email = "kamranattari@gmail.com";
242
 
 
 
 
243
  $familyName = $address->getLastname(); //when it comes from paypal express, lastname is null, Kamran, Bigpixel Studio,
244
  if(!$familyName)
245
  $familyName = $address->getFirstname();
@@ -365,7 +430,21 @@ class Pb_Pbgsp_Model_Api
365
  }
366
 
367
 
368
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  $requestBody = array(
370
  'merchantOrderNumber' => $cpOrderNumber,
371
  'parcelIdentificationNumber' => $number,
@@ -382,13 +461,7 @@ class Pb_Pbgsp_Model_Api
382
  'postalOrZipCode' => '85123'
383
  ),
384
  'returnDetails' => array(
385
- 'returnAddress' => array(
386
- 'street1' => Pb_Pbgsp_Model_Credentials::getReturnAddressStreet1(),
387
- 'city' => Pb_Pbgsp_Model_Credentials::getReturnAddressCity(),
388
- 'provinceOrState' => Pb_Pbgsp_Model_Credentials::getReturnAddressState(),
389
- 'country' => Pb_Pbgsp_Model_Credentials::getReturnAddressCountry(),
390
- 'postalOrZipCode' => Pb_Pbgsp_Model_Credentials::getReturnAddressZip()
391
- ),
392
  'contactInformation' => array(
393
  'familyName' => $address->getLastname(),
394
  'givenName' => $address->getFirstname(),
@@ -403,7 +476,7 @@ class Pb_Pbgsp_Model_Api
403
  ),
404
  'size' => array(
405
  'weight' => $totalWeight,
406
- 'weightUnit' => 'LB'
407
  )
408
  );
409
  $url = Pb_Pbgsp_Model_Credentials::getOrderMgmtAPIUrl().'/orders/'.
@@ -430,7 +503,7 @@ class Pb_Pbgsp_Model_Api
430
  public static function getQuote($products,$address)
431
  {
432
 
433
- Pb_Pbgsp_Model_Util::log('Getting quote from clearpath');
434
  $basket = Pb_Pbgsp_Model_Api::makeBasket($products, $address);
435
 
436
  $url = self::getCheckoutUrl('quotes');
@@ -451,7 +524,7 @@ class Pb_Pbgsp_Model_Api
451
 
452
  try {
453
  Pb_Pbgsp_Model_Util::log('Creating order in clearpath');
454
- $basket = Pb_Pbgsp_Model_Api::makeBasket($products, $address,$method);
455
 
456
  $url = self::getCheckoutUrl('orders');
457
  $response = self::CallAPI('POST',$url,$basket);
@@ -501,6 +574,7 @@ class Pb_Pbgsp_Model_Api
501
  $cancelOrderResponse = json_decode($response,true);
502
  Pb_Pbgsp_Model_Util::log('Response of cancel order');
503
  Pb_Pbgsp_Model_Util::log($cancelOrderResponse);
 
504
  if(array_key_exists('errors',$cancelOrderResponse)) {
505
  Pb_Pbgsp_Model_Util::log("Error generating cancelling order");
506
  Pb_Pbgsp_Model_Util::log($cancelOrderResponse);
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
 
7
 
8
 
14
  class Pb_Pbgsp_Model_Api
15
  {
16
 
17
+ static $STORE_TOKENS = array();
18
 
19
+ public static function CallAPI($method, $url, $data = false,$attempts=0)
20
  {
21
  $curl = curl_init();
22
  $headers = array();
70
  {
71
  Pb_Pbgsp_Model_Util::log("Http Status: $status");
72
  Pb_Pbgsp_Model_Util::log("body : $result");
73
+ Pb_Pbgsp_Model_Util::log("token_type". $token['token_type']);
74
+ Pb_Pbgsp_Model_Util::log("access_token". $token['access_token']);
75
+ //if($status == 401 && !$isSecondCall) {
76
+ if($status == 401 && $attempts < 5) {
77
  //token expired regenerat it
78
+
79
  Pb_Pbgsp_Model_Util::log("Regenerating token");
80
+ //Mage::getSingleton("customer/session")->setPbToken(false);
81
+ Mage::app()->getCache()->remove(trim(Pb_Pbgsp_Model_Credentials::getUsername()));
82
+ $attempts++;
83
+ curl_close($curl);
84
+ return self::CallAPI($method,$url,$data,$attempts);
85
  }
86
  if($status == 404){
87
  return $result;
95
  }
96
 
97
  public static function getToken() {
98
+ $token = null;
99
+ $username = trim(Pb_Pbgsp_Model_Credentials::getUsername());
100
+ //$token = Mage::getSingleton("customer/session")->getPbToken();
101
+ if (false !== ($data = Mage::app()->getCache()->load($username))) {
102
+ $token = unserialize($data);
103
+ }
104
  if(!$token) {
105
  $curl = curl_init();
106
  curl_setopt($curl, CURLOPT_POST, 1);
107
+
108
  $password = trim(Pb_Pbgsp_Model_Credentials::getPassword());
109
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
110
  curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
133
  curl_close($curl);
134
  $token = json_decode($body,true);
135
  $token['cookie'] = $cookies['cookie'];
136
+ Pb_Pbgsp_Model_Util::log("Token regenerated:". $body);
137
+ //Mage::getSingleton("customer/session")->setPbToken($token);
138
+
139
+ Mage::app()->getCache()->save(serialize($token), $username);
140
  }
141
  return $token;
142
  }
159
  $ipaddress = '0.0.0.0';
160
  return $ipaddress;
161
  }
162
+ protected static function makeBasket($products, $address,$method='STANDARD',$forCreateOrder=false)
163
  {
164
  $basketLines = array();
165
  $totalProducts = 0;
198
  $_cat = Mage::getModel('catalog/category')->load($category_id) ;
199
  $category_name[]= array("merchantCatRefId" =>$_cat->getId());
200
  }
201
+ $category_name_rev = array_reverse ($category_name);
202
  $shortDescription = Pb_Pbgsp_Model_Util::stripHtml($actualProduct -> getShortDescription());
203
  $shortDescription = preg_replace("/[^A-Za-z0-9 .\-\+=;:\\(){}\[\]@?%$#]/",'',$shortDescription);
204
  if (strlen($shortDescription) >= 2000) {
210
  "name" => $product->getName(),
211
  "shortDescription" => $shortDescription
212
  ));
213
+ $commodity = array(
214
+ 'merchantComRefId' => $product->getSku()
215
+
216
+ );
217
+ if(Mage::getStoreConfig('carriers/pbgsp/seller_active')) {
218
+ $commodity['descriptions'] = $arDescriptions;
219
+ $commodity['commodityUrl'] = $actualProduct->getProductUrl();
220
+ $commodity['categories'] = $category_name_rev;
221
+ }
222
+ if($actualProduct->getCountryOfManufacture()) {
223
+ $commodity['coo'] = $actualProduct->getCountryOfManufacture();
224
+ }
225
+ if($actualProduct->getWeight() > 0) {
226
+ $commoditySize = array(
227
+ 'weightUnit' => 'lb',
228
+ 'distanceUnit'=>'in',
229
+ 'weight'=> $actualProduct->getWeight(),
230
+
231
+ );
232
+ if($actualProduct->getPbPbgspCommodityHeight() && $actualProduct->getPbPbgspCommodityHeight() > 0) {
233
+ $commoditySize['height'] = $actualProduct->getPbPbgspCommodityHeight();
234
+ }
235
+ if($actualProduct->getPbPbgspCommodityWidth() && $actualProduct->getPbPbgspCommodityWidth() > 0) {
236
+ $commoditySize['width'] = $actualProduct->getPbPbgspCommodityWidth();
237
+ }
238
+ if($actualProduct->getPbPbgspCommodityLength() && $actualProduct->getPbPbgspCommodityLength() > 0) {
239
+ $commoditySize['length'] = $actualProduct->getPbPbgspCommodityLength();
240
+ }
241
+ $commodity['commoditySize'] = $commoditySize;
242
+ }
243
+
244
+
245
+ if($actualProduct->getPbPbgspPackageWeight() && $actualProduct->getPbPbgspPackageWeight() > 0 ) {
246
+ $shippingSize = array(
247
+ 'weightUnit' => 'lb',
248
+ 'distanceUnit'=>'in',
249
+ 'weight'=> $actualProduct->getPbPbgspPackageWeight(),
250
+
251
+ );
252
+ if($actualProduct->getPbPbgspPackageHeight() && $actualProduct->getPbPbgspPackageHeight() > 0) {
253
+ $shippingSize['height'] = $actualProduct->getPbPbgspPackageHeight();
254
+ }
255
+ if($actualProduct->getPbPbgspPackageWidth() && $actualProduct->getPbPbgspPackageWidth() > 0) {
256
+ $shippingSize['width'] = $actualProduct->getPbPbgspPackageWidth();
257
+ }
258
+ if($actualProduct->getPbPbgspPackageLength() && $actualProduct->getPbPbgspPackageLength() > 0) {
259
+ $shippingSize['length'] = $actualProduct->getPbPbgspPackageLength();
260
+ }
261
+ $commodity['shippingSize'] = $shippingSize;
262
+ }
263
  array_push($basketLines, array(
264
  "lineId" => $product->getSku(),
265
+ "commodity" => $commodity,
 
 
 
 
 
266
  "unitPrice" => array('price' => array('value' => $price)),
267
  "quantity" => intval($product->getQty())
268
 
302
  if(!$email)
303
  $email = "kamranattari@gmail.com";
304
 
305
+ if($email == 'email@email.com' && $forCreateOrder)
306
+ $email = Mage::getSingleton('customer/session')->getCustomer()->getEmail();//set correct email address of customer
307
+
308
  $familyName = $address->getLastname(); //when it comes from paypal express, lastname is null, Kamran, Bigpixel Studio,
309
  if(!$familyName)
310
  $familyName = $address->getFirstname();
430
  }
431
 
432
 
433
+ $returnAddress = array(
434
+ 'street1' => Pb_Pbgsp_Model_Credentials::getReturnAddressStreet1(),
435
+ 'city' => Pb_Pbgsp_Model_Credentials::getReturnAddressCity(),
436
+ 'provinceOrState' => Pb_Pbgsp_Model_Credentials::getReturnAddressState(),
437
+ 'country' => Pb_Pbgsp_Model_Credentials::getReturnAddressCountry(),
438
+ 'postalOrZipCode' => Pb_Pbgsp_Model_Credentials::getReturnAddressZip()
439
+ );
440
+
441
+ // if(Mage::getStoreConfig('carriers/pbgsp/seller_active')) {
442
+ // $returnAddress['street1'] = Mage::getStoreConfig('carriers/pbgsp/seller_street_address');
443
+ // $returnAddress['city'] = Mage::getStoreConfig('carriers/pbgsp/seller_city');
444
+ // $returnAddress['provinceOrState'] = Mage::getStoreConfig('carriers/pbgsp/seller_province_state');
445
+ // $returnAddress['postalOrZipCode'] = Mage::getStoreConfig('carriers/pbgsp/seller_zip');
446
+ // $returnAddress['country'] = Mage::getStoreConfig('carriers/pbgsp/seller_country');
447
+ // }
448
  $requestBody = array(
449
  'merchantOrderNumber' => $cpOrderNumber,
450
  'parcelIdentificationNumber' => $number,
461
  'postalOrZipCode' => '85123'
462
  ),
463
  'returnDetails' => array(
464
+ 'returnAddress' => $returnAddress,
 
 
 
 
 
 
465
  'contactInformation' => array(
466
  'familyName' => $address->getLastname(),
467
  'givenName' => $address->getFirstname(),
476
  ),
477
  'size' => array(
478
  'weight' => $totalWeight,
479
+ 'weightUnit' => 'lb'
480
  )
481
  );
482
  $url = Pb_Pbgsp_Model_Credentials::getOrderMgmtAPIUrl().'/orders/'.
503
  public static function getQuote($products,$address)
504
  {
505
 
506
+ Pb_Pbgsp_Model_Util::log('Getting quote from Pitney Bowes');
507
  $basket = Pb_Pbgsp_Model_Api::makeBasket($products, $address);
508
 
509
  $url = self::getCheckoutUrl('quotes');
524
 
525
  try {
526
  Pb_Pbgsp_Model_Util::log('Creating order in clearpath');
527
+ $basket = Pb_Pbgsp_Model_Api::makeBasket($products, $address,$method,true);
528
 
529
  $url = self::getCheckoutUrl('orders');
530
  $response = self::CallAPI('POST',$url,$basket);
574
  $cancelOrderResponse = json_decode($response,true);
575
  Pb_Pbgsp_Model_Util::log('Response of cancel order');
576
  Pb_Pbgsp_Model_Util::log($cancelOrderResponse);
577
+ $errorMessage = '';
578
  if(array_key_exists('errors',$cancelOrderResponse)) {
579
  Pb_Pbgsp_Model_Util::log("Error generating cancelling order");
580
  Pb_Pbgsp_Model_Util::log($cancelOrderResponse);
app/code/local/Pb/Pbgsp/Model/Carrier/ShippingMethod.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Carrier/ShippingMethod.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
@@ -38,9 +38,12 @@ class Pb_Pbgsp_Model_Carrier_ShippingMethod extends Mage_Shipping_Model_Carrier_
38
  if(array_key_exists('message',$error))
39
  $message = $error['message'];
40
  $message = $processor->getDisplayMessage($error["error"],$message);//.$sku;
41
- $sku = $quoteLine['merchantComRefId'];
42
- $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
43
- $message = $message . " Please remove ". $product->getName() . " from cart.";
 
 
 
44
  $this->_addError($result,$message);
45
  $isUnitErrorAdded = true;
46
  }
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Carrier/ShippingMethod.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
38
  if(array_key_exists('message',$error))
39
  $message = $error['message'];
40
  $message = $processor->getDisplayMessage($error["error"],$message);//.$sku;
41
+ if(array_key_exists('merchantComRefId',$quoteLine)) {
42
+ $sku = $quoteLine['merchantComRefId'];
43
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
44
+ $message = $message . " Please remove ". $product->getName() . " from cart.";
45
+ }
46
+
47
  $this->_addError($result,$message);
48
  $isUnitErrorAdded = true;
49
  }
app/code/local/Pb/Pbgsp/Model/Catalog/Category.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/Category.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
@@ -94,40 +94,8 @@ class Pb_Pbgsp_Model_Catalog_Category {
94
 
95
  }
96
 
97
- // This is done via API
98
- public function upload() {
99
- echo "Uploading category: ".$this->category->getName()."... ";
100
- if (Pb_Pbgsp_Model_Api::addCategory($this)) {
101
- echo "ok";
102
- } else {
103
- echo "failed!";
104
- }
105
- echo "<br/>";
106
-
107
- $products = $this->category->getProductCollection();
108
- // TODO: Products that are part of multiple categories will be uploaded
109
- // multiple times.
110
- foreach ($products as $product) {
111
- $clearPathProduct = new Pb_Pbgsp_Model_Catalog_Product($product);
112
- echo "Uploading product: ".$clearPathProduct->getName()."... ";
113
- if (Pb_Pbgsp_Model_Api::addCommodity($clearPathProduct)) {
114
- echo "ok";
115
- } else {
116
- echo "failed!";
117
- }
118
- echo "<br/>";
119
- }
120
-
121
-
122
- $children = $this->category->getChildrenCategories();
123
-
124
- // TODO: this code will run out of memory if there are a lot of categories....
125
- // Need to convert the recursive call to a loop at some point.
126
- foreach ($children as $child) {
127
- $childCategory = new Pb_Pbgsp_Model_Catalog_Category($child);
128
- $childCategory->upload();
129
- }
130
- }
131
 
132
  // This fuction starts at the Magento root and its not very efficient... see isRoot for proper implementation.
133
  // This function is only used by the API upload.
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/Category.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
94
 
95
  }
96
 
97
+
98
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
  // This fuction starts at the Magento root and its not very efficient... see isRoot for proper implementation.
101
  // This function is only used by the API upload.
app/code/local/Pb/Pbgsp/Model/Catalog/Cron.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/Cron.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/Cron.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Catalog/File.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  /**
4
- * Product: Pb_Pbgsp (1.4.2)
5
- * Packaged: 2016-09-21T11:45:00+00:00
6
- * Last Modified: 2016-09-13T10:50:00+00:00
7
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/File.php
8
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
9
  */
@@ -26,13 +26,8 @@ class Pb_Pbgsp_Model_Catalog_File {
26
  }
27
 
28
  private function _getTempDir() {
29
- $appRoot = Mage::getRoot();
30
- $mageRoot = dirname($appRoot);
31
- $configOptions = Mage::getModel('core/config_options');
32
- $tmpDir = $mageRoot . '/var/pbgsp/tmp/';
33
- $configOptions->createDirIfNotExists( $tmpDir);
34
- chmod($tmpDir, 0777);
35
- return $tmpDir;
36
  }
37
 
38
 
@@ -229,6 +224,7 @@ class Pb_Pbgsp_Model_Catalog_File {
229
  ->addAttributeToSelect('pb_pbgsp_package_height')
230
  ->addAttributeToSelect('pb_pbgsp_package_width')
231
  ->addAttributeToSelect('pb_pbgsp_package_length')
 
232
  // ->addUrlRewrite($category->getId()) //this will add the url rewrite.
233
  ->addAttributeToSelect('price')
234
  ->addAttributeToSelect('weight');
@@ -237,7 +233,7 @@ class Pb_Pbgsp_Model_Catalog_File {
237
  $productUrlFormat = $baseURL ."catalog/product/view/id/%d/";
238
  foreach($productCollection as $product) {
239
  /* @var $product Mage_Catalog_Model_Product */
240
- if($product->getTypeId() == 'virtual')
241
  continue;
242
  $cateIds = $product->getCategoryIds();
243
  $cateId = 0;
@@ -257,11 +253,38 @@ class Pb_Pbgsp_Model_Catalog_File {
257
  $prodCat->setData('name_path',$this->_getCatNamePath($addedCategories,$cIds));
258
  if($product->getTypeId() == 'configurable' ) {
259
  $productType = $product->getTypeInstance(true);
260
- $allowedProducts = $productType->getUsedProducts(null, $product);
 
 
261
  /** @var $childProduct Mage_Catalog_Model_Product */
262
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  foreach($allowedProducts as $childProduct) {
264
- if(!$childProduct->getPbPbgspUploadDelete()) {
265
  if(!array_key_exists($childProduct->getSku(),$addedProducts)) {
266
  if( $fileRecordCount > $maxRecordsCount)
267
  {
@@ -269,7 +292,7 @@ class Pb_Pbgsp_Model_Catalog_File {
269
  $fileRecordCount=0;
270
  $part++;
271
  }
272
- $pbChildProduct = new Pb_Pbgsp_Model_Catalog_Product($childProduct->getId(),$product->getUrlInStore());
273
  $this->writeProduct($pbChildProduct,$cateId,$product->getSku(),$prodCat);
274
  $addedProducts[$childProduct->getSku()] = "added";
275
  $prodCount++;
@@ -876,14 +899,7 @@ class Pb_Pbgsp_Model_Catalog_File {
876
  */
877
  private function _getSftpCredentials()
878
  {
879
- $credentials = array(
880
- 'host' => Pb_Pbgsp_Model_Credentials::getSftpHostname(),
881
- "port" => Pb_Pbgsp_Model_Credentials::getSftpPort(),
882
- 'username' => Pb_Pbgsp_Model_Credentials::getSftpUsername(),
883
- 'password' => Pb_Pbgsp_Model_Credentials::getSftpPassword(),
884
- 'timeout' => '10'
885
- );
886
- return $credentials;
887
  }
888
 
889
  /**
1
  <?php
2
 
3
  /**
4
+ * Product: Pb_Pbgsp (1.4.3)
5
+ * Packaged: 2016-12-06T09:30:00+00:00
6
+ * Last Modified: 2016-09-21T11:45:00+00:00
7
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/File.php
8
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
9
  */
26
  }
27
 
28
  private function _getTempDir() {
29
+
30
+ return Pb_Pbgsp_Model_Util::getTempDir();
 
 
 
 
 
31
  }
32
 
33
 
224
  ->addAttributeToSelect('pb_pbgsp_package_height')
225
  ->addAttributeToSelect('pb_pbgsp_package_width')
226
  ->addAttributeToSelect('pb_pbgsp_package_length')
227
+ ->addAttributeToSelect('status')
228
  // ->addUrlRewrite($category->getId()) //this will add the url rewrite.
229
  ->addAttributeToSelect('price')
230
  ->addAttributeToSelect('weight');
233
  $productUrlFormat = $baseURL ."catalog/product/view/id/%d/";
234
  foreach($productCollection as $product) {
235
  /* @var $product Mage_Catalog_Model_Product */
236
+ if($product->getTypeId() == 'virtual' || $product->getStatus() == 2)
237
  continue;
238
  $cateIds = $product->getCategoryIds();
239
  $cateId = 0;
253
  $prodCat->setData('name_path',$this->_getCatNamePath($addedCategories,$cIds));
254
  if($product->getTypeId() == 'configurable' ) {
255
  $productType = $product->getTypeInstance(true);
256
+ //$allowedProducts = $productType->getUsedProducts(null, $product);
257
+ $ids=Mage::getResourceSingleton('catalog/product_type_configurable')
258
+ ->getChildrenIds($product->getId());
259
  /** @var $childProduct Mage_Catalog_Model_Product */
260
+ $allowedProducts = Mage::getModel('catalog/product')->getCollection()
261
+ ->addIdFilter ($ids)
262
+ ->addAttributeToSelect('name')
263
+ ->addAttributeToSelect('sku')
264
+ ->addAttributeToSelect('country_of_manufacture')
265
+ ->addAttributeToSelect('description')
266
+ ->addAttributeToSelect('product_url')
267
+ ->addAttributeToSelect('type_id')
268
+ ->addAttributeToSelect('url_in_store')
269
+ ->addAttributeToSelect('pb_pbgsp_upload')
270
+ ->addAttributeToSelect('updated_at')
271
+ ->addAttributeToSelect('pb_pbgsp_product_condition')
272
+ ->addAttributeToSelect('pb_pbgsp_upload_delete')
273
+ ->addAttributeToSelect('pb_pbgsp_upload_deleted_on')
274
+ ->addAttributeToSelect('pb_pbgsp_commodity_height')
275
+ ->addAttributeToSelect('pb_pbgsp_commodity_width')
276
+ ->addAttributeToSelect('pb_pbgsp_commodity_length')
277
+ ->addAttributeToSelect('pb_pbgsp_package_weight')
278
+ ->addAttributeToSelect('pb_pbgsp_package_height')
279
+ ->addAttributeToSelect('pb_pbgsp_package_width')
280
+ ->addAttributeToSelect('pb_pbgsp_package_length')
281
+ ->addAttributeToSelect('status')
282
+ // ->addUrlRewrite($category->getId()) //this will add the url rewrite.
283
+ ->addAttributeToSelect('price')
284
+ ->addAttributeToSelect('weight');
285
+ //->addAttributeToSelect('color')-> groupByAttribute('color');
286
  foreach($allowedProducts as $childProduct) {
287
+ if(!$childProduct->getPbPbgspUploadDelete() && $childProduct->getStatus() != 2) {
288
  if(!array_key_exists($childProduct->getSku(),$addedProducts)) {
289
  if( $fileRecordCount > $maxRecordsCount)
290
  {
292
  $fileRecordCount=0;
293
  $part++;
294
  }
295
+ $pbChildProduct = new Pb_Pbgsp_Model_Catalog_Product($childProduct,$product->getUrlInStore());
296
  $this->writeProduct($pbChildProduct,$cateId,$product->getSku(),$prodCat);
297
  $addedProducts[$childProduct->getSku()] = "added";
298
  $prodCount++;
899
  */
900
  private function _getSftpCredentials()
901
  {
902
+ return Pb_Pbgsp_Model_Util::getSftpCredentials();
 
 
 
 
 
 
 
903
  }
904
 
905
  /**
app/code/local/Pb/Pbgsp/Model/Catalog/Product.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/Product.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Catalog/Product.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Credentials.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Credentials.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Credentials.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Creditmemo/Duty.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Creditmemo/Duty.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Creditmemo/Duty.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Environmentconfig.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Environmentconfig.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Environmentconfig.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Handledata.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Handlingoptions.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Handlingoptions.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Handlingoptions.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Handlingoptions.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Handlingoptions.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Helper.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Helper.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Helper.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Inboundparcel.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Inboundparcel.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
@@ -41,7 +41,7 @@ class Pb_Pbgsp_Model_Inboundparcel extends Mage_Core_Model_Abstract {
41
  $cpOrderNumber = $clearPathOrder['cp_order_number'];
42
  $order = Mage::getModel('sales/order')->loadByIncrementId($orderID);
43
 
44
- if(($orderID != '') && ($order->hasShipments()) && ($order['status'] != 'canceled')){
45
 
46
  $shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')->setOrderFilter($order)->load();
47
 
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Inboundparcel.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
41
  $cpOrderNumber = $clearPathOrder['cp_order_number'];
42
  $order = Mage::getModel('sales/order')->loadByIncrementId($orderID);
43
 
44
+ if(($orderID != '') && ($order->hasShipments()) && ($order['status'] != 'canceled' && $order['status'] != 'complete')){
45
 
46
  $shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')->setOrderFilter($order)->load();
47
 
app/code/local/Pb/Pbgsp/Model/Invoice/Duty.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Invoice/Duty.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Invoice/Duty.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Messages.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Messages.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Messages.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Inboundparcel/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Ordernumber/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Shipmentemail.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Shipmentemail/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Variable.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Mysql4/Variable/Collection.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Mysql4/Variable/Collection.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Newhandlingoptions.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Handlingoptions.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Handlingoptions.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Observer.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Observer.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
@@ -262,7 +262,7 @@ class Pb_Pbgsp_Model_Observer {
262
  public function saveShippingMethod($observer) {
263
  Pb_Pbgsp_Model_Util::log('Pb_Pbgsp_Model_Observer.saveShippingMethod');
264
 
265
- //TODO: If anything fails here I need to fail the checkout process.
266
  $address = $observer->getQuote()->getShippingAddress();
267
  Pb_Pbgsp_Model_Util::log($address->getShippingMethod());
268
  Pb_Pbgsp_Model_Util::log($this->getShipMethod($observer));
@@ -280,28 +280,7 @@ class Pb_Pbgsp_Model_Observer {
280
 
281
  if(Pb_Pbgsp_Model_Credentials::isFreeTaxEnabled())
282
  $tax = 0;
283
- else {
284
- //set the tax for each item in quote
285
- // foreach($address->getAllItems() as $item) {
286
- // /* @var Mage_Sales_Model_Quote_Item $item */
287
- // foreach($order['order']['quoteLines'] as $quoteLine) {
288
- // $sku = $quoteLine['merchantComRefId'];
289
- // if($item->getSku() == $sku) {
290
- // $itemBaseTax = $quoteLine['unitImportation']['total']['value'];
291
- // $item->setBaseTaxAmount(floatval($itemBaseTax));
292
- // $itemTax = $itemBaseTax;
293
- // if(Mage::app()->getStore()->getCurrentCurrencyCode() != 'USD') {
294
- //
295
- // $itemTax = Mage::app()->getStore()->convertPrice($itemBaseTax);
296
- //
297
- // }
298
- // $item->setTaxAmount($itemTax);
299
- // $item->save();
300
- // }
301
- // }
302
- // $address->save();
303
- // }
304
- }
305
  Mage::getSingleton("customer/session")->setPbDutyAndTaxUSD($tax);
306
  if(Mage::app()->getStore()->getCurrentCurrencyCode() != 'USD') {
307
 
@@ -515,5 +494,97 @@ class Pb_Pbgsp_Model_Observer {
515
 
516
  return false;
517
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  }
519
  ?>
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Observer.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
262
  public function saveShippingMethod($observer) {
263
  Pb_Pbgsp_Model_Util::log('Pb_Pbgsp_Model_Observer.saveShippingMethod');
264
 
265
+
266
  $address = $observer->getQuote()->getShippingAddress();
267
  Pb_Pbgsp_Model_Util::log($address->getShippingMethod());
268
  Pb_Pbgsp_Model_Util::log($this->getShipMethod($observer));
280
 
281
  if(Pb_Pbgsp_Model_Credentials::isFreeTaxEnabled())
282
  $tax = 0;
283
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  Mage::getSingleton("customer/session")->setPbDutyAndTaxUSD($tax);
285
  if(Mage::app()->getStore()->getCurrentCurrencyCode() != 'USD') {
286
 
494
 
495
  return false;
496
  }
497
+
498
+ public function createOrderAdminAfter($data) {
499
+ Pb_Pbgsp_Model_Util::log("createOrderAdminAfter");
500
+ $order = $data['order'];
501
+ $quote = $data['quote'];
502
+ /* @var Mage_Sales_Model_Order $order */
503
+ if($this->isPbOrder($order)) {
504
+ Pb_Pbgsp_Model_Util::log(" PB order");
505
+ try {
506
+
507
+
508
+ //$items = $order->getItems();
509
+ $items = $quote->getAllItems();
510
+ $address = $quote->getShippingAddress();
511
+ $domesticShippingAdress = $address->getName()."</br>".$address->getStreetFull().", ".$address->getCity()."</br> ".$address->getRegion().", ".$address->getCountry().",".$address->getPostcode()."</br> T:".$address->getTelephone();
512
+ $shipMethod = $quote->getShippingAddress()->getShippingMethod();
513
+
514
+ $shipMethod = substr($shipMethod,strlen("pbgsp_"));
515
+
516
+ $pbOrder = Pb_Pbgsp_Model_Api::createOrder($items,$shipMethod,$address);
517
+ if (!$pbOrder) {
518
+ Mage::throwException("Unable to create Pb order.");
519
+ }
520
+ Mage::getSingleton("customer/session")->setPbOrder($pbOrder);
521
+ $tax = $pbOrder['order']['totalImportation']['total']['value'];
522
+
523
+ if(Pb_Pbgsp_Model_Credentials::isFreeTaxEnabled())
524
+ $tax = 0;
525
+
526
+ Mage::getSingleton("customer/session")->setPbDutyAndTaxUSD($tax);
527
+ if(Mage::app()->getStore()->getCurrentCurrencyCode() != 'USD') {
528
+
529
+ $tax = Mage::app()->getStore()->convertPrice($tax);
530
+
531
+ }
532
+ Mage::getSingleton("customer/session")->setPbDutyAndTax($tax);
533
+
534
+ $orderNumber = Mage::getModel("pb_pbgsp/ordernumber");
535
+
536
+ $orderNumber->setCpOrderNumber($pbOrder["orderId"]);
537
+ $orderNumber->setHubId($pbOrder["shipToHub"]['hubId']);
538
+ $orderNumber->setHubStreet1($pbOrder["shipToHub"]['hubAddress']['street1']);
539
+ $orderNumber->setHubStreet2($pbOrder["shipToHub"]['hubAddress']['street2']);
540
+
541
+ $orderNumber->setHubProvinceOrState($pbOrder["shipToHub"]['hubAddress']['provinceOrState']);
542
+ $orderNumber->setHubCountry($pbOrder["shipToHub"]['hubAddress']['country']);
543
+ $orderNumber->setHubPostalCode($pbOrder["shipToHub"]['hubAddress']['postalOrZipCode']);
544
+ $orderNumber->setHubCity($pbOrder["shipToHub"]['hubAddress']['city']);
545
+ $orderNumber->setOriginalShippingAddress($domesticShippingAdress);
546
+ $orderNumber->save();
547
+ Mage::getSingleton("customer/session")->setPbOrderNumber($orderNumber);
548
+ $mageOrderNumber = $order->getIncrementId();
549
+ $orderNumber->setMageOrderNumber($mageOrderNumber);
550
+ Pb_Pbgsp_Model_Util::log("calling PB confirm order for $mageOrderNumber");
551
+ if (Pb_Pbgsp_Model_Api::confirmOrder($orderNumber->getCpOrderNumber(),$order)) {
552
+ $orderNumber->setConfirmed(true);
553
+ $orderNumber->setReferenced(true);
554
+ $orderNumber->save();
555
+
556
+ /* Update order shipping address in Magento
557
+ Added by: Sudarshan
558
+ Date: 25/09/2015
559
+
560
+ */
561
+ if(Pb_Pbgsp_Model_Credentials::isOverrideShippingAddressEnabled() == '1') {
562
+ try{
563
+ $shippingAddress = Mage::getModel('sales/order_address')->load($order->getShippingAddress()->getId());
564
+
565
+ $shippingAddress
566
+ ->setStreet(array($orderNumber->getHubStreet1(),$orderNumber->getHubStreet2()))
567
+ ->setCity($orderNumber->getHubCity())
568
+ ->setCountry_id($orderNumber->getHubCountry())
569
+ ->setRegion($orderNumber->getHubProvinceOrState())
570
+ ->setPostcode($orderNumber->getHubPostalCode())->save();
571
+ }
572
+ catch(Exception $e) {
573
+ Pb_Pbgsp_Model_Util::log("Error updating shipping address in magento");
574
+ Pb_Pbgsp_Model_Util::logException($e);
575
+ }
576
+
577
+ }
578
+
579
+ Pb_Pbgsp_Model_Util::log(" $mageOrderNumber order is confirmed in PB");
580
+ }
581
+ }
582
+ catch(Exception $ex) {
583
+ Pb_Pbgsp_Model_Util::logException($ex);
584
+ }
585
+ }
586
+
587
+
588
+ }
589
  }
590
  ?>
app/code/local/Pb/Pbgsp/Model/Ordernumber.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Ordernumber.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Ordernumber.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Pdf/Tax.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Pdf/Tax.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Pdf/Tax.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Productattributesource/Productconditions.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
 
7
  */
8
 
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
 
7
  */
8
 
app/code/local/Pb/Pbgsp/Model/Quote/Duty.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Quote/Duty.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Quote/Duty.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Resource/Mysql4/Setup.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Resource/Mysql4/Setup.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Resource/Mysql4/Setup.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Sales/Order/Shipment.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Sales/Order/Shipment.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Sales/Order/Shipment.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Shipmentemail.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/Model/Util.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Util.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
@@ -108,6 +108,11 @@ class Pb_Pbgsp_Model_Util {
108
 
109
  return false;
110
  }
 
 
 
 
 
111
  }
112
 
113
  ?>
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Util.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
108
 
109
  return false;
110
  }
111
+
112
+ public static function endsWith($haystack, $needle) {
113
+ // search forward starting from end minus needle length characters
114
+ return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
115
+ }
116
  }
117
 
118
  ?>
app/code/local/Pb/Pbgsp/Model/Variable.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/Model/Variable.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/controllers/Adminhtml/CategorysettingsController.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  */
7
 
8
  class Pb_Pbgsp_Adminhtml_CategorysettingsController extends Mage_Adminhtml_Controller_Action {
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  */
7
 
8
  class Pb_Pbgsp_Adminhtml_CategorysettingsController extends Mage_Adminhtml_Controller_Action {
app/code/local/Pb/Pbgsp/data/pb_pbgsp_setup/data-install-1.0.0.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Pb_Pbgsp>
5
- <version>1.4.2</version>
6
  </Pb_Pbgsp>
7
  </modules>
8
  <global>
@@ -97,15 +97,15 @@
97
  </pb_pbgsp_read>
98
  </resources>
99
  <events>
100
- <!--<checkout_submit_all_after>&lt;!&ndash; added by Kamran 7/2/2014 &ndash;&gt;-->
101
- <!--<observers>-->
102
- <!--<Pb_Pbgsp_Model_CheckoutSubmitAllAfter>-->
103
- <!--<type>model</type>-->
104
- <!--<class>pb_pbgsp/observer</class>-->
105
- <!--<method>createOrderAdminAfter</method>-->
106
- <!--</Pb_Pbgsp_Model_CheckoutSubmitAllAfter>-->
107
- <!--</observers>-->
108
- <!--</checkout_submit_all_after>-->
109
  <sales_order_shipment_save_after>
110
  <observers>
111
  <Pb_Pbgsp_CreateParcel>
@@ -215,14 +215,14 @@
215
  </shipping>
216
  </helpers>
217
  </global>
218
- <resources>
219
- <sales_setup>
220
- <setup>
221
- <module>Pb_Pbgsp</module>
222
- <class>Pb_Pbgsp_Model_Entity_Setup</class>
223
- </setup>
224
- </sales_setup>
225
- </resources>
226
 
227
  <frontend>
228
  <layout>
2
  <config>
3
  <modules>
4
  <Pb_Pbgsp>
5
+ <version>1.4.3</version>
6
  </Pb_Pbgsp>
7
  </modules>
8
  <global>
97
  </pb_pbgsp_read>
98
  </resources>
99
  <events>
100
+ <checkout_submit_all_after><!-- added by Kamran 11/24/2016 -->
101
+ <observers>
102
+ <Pb_Pbgsp_Model_CheckoutSubmitAllAfter>
103
+ <type>model</type>
104
+ <class>pb_pbgsp/observer</class>
105
+ <method>createOrderAdminAfter</method>
106
+ </Pb_Pbgsp_Model_CheckoutSubmitAllAfter>
107
+ </observers>
108
+ </checkout_submit_all_after>
109
  <sales_order_shipment_save_after>
110
  <observers>
111
  <Pb_Pbgsp_CreateParcel>
215
  </shipping>
216
  </helpers>
217
  </global>
218
+ <!--<resources>-->
219
+ <!--<sales_setup>-->
220
+ <!--<setup>-->
221
+ <!--<module>Pb_Pbgsp</module>-->
222
+ <!--<class>Pb_Pbgsp_Model_Entity_Setup</class>-->
223
+ <!--</setup>-->
224
+ <!--</sales_setup>-->
225
+ <!--</resources>-->
226
 
227
  <frontend>
228
  <layout>
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.0.0-1.0.1.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.1.1-1.1.2.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.2.0-1.2.1.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.3.0-1.3.1.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.3.5-1.3.6.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.4.0-1.4.1.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-upgrade-1.4.1-1.4.2.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Product: Pb_Pbgsp (1.4.2)
4
- * Packaged: 2016-09-21T11:45:00+00:00
5
- * Last Modified: 2016-09-13T10:50:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
1
  <?php
2
  /**
3
+ * Product: Pb_Pbgsp (1.4.3)
4
+ * Packaged: 2016-12-06T09:30:00+00:00
5
+ * Last Modified: 2016-09-21T11:45:00+00:00
6
  * File: app/code/local/Pb/Pbgsp/sql/pbgsp_setup/mysql4-install-1.0.0.php
7
  * Copyright: Copyright (c) 2016 Pitney Bowes <info@pb.com> / All rights reserved.
8
  */
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>pitneybowes_gsp</name>
4
- <version>1.4.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -22,15 +22,21 @@ Providing full international tracking linked from your admin page&#xD;
22
  &lt;/ul&gt;&#xD;
23
  To learn more, go to &lt;a href="http://www.pb.com/ecom"&gt;http://www.pb.com/ecom&lt;/a&gt;&#xD;
24
  </description>
25
- <notes>1. Fixed an error with the AddCommodity At Checkout. Changed category reference from name to ID&#xD;
26
- &#xD;
27
- 2. Updated the tracking link in the Magento admin to link to the new PB tracking URL&#xD;
28
- &#xD;
29
- 3. Fixed an issue with the domestic tracking link in admin to use default tracking link instead of PB tracking link</notes>
 
 
 
 
 
 
30
  <authors><author><name>Shane Bogdan</name><user>pbecommerce</user><email>shane.bogdan@pb.com</email></author></authors>
31
- <date>2016-09-21</date>
32
- <time>15:54:12</time>
33
- <contents><target name="magelocal"><dir name="Pb"><dir name="Pbgsp"><dir name="Block"><dir name="Adminhtml"><dir name="Categorysettings"><file name="Grid.php" hash="e68757f2f8a6f3b8cec19cd40f310218"/></dir><file name="Categorysettings.php" hash="28203620d677c062afb3331706bff473"/><dir name="Sales"><dir name="Order"><dir name="Invoice"><file name="Totals.php" hash="fdff9edd1cf790b559ea15d35ad0071c"/></dir><file name="Totals.php" hash="2afa2d7c71cdb5d202b334a6c755b24f"/></dir></dir><file name="Version.php" hash="819fee219d88e971df8fe56634fcbe38"/></dir><dir name="Checkout"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="13ef8023717fdce768d173a56c42af9b"/></dir></dir></dir><file name="Form.php" hash="95027f7480bacc8185cf1d5635d03d99"/><dir name="Sales"><dir name="Order"><dir name="Invoice"><file name="Totals.php" hash="f3925d1e7f3c38cab80f099c0b198829"/></dir><file name="Totals.php" hash="b56d250a3815373809787da7d891f223"/></dir></dir><dir name="Tax"><dir name="Checkout"><file name="Tax.php" hash="3c2eaf989417bc25f085a5670a0ca9dd"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ce946f57f8c34cffa942aa8f9ac51d45"/><file name="Shipping.php" hash="3d68b32dee60fba0894e168980f9f2ac"/></dir><dir name="Model"><file name="Api.php" hash="cf65cb3a54855071f397aaa2fba98d9e"/><dir name="Carrier"><file name="ShippingMethod.php" hash="2058040f81ced89b33577c99ead8036d"/></dir><dir name="Catalog"><file name="Category.php" hash="ec1e8853c37c0806e497bcfa78b931a2"/><file name="Cron.php" hash="857657fedacc8a15cf9f3a0d2d7f4fc0"/><file name="File.php" hash="5f5dfb04e0d98ed9f4656e5a847a48bb"/><file name="Product.php" hash="8e52afbf96076f37f2633c4d2fc6f4e7"/></dir><file name="Credentials.php" hash="c72531fa817cbb82c3b29a9c7a7f1564"/><dir name="Creditmemo"><file name="Duty.php" hash="f2e075fc27b840c380a09eddc5108136"/></dir><file name="Environmentconfig.php" hash="9c15e82ba4650a7bdb63d13486a378a6"/><file name="Handledata.php" hash="02b05609acedc514ea3a42d12a72c617"/><file name="Handlingoptions.php" hash="fe5a2010db7c6116ee9dff966c341d23"/><file name="Helper.php" hash="12eafb864449f71a5a697f511d8b73be"/><file name="Inboundparcel.php" hash="01fa1ecb09059a692491e06358a9887b"/><dir name="Invoice"><file name="Duty.php" hash="230c541a1eec1a98400e7d33eba1384a"/></dir><file name="Messages.php" hash="b9770fb453799a845fc0ec3ea14b47a1"/><dir name="Mysql4"><dir name="Inboundparcel"><file name="Collection.php" hash="0fdc0fb319a156385351ca502dce67fb"/></dir><file name="Inboundparcel.php" hash="4484865a554650ecb41065cdba599781"/><dir name="Ordernumber"><file name="Collection.php" hash="80f175d36c6a7bfc4fbbb3af44869b25"/></dir><file name="Ordernumber.php" hash="6ff701371ed7b86e2fbd9e612a896d92"/><dir name="Shipmentemail"><file name="Collection.php" hash="0171d55bd117bd29b3ea04aefbe572a1"/></dir><file name="Shipmentemail.php" hash="56271702a906697cf3fbb7e100905a5b"/><dir name="Variable"><file name="Collection.php" hash="9acd320528d2d7ac21996ed08188c635"/></dir><file name="Variable.php" hash="c454710d36ae1fc98befa1470f51d593"/></dir><file name="Newhandlingoptions.php" hash="3c7476b35dfe4b8bea0f10a31b3f4e8a"/><file name="Observer.php" hash="623793d82aec6d0ddbe4e6aa676ddf2f"/><file name="Ordernumber.php" hash="feaddd574c2c871df3225aab8a6ddf13"/><dir name="Pdf"><file name="Tax.php" hash="48cda040593728ec5b6aca08bbaf747f"/></dir><file name="Phonetype.php" hash="9a5a5d3af53a6f137c578ba391626d27"/><dir name="Productattributesource"><file name="Productconditions.php" hash="f6e0986df8003e1e2c8b45f7e7897219"/></dir><dir name="Quote"><file name="Duty.php" hash="54c5eb913cd6462100a8d2ef443e1ee3"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="0f760c32678ae85b07bb0305df70598d"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Shipment.php" hash="d654d4b27a164961b2d5bc42ecaed31e"/></dir></dir><file name="Sellertype.php" hash="0f966b509b0c84ebaedb292abbea8929"/><file name="Shipmentemail.php" hash="66a0c69822a0e645646dfe5d145af4ac"/><file name="Util.php" hash="8a911d7ce589d58923fe317c49efd024"/><file name="Variable.php" hash="3d9f3a552b3bae5e3ef5fb4179582c35"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategorysettingsController.php" hash="c69b002ab5cdb2c8e3b5afce920ca901"/></dir></dir><dir name="data"><dir name="pb_pbgsp_setup"><file name="data-install-1.0.0.php" hash="54ca7505fb0c7ba446d52933804c2777"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="df090fe6dcdfe68acdb012d6e2405cef"/><file name="config.xml" hash="062a41fb06160ccfae484a2d0c73bc91"/><file name="system.xml" hash="3d39b59e89c4b307dadcc4021e7723ef"/></dir><dir name="sql"><dir name="pbgsp_setup"><file name="mysql4-install-1.0.0.php" hash="32cedce0d64b1be126c41429ef5fabb8"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="f1454a90d82c6791cb8baf96e2cfb9ba"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="4c0d6ab3c9e5b94dd28b7b0e0a597298"/><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="0da10ce82060210e4fbb0085afa706c2"/><file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="bb323c6f8c87454a4c40bfa661a696e9"/><file name="mysql4-upgrade-1.3.5-1.3.6.php" hash="0ffce11db7816944eae456bd7dc2a5e7"/><file name="mysql4-upgrade-1.4.0-1.4.1.php" hash="a7f7aad136f08e10c55d1edbe55c776b"/><file name="mysql4-upgrade-1.4.1-1.4.2.php" hash="f8905338abcbff4c678cbda90241d7d3"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Pb_Pbgsp.xml" hash="8475d60d4719f8ea7761a4ca39016e48"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Pb_Clearpath.csv" hash="aa4b7a650feb1709a34b6c053b56811c"/><dir name="template"><dir name="email"><file name="pbgsp_shipment_new.html" hash="0fb628e37654a9768babe0ed06df4960"/></dir></dir></dir></target><target name="mageweb"><dir name="."><file name="ReadMe.txt" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="PBGSP_Manual_Catalog_Export.php" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.1.0</min><max>5.6.10</max></php></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>pitneybowes_gsp</name>
4
+ <version>1.4.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
22
  &lt;/ul&gt;&#xD;
23
  To learn more, go to &lt;a href="http://www.pb.com/ecom"&gt;http://www.pb.com/ecom&lt;/a&gt;&#xD;
24
  </description>
25
+ <notes>1 Fixed error with the AddCommodity At Checkout. Changed the category_name in merchantCatRefId to the category_id. This ensures that the proper catalog reference is consumed by the PB processor.&#xD;
26
+ 2 Added category_name_rev array to reverse the category listing in the api call. This is done to ensure that the appropriate categories are consumed by the processor when there are many layers of categories a product is assigned.&#xD;
27
+ 3 Fixed checkout code to accurately use customer email address on API call when properly set for create order call.&#xA0;&#xD;
28
+ 4 Add logic to enable/disable seller object&#xA0;&#xD;
29
+ 5 Add commodity dimension and weight and COO values to seller object. When seller object is enabled, these values will be passsed to the api on checkout.&#xA0;&#xD;
30
+ 6 Addon logic to not attempt ASN generation if order is already completed&#xA0;&#xD;
31
+ 7 Disabled products will now not be added to the catalog export&#xD;
32
+ 8 Adjusted code in token regeneration logic to use the magento cache object. Now tokens are shared for all users on site vs. being individually generated for each user session.&#xD;
33
+ 9 Optimized code for catalog export by loading all child products of a configurable product in one call&#xD;
34
+ 10 Miscellaneous code comment cleanup.&#xD;
35
+ </notes>
36
  <authors><author><name>Shane Bogdan</name><user>pbecommerce</user><email>shane.bogdan@pb.com</email></author></authors>
37
+ <date>2016-12-06</date>
38
+ <time>19:16:35</time>
39
+ <contents><target name="magelocal"><dir name="Pb"><dir name="Pbgsp"><dir name="Block"><dir name="Adminhtml"><dir name="Categorysettings"><file name="Grid.php" hash="92a8b8037f2ae0a9a7177b71ebec19d4"/></dir><file name="Categorysettings.php" hash="e67c237c6279e6ed3181060a821c31e5"/><dir name="Sales"><dir name="Order"><dir name="Invoice"><file name="Totals.php" hash="120083a14ac95e5289e478f4b46e37b5"/></dir><file name="Totals.php" hash="075bf842f8861531dc9bd7416a0e5c4d"/></dir></dir><file name="Version.php" hash="a4c0f56527ef970488c36021f5191562"/></dir><dir name="Checkout"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="356e2585fa7c5b353fd39d69577d2e95"/></dir></dir></dir><file name="Form.php" hash="95027f7480bacc8185cf1d5635d03d99"/><dir name="Sales"><dir name="Order"><dir name="Invoice"><file name="Totals.php" hash="fde76e65f7cd7fd98c59356eed95b8fe"/></dir><file name="Totals.php" hash="88d122c55c797aaf273ff15d28cc91f1"/></dir></dir><dir name="Tax"><dir name="Checkout"><file name="Tax.php" hash="d862b765fd108f0a6c24100c54a26d0d"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="d721d58b6d69f835504a5ce29ed79d45"/><file name="Shipping.php" hash="3d68b32dee60fba0894e168980f9f2ac"/></dir><dir name="Model"><file name="Api.php" hash="ed5af6769d1d809ac873d76bc41f4afc"/><dir name="Carrier"><file name="ShippingMethod.php" hash="9ac388726e121bd8ab832834fda6c0a3"/></dir><dir name="Catalog"><file name="Category.php" hash="04e27b4394b6fb35e8ab1e8d380062b1"/><file name="Cron.php" hash="89fda011269515a4916b739f9791d890"/><file name="File.php" hash="34e26f034f39fd8908e0a2ac8e3b02be"/><file name="Product.php" hash="a3c34cfeefefe07d8bd468085bdc8b96"/></dir><file name="Credentials.php" hash="5dfae2d3724db9642838374f9daace77"/><dir name="Creditmemo"><file name="Duty.php" hash="e51d0e96529c52fa8174e45456fbecc6"/></dir><file name="Environmentconfig.php" hash="eda69e9e2a4aa988ef934b65567db424"/><file name="Handledata.php" hash="e0bad6e481bef2e4f957fa9b01b18122"/><file name="Handlingoptions.php" hash="05a3a6bd75d8b7bb159ce64ff2184807"/><file name="Helper.php" hash="3433378a3198703f8a48c6062c908417"/><file name="Inboundparcel.php" hash="aecfee4752c81030b60bf4b4c0997540"/><dir name="Invoice"><file name="Duty.php" hash="db02338bdaede332ac1173abee434b73"/></dir><file name="Messages.php" hash="9bcfac0f7df3553c72f325e03fb0e118"/><dir name="Mysql4"><dir name="Inboundparcel"><file name="Collection.php" hash="8812489960dcf03b3bcec019763b6dba"/></dir><file name="Inboundparcel.php" hash="9e968f8202d03b1726caf17621a6e20e"/><dir name="Ordernumber"><file name="Collection.php" hash="b09f77c74747220991e1f38e021d0057"/></dir><file name="Ordernumber.php" hash="6d440bb6661234a830aa0aa6b0350c6d"/><dir name="Shipmentemail"><file name="Collection.php" hash="0012cbc7c94321d9fd48d3ad4125cb9c"/></dir><file name="Shipmentemail.php" hash="3f9fcbc3fa6f253fa657d35fa45e420b"/><dir name="Variable"><file name="Collection.php" hash="e4cb6b44a9347ae584d6c0130612066b"/></dir><file name="Variable.php" hash="c4f19a02aa29db4da03799c4ed82c9ae"/></dir><file name="Newhandlingoptions.php" hash="42ba5709a28e3278d100ee6e6dabfc15"/><file name="Observer.php" hash="d106986757c00f8562c472ff7c614948"/><file name="Ordernumber.php" hash="ece17ac8896a9778797cc75d1f6a026b"/><dir name="Pdf"><file name="Tax.php" hash="ac9cef6e12485154ed6d0c5fd9269563"/></dir><file name="Phonetype.php" hash="9a5a5d3af53a6f137c578ba391626d27"/><dir name="Productattributesource"><file name="Productconditions.php" hash="c4ac8fcd78aebcf5e018a2d904f00783"/></dir><dir name="Quote"><file name="Duty.php" hash="69b232af4ac4c610a7fb1673965ea55b"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="226136ec839a57d8a4b68a02b2d955ed"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Shipment.php" hash="ea1da2ec413f41460c2fb176894570bf"/></dir></dir><file name="Sellertype.php" hash="0f966b509b0c84ebaedb292abbea8929"/><file name="Shipmentemail.php" hash="1b008bc0915541863179ce0dcbe134ae"/><file name="Util.php" hash="1ba319f8bae975c2cdf67968dfd8dc05"/><file name="Variable.php" hash="5ab77d6859fec4492ded69e6f58fe6c2"/><file name=".DS_Store" hash="52a479009bfbaeb0b00b28be339b0ca8"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategorysettingsController.php" hash="1d2b682aaa21460f8aafb0b2da13adc3"/></dir></dir><dir name="data"><dir name="pb_pbgsp_setup"><file name="data-install-1.0.0.php" hash="041112e4e5d5fcce8261baf287ea0cbd"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="df090fe6dcdfe68acdb012d6e2405cef"/><file name="config.xml" hash="d33523f289bd1800b2e1d4078d583bc6"/><file name="system.xml" hash="3d39b59e89c4b307dadcc4021e7723ef"/></dir><dir name="sql"><dir name="pbgsp_setup"><file name="mysql4-install-1.0.0.php" hash="7986a332e422a064e18848d9e6ab1b10"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="bd0277ac3a921f0a517077f97824b38a"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="e95382ee65069319bd33aa9d07e5e8cf"/><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="1a787519c52c966087ad1222596c9731"/><file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="af85ebecca3cce517ef8d231b4d61013"/><file name="mysql4-upgrade-1.3.5-1.3.6.php" hash="083e5a9105272b95411618689c64b81f"/><file name="mysql4-upgrade-1.4.0-1.4.1.php" hash="5c3009360d800141a1d62043ab01c9bd"/><file name="mysql4-upgrade-1.4.1-1.4.2.php" hash="2fb83e70db9dd67bcdd55f6f1095c568"/></dir></dir><file name=".DS_Store" hash="3397feb2cd12716b5dcc2b848462722c"/></dir><file name=".DS_Store" hash="16416c44d4c89d09b0516940dd55abb4"/></dir></target><target name="mageetc"><dir name="modules"><file name="Pb_Pbgsp.xml" hash="8475d60d4719f8ea7761a4ca39016e48"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Pb_Clearpath.csv" hash="aa4b7a650feb1709a34b6c053b56811c"/><dir name="template"><dir name="email"><file name="pbgsp_shipment_new.html" hash="0fb628e37654a9768babe0ed06df4960"/></dir></dir></dir></target><target name="mageweb"><dir name="."><file name="ReadMe.txt" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="PBGSP_Manual_Catalog_Export.php" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target></contents>
40
  <compatible/>
41
  <dependencies><required><php><min>5.1.0</min><max>5.6.10</max></php></required></dependencies>
42
  </package>