CsuMarketSystem_OpteMais - Version 1.3.1

Version Notes

Fix bugs.

Download this release

Release Info

Developer csumarketsystem
Extension CsuMarketSystem_OpteMais
Version 1.3.1
Comparing to
See all releases


Code changes from version 1.3.0 to 1.3.1

app/code/community/CsuMarketSystem/OpteMais/Helper/Data.php CHANGED
@@ -22,7 +22,7 @@ class CsuMarketSystem_OpteMais_Helper_Data extends Mage_Core_Helper_Abstract
22
  const MESSAGE_NOT_FOUND = 'Recurso não encontrado: %s';
23
  const STATUS_CODE_NOT_FOUND = 404;
24
 
25
- const MESSAGE_NOT_AUTHORIZED = 'Usuario inválid.';
26
  const STATUS_CODE_NOT_AUTHORIZED = 401;
27
 
28
  const MESSAGE_INVALID = 'Parâmetros inválidos: %s';
22
  const MESSAGE_NOT_FOUND = 'Recurso não encontrado: %s';
23
  const STATUS_CODE_NOT_FOUND = 404;
24
 
25
+ const MESSAGE_NOT_AUTHORIZED = 'Usuário inválido.';
26
  const STATUS_CODE_NOT_AUTHORIZED = 401;
27
 
28
  const MESSAGE_INVALID = 'Parâmetros inválidos: %s';
app/code/community/CsuMarketSystem/OpteMais/Model/Product.php CHANGED
@@ -70,9 +70,12 @@ class CsuMarketSystem_OpteMais_Model_Product
70
  }
71
  /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */
72
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($child);
73
- $stockQty = intval($stockItem->getQty());
74
- if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
75
- $stockQty -= intval($stockItem->getMinQty());
 
 
 
76
  }
77
  if ($stockQty < 0) {
78
  $stockQty = 0;
@@ -110,9 +113,12 @@ class CsuMarketSystem_OpteMais_Model_Product
110
  continue;
111
  }
112
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($p);
113
- $stockQty = intval($stockItem->getQty());
114
- if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
115
- $stockQty -= intval($stockItem->getMinQty());
 
 
 
116
  }
117
  if ($stockQty < 0) {
118
  $stockQty = 0;
@@ -195,10 +201,14 @@ class CsuMarketSystem_OpteMais_Model_Product
195
 
196
  private function _getAvailabilityDataProducts($product)
197
  {
 
198
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
199
- $stockQty = intval($stockItem->getQty());
200
- if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
201
- $stockQty -= intval($stockItem->getMinQty());
 
 
 
202
  }
203
  if ($stockQty < 0) {
204
  $stockQty = 0;
@@ -508,10 +518,14 @@ class CsuMarketSystem_OpteMais_Model_Product
508
  }
509
  }
510
  }
 
511
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
512
- $stockQty = intval($stockItem->getQty());
513
- if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
514
- $stockQty -= intval($stockItem->getMinQty());
 
 
 
515
  }
516
  if ($stockQty < 0) {
517
  $stockQty = 0;
70
  }
71
  /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */
72
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($child);
73
+ $stockQty = 0;
74
+ if($stockItem->getIsInStock()) {
75
+ $stockQty = intval($stockItem->getQty());
76
+ if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
77
+ $stockQty -= intval($stockItem->getMinQty());
78
+ }
79
  }
80
  if ($stockQty < 0) {
81
  $stockQty = 0;
113
  continue;
114
  }
115
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($p);
116
+ $stockQty = 0;
117
+ if($stockItem->getIsInStock()) {
118
+ $stockQty = intval($stockItem->getQty());
119
+ if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
120
+ $stockQty -= intval($stockItem->getMinQty());
121
+ }
122
  }
123
  if ($stockQty < 0) {
124
  $stockQty = 0;
201
 
202
  private function _getAvailabilityDataProducts($product)
203
  {
204
+ /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */
205
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
206
+ $stockQty = 0;
207
+ if($stockItem->getIsInStock()) {
208
+ $stockQty = intval($stockItem->getQty());
209
+ if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
210
+ $stockQty -= intval($stockItem->getMinQty());
211
+ }
212
  }
213
  if ($stockQty < 0) {
214
  $stockQty = 0;
518
  }
519
  }
520
  }
521
+ /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */
522
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
523
+ $stockQty = 0;
524
+ if($stockItem->getIsInStock()) {
525
+ $stockQty = intval($stockItem->getQty());
526
+ if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
527
+ $stockQty -= intval($stockItem->getMinQty());
528
+ }
529
  }
