Version Notes
Reference API
Download this release
Release Info
| Developer | H5mag |
| Extension | h5mage-commerceapi |
| Version | 0.0.2 |
| Comparing to | |
| See all releases | |
Code changes from version 0.0.1 to 0.0.2
app/code/community/H5mag/ShopApi/Model/Generic.php
CHANGED
|
@@ -87,7 +87,12 @@ class H5mag_ShopApi_Model_Generic extends H5mag_ShopApi_Model_Product {
|
|
| 87 |
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
|
| 88 |
if(isset($parentIds[0])){
|
| 89 |
$parent = Mage::getModel('catalog/product')->load($parentIds[0]);
|
| 90 |
-
$variants = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
} else {
|
| 92 |
$variants[] = $product;
|
| 93 |
}
|
|
@@ -102,7 +107,8 @@ class H5mag_ShopApi_Model_Generic extends H5mag_ShopApi_Model_Product {
|
|
| 102 |
$data = array();
|
| 103 |
$data['currency'] = $store->getCurrentCurrencyCode();
|
| 104 |
$data['id'] = $variant->getSku(); // Send the SKU instead of the actual database id
|
| 105 |
-
$data['name'] = $variant->getName();
|
|
|
|
| 106 |
$data['price'] = $variant->getPrice() * 100; // H5mag uses cents
|
| 107 |
$data['pictures'] = array();
|
| 108 |
$data['stock'] = 0;
|
| 87 |
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
|
| 88 |
if(isset($parentIds[0])){
|
| 89 |
$parent = Mage::getModel('catalog/product')->load($parentIds[0]);
|
| 90 |
+
$variants = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$parent);
|
| 91 |
+
$variants_list = array();
|
| 92 |
+
foreach($variants as $variant) {
|
| 93 |
+
array_push($variants_list, Mage::getModel('catalog/product')->load($variant->getId()));
|
| 94 |
+
}
|
| 95 |
+
$variants = $variants_list;
|
| 96 |
} else {
|
| 97 |
$variants[] = $product;
|
| 98 |
}
|
| 107 |
$data = array();
|
| 108 |
$data['currency'] = $store->getCurrentCurrencyCode();
|
| 109 |
$data['id'] = $variant->getSku(); // Send the SKU instead of the actual database id
|
| 110 |
+
$data['name'] = $variant->getName();
|
| 111 |
+
var_dump($variant);
|
| 112 |
$data['price'] = $variant->getPrice() * 100; // H5mag uses cents
|
| 113 |
$data['pictures'] = array();
|
| 114 |
$data['stock'] = 0;
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>h5mage-commerceapi</name>
|
| 4 |
-
<version>0.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.h5mag.com">Open Software License (OSL 3.0)</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -10,9 +10,9 @@
|
|
| 10 |
<description>Sell your products through your H5mag online magazine</description>
|
| 11 |
<notes>Reference API</notes>
|
| 12 |
<authors><author><name>H5mag</name><user>h5mag</user><email>info@h5mag.com</email></author></authors>
|
| 13 |
-
<date>2015-08-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="mageetc"><dir><dir name="modules"><file name="H5mag_ShopApi.xml" hash="a7f3540be0ca960e3c4342c97ff10611"/></dir></dir></target><target name="magecommunity"><dir><dir name="H5mag"><dir name="ShopApi"><dir name="Model"><file name="Generic.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.3.10</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>h5mage-commerceapi</name>
|
| 4 |
+
<version>0.0.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.h5mag.com">Open Software License (OSL 3.0)</license>
|
| 7 |
<channel>community</channel>
|
| 10 |
<description>Sell your products through your H5mag online magazine</description>
|
| 11 |
<notes>Reference API</notes>
|
| 12 |
<authors><author><name>H5mag</name><user>h5mag</user><email>info@h5mag.com</email></author></authors>
|
| 13 |
+
<date>2015-08-20</date>
|
| 14 |
+
<time>13:57:35</time>
|
| 15 |
+
<contents><target name="mageetc"><dir><dir name="modules"><file name="H5mag_ShopApi.xml" hash="a7f3540be0ca960e3c4342c97ff10611"/></dir></dir></target><target name="magecommunity"><dir><dir name="H5mag"><dir name="ShopApi"><dir name="Model"><file name="Generic.php" hash="9e22a439073e15e2da7c66f9ba6e31f2"/><dir name="Order"><file name="Observer.php" hash="d6d859b3d426db207a0f26b9c09dc8cf"/></dir><file name="Product.php" hash="61fc08e108376c890e4ad4cb60aba130"/></dir><dir name="controllers"><file name="CheckoutController.php" hash="4198c5faf44b0d5896948cb9e3f48a14"/><file name="IndexController.php" hash="48f95ac755532b43f22b04dde8e85f19"/></dir><dir name="etc"><file name="adminhtml.xml" hash="4d5313c01a1c7eb331ec9e14b05de9a3"/><file name="config.xml" hash="49001110e909ff73da3765fb9e6195a7"/><file name="system.xml" hash="87c0aa8a8201293ce9d3aa762ea37707"/></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="h5mag"><dir name="shopapi"><file name="emptycart.phtml" hash="858809d6c1b4f3301f7716fcc751ef05"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.3.10</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