530
  if ($stockQty < 0) {
531
  $stockQty = 0;
app/code/community/CsuMarketSystem/OpteMais/Model/Shipping.php CHANGED
@@ -81,10 +81,17 @@ class CsuMarketSystem_OpteMais_Model_Shipping
81
  $price = $freightDiscount > 0 && $price > 0
82
  ? $price - ($price * ($freightDiscount / 100))
83
  : $price;
 
 
 
 
 
 
 
84
  $itemsRate['Sku'] = $product->getSku();
85
  $itemsRate['ValorFrete'] = $price;
86
- $itemsRate['QuantidadeEstoque'] = intval($stockItem->getQty());
87
- $itemsRate['FlagDisponivel'] = $stockItem->getQty() > 0;
88
  $itemsRate['TempoEntrega'] = intval($deliveryTime);
89
  $itemsRate['Mensagem'] = $rate->getErrorMessage();
90
  if ($biggestRateDeliveryTime < $deliveryTime) {
81
  $price = $freightDiscount > 0 && $price > 0
82
  ? $price - ($price * ($freightDiscount / 100))
83
  : $price;
84
+ $stockQty = 0;
85
+ if($stockItem->getIsInStock()) {
86
+ $stockQty = intval($stockItem->getQty());
87
+ if (Mage::getStoreConfigFlag('optemais/config_product/discount_min_qty')) {
88
+ $stockQty -= intval($stockItem->getMinQty());
89
+ }
90
+ }
91
  $itemsRate['Sku'] = $product->getSku();
92
  $itemsRate['ValorFrete'] = $price;
93
+ $itemsRate['QuantidadeEstoque'] = $stockQty;
94
+ $itemsRate['FlagDisponivel'] = $stockQty > 0;
95
  $itemsRate['TempoEntrega'] = intval($deliveryTime);
96
  $itemsRate['Mensagem'] = $rate->getErrorMessage();
97
  if ($biggestRateDeliveryTime < $deliveryTime) {
app/code/community/CsuMarketSystem/OpteMais/etc/config.xml CHANGED
@@ -16,7 +16,7 @@
16
  <config>
17
  <modules>
18
  <CsuMarketSystem_OpteMais>
19
- <version>1.3.0</version>
20
  </CsuMarketSystem_OpteMais>
21
  </modules>
22
  <global>
16
  <config>
17
  <modules>
18
  <CsuMarketSystem_OpteMais>
19
+ <version>1.3.1</version>
20
  </CsuMarketSystem_OpteMais>
21
  </modules>
22
  <global>
package.xml CHANGED
@@ -1,20 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>CsuMarketSystem_OpteMais</name>
4
- <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Extens&#xE3;o oficial para integra&#xE7;&#xE3;o com o Marketplace CSU MarketSystem OPTe+</summary>
10
  <description>Tenha sua loja totalmente integrada com o maior e mais completo Shopping de E-Commerce.&#xD;
11
  &#xD;
12
  Para mais informa&#xE7;&#xF5;es: www.optemais.com.br.</description>
13
- <notes>- Ajustes e melhorias.</notes>
14
  <authors><author><name>csumarketsystem</name><user>MAG003432004</user><email>pluginoptemais@csu.com.br</email></author></authors>
15
- <date>2016-09-23</date>
16
- <time>15:15:26</time>
17
- <contents><target name="magecommunity"><dir><dir name="CsuMarketSystem"><dir name="OpteMais"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Campaign"><dir name="Edit"><file name="Form.php" hash="0224ccec20310daa354451bdb885ed94"/><dir name="Tab"><file name="Form.php" hash="b6420075c95c1fac234d6693c554b1b0"/><dir name="Product"><file name="Grid.php" hash="f807064e42b11f90736d7a9dca6e2e32"/></dir></dir><file name="Tabs.php" hash="6192f47626cae96918725c265de897eb"/></dir><file name="Edit.php" hash="5fb37aa5528c5bc139bb63126367ebd8"/><file name="Grid.php" hash="88ca48431fecc2500781f49c00c91020"/><dir name="Item"><dir name="Edit"><file name="Form.php" hash="16e4a16e4462309f91ced2eabf30dcf8"/></dir></dir><file name="Item.php" hash="b4c60842f3a73b173ffb9145c178549a"/></dir><file name="Campaign.php" hash="44884ffbc6464f2d95031f45db33dc85"/><file name="Paymentmethod.php" hash="bb307881cd64c14c15e2f5f7c89fb466"/></dir><dir name="Payment"><dir name="Info"><file name="Modelc.php" hash="0a84f429477de898996b0235b65c20ca"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7a1db5b05bc92cca0f1b4ce4fd3b9aec"/></dir><dir name="Model"><file name="Abstract.php" hash="bf404d2900f5da8c166905ae974344d5"/><dir name="Auth"><dir name="Adapter"><file name="Http.php" hash="849b630e8ce379aee56f967d2b65129f"/></dir></dir><dir name="Campaign"><file name="Item.php" hash="76ee48d568206a365b353b25e923ca02"/></dir><file name="Campaign.php" hash="88e6b37ee7710e604900ef7e7b33b4da"/><dir name="Estimate"><file name="Rate.php" hash="7ab5fc907916144492899e0a526a29ae"/></dir><file name="Observer.php" hash="d40e07a79f07a1d0617ea97a94ec42a6"/><file name="Order.php" hash="9357ef2cb3c3494ac0e38670e4fd0cb8"/><dir name="Payment"><file name="Modelc.php" hash="112fb964895c98495a5a88b580b2720e"/></dir><file name="Product.php" hash="ace237b15c9bca55b14db171cb47317f"/><dir name="Resource"><dir name="Campaign"><file name="Collection.php" hash="e795201d0f518e5e231a69ed4b4016a4"/><dir name="Item"><file name="Collection.php" hash="4e37c2359c649fd9d8a64df7b1ff6915"/></dir><file name="Item.php" hash="8dbba236eda0e15f01b53df639594f63"/></dir><file name="Campaign.php" hash="8d92b66c14476101b684d3bf2f19d985"/></dir><file name="Response.php" hash="46c92e2fde679ce9c68a089143ce9d55"/><file name="Shipping.php" hash="5a3a24a9cb3a76b62ec8b2ca8b4e2be6"/><dir name="Source"><file name="Allattributes.php" hash="635dd51a08d4bf1793b08dfd337bfc5a"/><file name="Attributes.php" hash="a81b2d8547f98268942f9aa5579270b6"/><dir name="Campaign"><file name="Actions.php" hash="be6831dec28e0eac7681fc0cb08cf5bc"/><file name="Statuses.php" hash="e614d614d0a49086693f2a2c28e75158"/></dir><dir name="Customer"><file name="Attributes.php" hash="492032dbe0f81c25d712a50ae123f52d"/></dir><dir name="Select"><file name="Attributes.php" hash="e0761b838ed646a96cc1e7cb80f4fdf0"/></dir><dir name="Shipping"><file name="Pricetype.php" hash="4580b8399fddcad4d6d9a6af9f5a5314"/></dir><file name="Shippingmethods.php" hash="b339f7c3f90f15a8b95f4d3b5d2ecb2c"/><file name="Stores.php" hash="6768255eaacb89d9c72ee8e0e3a232a8"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Optemais"><file name="CampaignController.php" hash="7c2a76bb67fe4238a47e3fc0de5501bd"/></dir></dir><dir name="Api"><file name="OrderController.php" hash="ede2f74890e94f8ee15aa34c9347e5ce"/><file name="ProductController.php" hash="f3c88c8f09d6be7df71af47025e1b4ee"/><file name="ShippingController.php" hash="e78e99c63e183872aca0e7b48f590b14"/></dir><file name="ApiController.php" hash="7893369fc96e4c9ebab1048dc49d9241"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5b9452d590d86a1f072b47f772c2d1ff"/><file name="config.xml" hash="fbfd1ecdc663a6499a5adfa4d0a2b09f"/><file name="system.xml" hash="e9996ff7ba593b6d2c73b7ee3335ac15"/></dir><dir name="sql"><dir name="optemais_setup"><file name="mysql4-install-1.0.0.php" hash="319a1b52745b3c20622346e197854842"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="79f1694a928ea66c85aef99d443fe06c"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="optemais"><dir><dir name="payment"><dir name="info"><file name="modelc.phtml" hash="6c2e5bb34b9ae9c97c291fa3bb9c759f"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="CsuMarketSystem_OpteMais.xml" hash="cf6ea247e3b860f2dac4758ac643a767"/></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>CsuMarketSystem_OpteMais</name>
4
+ <version>1.3.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Extens&#xE3;o oficial para integra&#xE7;&#xE3;o com o Marketplace OPTe+.</summary>
10
  <description>Tenha sua loja totalmente integrada com o maior e mais completo Shopping de E-Commerce.&#xD;
11
  &#xD;
12
  Para mais informa&#xE7;&#xF5;es: www.optemais.com.br.</description>
13
+ <notes>Fix bugs.</notes>
14
  <authors><author><name>csumarketsystem</name><user>MAG003432004</user><email>pluginoptemais@csu.com.br</email></author></authors>
15
+ <date>2016-12-01</date>
16
+ <time>13:52:22</time>
17
+ <contents><target name="magecommunity"><dir><dir name="CsuMarketSystem"><dir name="OpteMais"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Campaign"><dir name="Edit"><file name="Form.php" hash="0224ccec20310daa354451bdb885ed94"/><dir name="Tab"><file name="Form.php" hash="b6420075c95c1fac234d6693c554b1b0"/><dir name="Product"><file name="Grid.php" hash="f807064e42b11f90736d7a9dca6e2e32"/></dir></dir><file name="Tabs.php" hash="6192f47626cae96918725c265de897eb"/></dir><file name="Edit.php" hash="5fb37aa5528c5bc139bb63126367ebd8"/><file name="Grid.php" hash="88ca48431fecc2500781f49c00c91020"/><dir name="Item"><dir name="Edit"><file name="Form.php" hash="16e4a16e4462309f91ced2eabf30dcf8"/></dir></dir><file name="Item.php" hash="b4c60842f3a73b173ffb9145c178549a"/></dir><file name="Campaign.php" hash="44884ffbc6464f2d95031f45db33dc85"/><file name="Paymentmethod.php" hash="bb307881cd64c14c15e2f5f7c89fb466"/></dir><dir name="Payment"><dir name="Info"><file name="Modelc.php" hash="0a84f429477de898996b0235b65c20ca"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7ed3e44ec885bcb67bfa2f2e4eaecf44"/></dir><dir name="Model"><file name="Abstract.php" hash="bf404d2900f5da8c166905ae974344d5"/><dir name="Auth"><dir name="Adapter"><file name="Http.php" hash="849b630e8ce379aee56f967d2b65129f"/></dir></dir><dir name="Campaign"><file name="Item.php" hash="76ee48d568206a365b353b25e923ca02"/></dir><file name="Campaign.php" hash="88e6b37ee7710e604900ef7e7b33b4da"/><dir name="Estimate"><file name="Rate.php" hash="7ab5fc907916144492899e0a526a29ae"/></dir><file name="Observer.php" hash="d40e07a79f07a1d0617ea97a94ec42a6"/><file name="Order.php" hash="9357ef2cb3c3494ac0e38670e4fd0cb8"/><dir name="Payment"><file name="Modelc.php" hash="112fb964895c98495a5a88b580b2720e"/></dir><file name="Product.php" hash="2580c467b24966febd4abfd755c8f64f"/><dir name="Resource"><dir name="Campaign"><file name="Collection.php" hash="e795201d0f518e5e231a69ed4b4016a4"/><dir name="Item"><file name="Collection.php" hash="4e37c2359c649fd9d8a64df7b1ff6915"/></dir><file name="Item.php" hash="8dbba236eda0e15f01b53df639594f63"/></dir><file name="Campaign.php" hash="8d92b66c14476101b684d3bf2f19d985"/></dir><file name="Response.php" hash="46c92e2fde679ce9c68a089143ce9d55"/><file name="Shipping.php" hash="4e4bcae566a5064d53ac2cc63aa61a3f"/><dir name="Source"><file name="Allattributes.php" hash="635dd51a08d4bf1793b08dfd337bfc5a"/><file name="Attributes.php" hash="a81b2d8547f98268942f9aa5579270b6"/><dir name="Campaign"><file name="Actions.php" hash="be6831dec28e0eac7681fc0cb08cf5bc"/><file name="Statuses.php" hash="e614d614d0a49086693f2a2c28e75158"/></dir><dir name="Customer"><file name="Attributes.php" hash="492032dbe0f81c25d712a50ae123f52d"/></dir><dir name="Select"><file name="Attributes.php" hash="e0761b838ed646a96cc1e7cb80f4fdf0"/></dir><dir name="Shipping"><file name="Pricetype.php" hash="4580b8399fddcad4d6d9a6af9f5a5314"/></dir><file name="Shippingmethods.php" hash="b339f7c3f90f15a8b95f4d3b5d2ecb2c"/><file name="Stores.php" hash="6768255eaacb89d9c72ee8e0e3a232a8"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Optemais"><file name="CampaignController.php" hash="7c2a76bb67fe4238a47e3fc0de5501bd"/></dir></dir><dir name="Api"><file name="OrderController.php" hash="ede2f74890e94f8ee15aa34c9347e5ce"/><file name="ProductController.php" hash="f3c88c8f09d6be7df71af47025e1b4ee"/><file name="ShippingController.php" hash="e78e99c63e183872aca0e7b48f590b14"/></dir><file name="ApiController.php" hash="7893369fc96e4c9ebab1048dc49d9241"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5b9452d590d86a1f072b47f772c2d1ff"/><file name="config.xml" hash="d6c01538ed35d22e9bd28b000eb052e4"/><file name="system.xml" hash="e9996ff7ba593b6d2c73b7ee3335ac15"/></dir><dir name="sql"><dir name="optemais_setup"><file name="mysql4-install-1.0.0.php" hash="319a1b52745b3c20622346e197854842"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="79f1694a928ea66c85aef99d443fe06c"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="optemais"><dir><dir name="payment"><dir name="info"><file name="modelc.phtml" hash="6c2e5bb34b9ae9c97c291fa3bb9c759f"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="CsuMarketSystem_OpteMais.xml" hash="cf6ea247e3b860f2dac4758ac643a767"/></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
20
  </package>