Version Notes
If you wish to integrate Magento with Volo, then please contact your account manager at Volo.
Download this release
Release Info
| Developer | Volo |
| Extension | eSellerProPlugin |
| Version | 1.1.1.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.1.1 to 1.1.1.2
- app/code/local/Sandbourne/BulkApi/Helper/Image.php +35 -26
- app/code/local/Sandbourne/BulkApi/Helper/Prices.php +134 -0
- app/code/local/Sandbourne/BulkApi/Helper/TestData.php +9 -4
- app/code/local/Sandbourne/BulkApi/Model/FullProduct/Api.php +23 -9
- app/code/local/Sandbourne/BulkApi/Model/PartialProduct/Api.php +8 -6
- package.xml +4 -4
app/code/local/Sandbourne/BulkApi/Helper/Image.php
CHANGED
|
@@ -17,33 +17,37 @@ class Sandbourne_BulkApi_Helper_Image extends Mage_Core_Helper_Abstract
|
|
| 17 |
|
| 18 |
$imageIndex = 0;
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
{
|
| 22 |
-
$image = $this->findImage($espImageUrl, $magentoImageList);
|
| 23 |
|
| 24 |
-
|
| 25 |
-
if ($image == NULL) // For ==; NULL, false, 0, and empty string are equal.
|
| 26 |
{
|
| 27 |
-
|
| 28 |
-
// Need to create the image. Add it to the list to return to eSellerPro.
|
| 29 |
-
// eSellerPro will then download the images and pass the image data to Magento.
|
| 30 |
-
$requiredImageXMLData = new DOMElement('RequiredImage');
|
| 31 |
-
$requiredImagesXMLData->appendChild($requiredImageXMLData);
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
}
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
}
|
| 42 |
-
// Now we have all the images are they in the right order
|
| 43 |
-
//$this->repositionImages($magentoProduct, $productData);
|
| 44 |
-
// Set the first immage as the gallery image
|
| 45 |
-
$this->setFirstImageAsBase($magentoProduct);
|
| 46 |
-
//$this->_debug($magentoProduct['media_gallery']);
|
| 47 |
}
|
| 48 |
|
| 49 |
public function findImage($espImageUrl, $imageList)
|
|
@@ -59,13 +63,18 @@ class Sandbourne_BulkApi_Helper_Image extends Mage_Core_Helper_Abstract
|
|
| 59 |
//$imagePattern = '/'.$pathInfo['filename'].'[\d_]*\.'.$pathInfo['extension'].'/';
|
| 60 |
//$imagePattern = '/'.$pathInfo['filename'].'_\d+\.'.$pathInfo['extension'].'/';
|
| 61 |
$imagePattern = '/'.$temp.'[\d_]*\.'.$pathInfo['extension'].'/';
|
| 62 |
-
|
|
|
|
|
|
|
| 63 |
{
|
| 64 |
-
|
| 65 |
-
if (preg_match($imagePattern, $image['file']) === 1)
|
| 66 |
{
|
| 67 |
-
//$this->_debug('
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
}
|
| 71 |
return "";
|
| 17 |
|
| 18 |
$imageIndex = 0;
|
| 19 |
|
| 20 |
+
// Check we actually have images otherwise we generate an unnecessary error.
|
| 21 |
+
if ($productData->Images->ImageURL != NULL)
|
| 22 |
{
|
|
|
|
| 23 |
|
| 24 |
+
foreach ($productData->Images->ImageURL as $espImageUrl)
|
|
|
|
| 25 |
{
|
| 26 |
+
$image = $this->findImage($espImageUrl, $magentoImageList);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
//if (is_null($image))
|
| 29 |
+
if ($image == NULL) // For ==; NULL, false, 0, and empty string are equal.
|
| 30 |
+
{
|
| 31 |
+
//$this->_debug('$image is_null '.$espImageUrl);
|
| 32 |
+
// Need to create the image. Add it to the list to return to eSellerPro.
|
| 33 |
+
// eSellerPro will then download the images and pass the image data to Magento.
|
| 34 |
+
$requiredImageXMLData = new DOMElement('RequiredImage');
|
| 35 |
+
$requiredImagesXMLData->appendChild($requiredImageXMLData);
|
| 36 |
+
$requiredImageXMLData->appendChild(new DOMElement('URL', $espImageUrl));
|
| 37 |
+
$requiredImageXMLData->appendChild(new DOMElement('ImageIndex', $imageIndex));
|
| 38 |
+
}
|
| 39 |
+
else
|
| 40 |
+
{
|
| 41 |
+
$this->setImagePosition($magentoProduct, $image, $imageIndex);
|
| 42 |
+
}
|
| 43 |
+
$imageIndex++;
|
| 44 |
}
|
| 45 |
+
// Now we have all the images are they in the right order
|
| 46 |
+
//$this->repositionImages($magentoProduct, $productData);
|
| 47 |
+
// Set the first immage as the gallery image
|
| 48 |
+
$this->setFirstImageAsBase($magentoProduct);
|
| 49 |
+
//$this->_debug($magentoProduct['media_gallery']);
|
| 50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
public function findImage($espImageUrl, $imageList)
|
| 63 |
//$imagePattern = '/'.$pathInfo['filename'].'[\d_]*\.'.$pathInfo['extension'].'/';
|
| 64 |
//$imagePattern = '/'.$pathInfo['filename'].'_\d+\.'.$pathInfo['extension'].'/';
|
| 65 |
$imagePattern = '/'.$temp.'[\d_]*\.'.$pathInfo['extension'].'/';
|
| 66 |
+
|
| 67 |
+
// Check we actually have an image list otherwise we generate an unnecessary error.
|
| 68 |
+
if ($imageList != NULL)
|
| 69 |
{
|
| 70 |
+
foreach ($imageList as $image)
|
|
|
|
| 71 |
{
|
| 72 |
+
//$this->_debug('looking at '.$image['file']);
|
| 73 |
+
if (preg_match($imagePattern, $image['file']) === 1)
|
| 74 |
+
{
|
| 75 |
+
//$this->_debug('found '.$espFilename);
|
| 76 |
+
return $image;
|
| 77 |
+
}
|
| 78 |
}
|
| 79 |
}
|
| 80 |
return "";
|
app/code/local/Sandbourne/BulkApi/Helper/Prices.php
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* Prices Helper Class.
|
| 6 |
+
* @author Jason Cyphus
|
| 7 |
+
*
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
class Sandbourne_BulkApi_Helper_Prices extends Mage_Core_Helper_Abstract
|
| 11 |
+
{
|
| 12 |
+
public function __construct()
|
| 13 |
+
{
|
| 14 |
+
//$this->_debug('Price Data Helper constructed');
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
public function scalePrices($product)
|
| 18 |
+
{
|
| 19 |
+
/**
|
| 20 |
+
* $product = The current product we have saved to Magento
|
| 21 |
+
*
|
| 22 |
+
* Populate the configurable product (master), super product attributes configuration table.
|
| 23 |
+
* Whether we are updating just the configurable product (master), a simple product (variation) or both,
|
| 24 |
+
* we need to calculate all the prices to stay in sync.
|
| 25 |
+
*/
|
| 26 |
+
|
| 27 |
+
// Get the configurable Id
|
| 28 |
+
$configurableId = $this->getConfigurableId($product);
|
| 29 |
+
|
| 30 |
+
// Check we actually have a configurable product
|
| 31 |
+
if ($configurableId > 0)
|
| 32 |
+
{
|
| 33 |
+
// Get the configurable product and associated base price
|
| 34 |
+
// Please note the price will not be the actual configurable, price but the cheapest price from all the simple products
|
| 35 |
+
$configurableProduct = Mage::getSingleton("catalog/Product")->load($configurableId);
|
| 36 |
+
$configurablePrice = $configurableProduct->getPrice();
|
| 37 |
+
|
| 38 |
+
// Get current attribute data
|
| 39 |
+
$configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();
|
| 40 |
+
$configurableProductsData = array();
|
| 41 |
+
|
| 42 |
+
// We need to identify the attribute name and Id
|
| 43 |
+
$prodAttrName = $this->getAttributeName($configurableProduct);
|
| 44 |
+
$prodAttrId = $this->getAttributeId($prodAttrName);
|
| 45 |
+
|
| 46 |
+
// Get associates simple products
|
| 47 |
+
$associatedProducts = $configurableProduct->getTypeInstance()->getUsedProducts();
|
| 48 |
+
foreach ($associatedProducts as $prodList)
|
| 49 |
+
{
|
| 50 |
+
// For each associated simple product gather the data and calculate the extra fixed price
|
| 51 |
+
$prodId = $prodList->getId();
|
| 52 |
+
$prodAttrLabel = $prodList->getAttributeText($prodAttrName);
|
| 53 |
+
$prodAttrValueIndex = $prodList[$prodAttrName];
|
| 54 |
+
$prodScalePrice = $prodList['price'] - $configurablePrice;
|
| 55 |
+
|
| 56 |
+
$productData = array(
|
| 57 |
+
'label' => $prodAttrLabel,
|
| 58 |
+
'attribute_id' => $prodAttrId,
|
| 59 |
+
'value_index' => $prodAttrValueIndex,
|
| 60 |
+
'pricing_value' => $prodScalePrice,
|
| 61 |
+
'is_percent' => '0'
|
| 62 |
+
);
|
| 63 |
+
$configurableProductsData[$prodId] = $productData;
|
| 64 |
+
$configurableAttributesData[0]['values'][] = $productData;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
$configurableProduct->setConfigurableProductsData($configurableProductsData);
|
| 68 |
+
$configurableProduct->setConfigurableAttributesData($configurableAttributesData);
|
| 69 |
+
$configurableProduct->setCanSaveConfigurableAttributes(true);
|
| 70 |
+
Mage::log($configurableProductsData, null, 'configurableProductsData.log', true);
|
| 71 |
+
Mage::log($configurableAttributesData, null, 'configurableAttributesData.log', true);
|
| 72 |
+
|
| 73 |
+
try
|
| 74 |
+
{
|
| 75 |
+
$configurableProduct->save();
|
| 76 |
+
}
|
| 77 |
+
catch (Exception $e)
|
| 78 |
+
{
|
| 79 |
+
$this->_debug($e->getMessage());
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
public function getConfigurableId($product)
|
| 86 |
+
{
|
| 87 |
+
$configurableId = 0;
|
| 88 |
+
|
| 89 |
+
if ($product->getTypeId() == 'simple')
|
| 90 |
+
{
|
| 91 |
+
// Grab the simple product Id, to find the configurable product Id
|
| 92 |
+
$simpleId = $product->getID();
|
| 93 |
+
$parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($simpleId);
|
| 94 |
+
if ($parentIds != null)
|
| 95 |
+
{
|
| 96 |
+
$configproduct = Mage::getModel('catalog/product')->load($parentIds[0]);
|
| 97 |
+
$configurableId = $configproduct->getId();
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
else // We are already on the configurable product
|
| 101 |
+
{
|
| 102 |
+
$configurableId = $product->getID();
|
| 103 |
+
}
|
| 104 |
+
return $configurableId;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
public function getAttributeName($configurableProduct)
|
| 108 |
+
{
|
| 109 |
+
$attrs = $configurableProduct->getTypeInstance(true)->getConfigurableAttributesAsArray($configurableProduct);
|
| 110 |
+
//foreach($attrs as $attr)
|
| 111 |
+
//{
|
| 112 |
+
// $this->_debug($attr['attribute_code']);
|
| 113 |
+
// $options = $attr['values'];
|
| 114 |
+
// foreach($options as $option)
|
| 115 |
+
// {
|
| 116 |
+
// $this->_debug($option['store_label']);
|
| 117 |
+
// }
|
| 118 |
+
//}
|
| 119 |
+
return($attrs[0]['attribute_code']);
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
public function getAttributeId($prodAttrName)
|
| 123 |
+
{
|
| 124 |
+
$attrDetails = Mage::getSingleton("eav/config")->getAttribute('catalog_product', $prodAttrName);
|
| 125 |
+
$attribute = $attrDetails->getData();
|
| 126 |
+
$prodAttrId = $attribute['attribute_id'];
|
| 127 |
+
return $prodAttrId;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
public function _debug($message)
|
| 131 |
+
{
|
| 132 |
+
Mage::log($message);
|
| 133 |
+
}
|
| 134 |
+
}
|
app/code/local/Sandbourne/BulkApi/Helper/TestData.php
CHANGED
|
@@ -15,13 +15,18 @@ class Sandbourne_BulkApi_Helper_TestData extends Mage_Core_Helper_Abstract
|
|
| 15 |
public function loadTestData()
|
| 16 |
{
|
| 17 |
/*
|
| 18 |
-
* Insert the below
|
| 19 |
-
*
|
| 20 |
-
*
|
|
|
|
|
|
|
|
|
|
| 21 |
* $utils = Mage::helper('bulkapi/testData');
|
| 22 |
* $productXML = $utils->loadTestData();
|
| 23 |
* $this->_debug($productXML);
|
| 24 |
-
*
|
|
|
|
|
|
|
| 25 |
*/
|
| 26 |
|
| 27 |
$testData = '<?xml version="1.0" encoding="UTF-8"?><FullProductsUpdate batch="141" version="1.0">
|
| 15 |
public function loadTestData()
|
| 16 |
{
|
| 17 |
/*
|
| 18 |
+
* Insert the below at around line 28 in FullProduct Api.php
|
| 19 |
+
*
|
| 20 |
+
* $productXMLData = simplexml_load_string($productXML);
|
| 21 |
+
* -----
|
| 22 |
+
* Testing XML
|
| 23 |
+
* Comment these lines out if no testing is required.
|
| 24 |
* $utils = Mage::helper('bulkapi/testData');
|
| 25 |
* $productXML = $utils->loadTestData();
|
| 26 |
* $this->_debug($productXML);
|
| 27 |
+
* Testing XML
|
| 28 |
+
* -----
|
| 29 |
+
* $attributeHelper = Mage::helper('bulkapi/attribute');
|
| 30 |
*/
|
| 31 |
|
| 32 |
$testData = '<?xml version="1.0" encoding="UTF-8"?><FullProductsUpdate batch="141" version="1.0">
|
app/code/local/Sandbourne/BulkApi/Model/FullProduct/Api.php
CHANGED
|
@@ -16,7 +16,9 @@ class Sandbourne_BulkApi_Model_FullProduct_Api extends Mage_Api_Model_Resource_A
|
|
| 16 |
//return "1.1.0.2"; // 20150421
|
| 17 |
//return "1.1.0.3"; // 20150618
|
| 18 |
//return "1.1.1.0"; // 20150724 (enhancements 88826, 88828)
|
| 19 |
-
return "1.1.1.1"; // 20150730 (improvement 88168)
|
|
|
|
|
|
|
| 20 |
}
|
| 21 |
|
| 22 |
public function update($productXML)
|
|
@@ -25,13 +27,6 @@ class Sandbourne_BulkApi_Model_FullProduct_Api extends Mage_Api_Model_Resource_A
|
|
| 25 |
$productResultsXMLData = $resultXMLData->createElement('ProductResults');
|
| 26 |
$resultXMLData->appendChild($productResultsXMLData);
|
| 27 |
$productXMLData = simplexml_load_string($productXML);
|
| 28 |
-
|
| 29 |
-
// Testing XML
|
| 30 |
-
// Comment these lines out if no testing is required.
|
| 31 |
-
//$utils = Mage::helper('bulkapi/testData');
|
| 32 |
-
//$productXML = $utils->loadTestData();
|
| 33 |
-
//$this->_debug($productXML);
|
| 34 |
-
// Testing XML
|
| 35 |
|
| 36 |
$attributeHelper = Mage::helper('bulkapi/attribute');
|
| 37 |
$defaultAttributeSetId = $attributeHelper->getDefaultAttributeSetId();
|
|
@@ -138,6 +133,13 @@ class Sandbourne_BulkApi_Model_FullProduct_Api extends Mage_Api_Model_Resource_A
|
|
| 138 |
$configurableHelper->setConfigurableProducts($product, $productData, $attributeCache);
|
| 139 |
}
|
| 140 |
$product->save();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
}
|
| 142 |
}
|
| 143 |
|
|
@@ -147,6 +149,19 @@ class Sandbourne_BulkApi_Model_FullProduct_Api extends Mage_Api_Model_Resource_A
|
|
| 147 |
$magentoProduct->setName($title);
|
| 148 |
$magentoProduct->setMetaTitle($title);
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
// Make a double check we have the visibility of the product correct
|
| 151 |
if ((string)$productData->SKUType == "Sub")
|
| 152 |
{
|
|
@@ -250,7 +265,6 @@ class Sandbourne_BulkApi_Model_FullProduct_Api extends Mage_Api_Model_Resource_A
|
|
| 250 |
if (stripos($taxCode, "|"))
|
| 251 |
{
|
| 252 |
list($strIgnore, $strNumber) = array_pad(explode("|", $taxCode, 2), 2, "2");
|
| 253 |
-
$this->_debug($strNumber . " = " . intval($strNumber));
|
| 254 |
$retVal = intval($strNumber);
|
| 255 |
}
|
| 256 |
else
|
| 16 |
//return "1.1.0.2"; // 20150421
|
| 17 |
//return "1.1.0.3"; // 20150618
|
| 18 |
//return "1.1.1.0"; // 20150724 (enhancements 88826, 88828)
|
| 19 |
+
//return "1.1.1.1"; // 20150730 (improvement 88168)
|
| 20 |
+
return "1.1.1.2"; // 20151125 (Change request be Creative)
|
| 21 |
+
//return "1.1.2.0"; // 20151012 (scale prices 92003 - Needs Testing)
|
| 22 |
}
|
| 23 |
|
| 24 |
public function update($productXML)
|
| 27 |
$productResultsXMLData = $resultXMLData->createElement('ProductResults');
|
| 28 |
$resultXMLData->appendChild($productResultsXMLData);
|
| 29 |
$productXMLData = simplexml_load_string($productXML);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
$attributeHelper = Mage::helper('bulkapi/attribute');
|
| 32 |
$defaultAttributeSetId = $attributeHelper->getDefaultAttributeSetId();
|
| 133 |
$configurableHelper->setConfigurableProducts($product, $productData, $attributeCache);
|
| 134 |
}
|
| 135 |
$product->save();
|
| 136 |
+
|
| 137 |
+
// After we have saved all the details, lets check to see if we need to update variation scale prices.
|
| 138 |
+
if (strcmp($productData->ScalePricing,'Y') == 0)
|
| 139 |
+
{
|
| 140 |
+
//$pricesHelper = Mage::helper('bulkapi/prices');
|
| 141 |
+
//$pricesHelper->scalePrices($product);
|
| 142 |
+
}
|
| 143 |
}
|
| 144 |
}
|
| 145 |
|
| 149 |
$magentoProduct->setName($title);
|
| 150 |
$magentoProduct->setMetaTitle($title);
|
| 151 |
|
| 152 |
+
// Change request be Creative.
|
| 153 |
+
// Set release date
|
| 154 |
+
if ((string)$productData->NewRelease == "Y" && $date = (string)$productData->ReleaseDate)
|
| 155 |
+
{
|
| 156 |
+
$magentoProduct->setData('news_from_date', $date);
|
| 157 |
+
$magentoProduct->setData('news_to_date', date("Y-m-d", strtotime("+2 weeks",strtotime($date))));
|
| 158 |
+
}
|
| 159 |
+
else
|
| 160 |
+
{
|
| 161 |
+
$magentoProduct->setData('news_from_date', "");
|
| 162 |
+
$magentoProduct->setData('news_to_date', "");
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
// Make a double check we have the visibility of the product correct
|
| 166 |
if ((string)$productData->SKUType == "Sub")
|
| 167 |
{
|
| 265 |
if (stripos($taxCode, "|"))
|
| 266 |
{
|
| 267 |
list($strIgnore, $strNumber) = array_pad(explode("|", $taxCode, 2), 2, "2");
|
|
|
|
| 268 |
$retVal = intval($strNumber);
|
| 269 |
}
|
| 270 |
else
|
app/code/local/Sandbourne/BulkApi/Model/PartialProduct/Api.php
CHANGED
|
@@ -17,7 +17,6 @@ class Sandbourne_BulkApi_Model_PartialProduct_Api extends Mage_Api_Model_Resourc
|
|
| 17 |
|
| 18 |
foreach ($productXMLData as $productData)
|
| 19 |
{
|
| 20 |
-
//$this->_debug($productData->StockNumber);
|
| 21 |
$productResultXMLData = new DOMElement('ProductResult');
|
| 22 |
$productResultsXMLData->appendChild($productResultXMLData);
|
| 23 |
$this->updateProduct($productData, $productResultXMLData);
|
|
@@ -29,7 +28,6 @@ class Sandbourne_BulkApi_Model_PartialProduct_Api extends Mage_Api_Model_Resourc
|
|
| 29 |
$productID = Mage::getModel('catalog/product')->getIdBySku($productData->StockNumber);
|
| 30 |
if ($productID > 0)
|
| 31 |
{
|
| 32 |
-
//$this->_debug('product exists with id:'.$productID);
|
| 33 |
$product = Mage::getModel('catalog/product')->load($productID);
|
| 34 |
|
| 35 |
$active = ((string)$productData->IsActive === 'Y' ?
|
|
@@ -59,12 +57,16 @@ class Sandbourne_BulkApi_Model_PartialProduct_Api extends Mage_Api_Model_Resourc
|
|
| 59 |
//$inStock = ($productData->StockLevel > 0 ? 1 : 0);
|
| 60 |
//$stockData['is_in_stock'] = $inStock;
|
| 61 |
$stockData['is_in_stock'] = 1;
|
| 62 |
-
|
| 63 |
-
//$this->_debug($productData);
|
| 64 |
-
//$this->_debug($stockData);
|
| 65 |
-
|
| 66 |
$product->setStockData($stockData);
|
| 67 |
$product->save();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
}
|
| 69 |
}
|
| 70 |
|
| 17 |
|
| 18 |
foreach ($productXMLData as $productData)
|
| 19 |
{
|
|
|
|
| 20 |
$productResultXMLData = new DOMElement('ProductResult');
|
| 21 |
$productResultsXMLData->appendChild($productResultXMLData);
|
| 22 |
$this->updateProduct($productData, $productResultXMLData);
|
| 28 |
$productID = Mage::getModel('catalog/product')->getIdBySku($productData->StockNumber);
|
| 29 |
if ($productID > 0)
|
| 30 |
{
|
|
|
|
| 31 |
$product = Mage::getModel('catalog/product')->load($productID);
|
| 32 |
|
| 33 |
$active = ((string)$productData->IsActive === 'Y' ?
|
| 57 |
//$inStock = ($productData->StockLevel > 0 ? 1 : 0);
|
| 58 |
//$stockData['is_in_stock'] = $inStock;
|
| 59 |
$stockData['is_in_stock'] = 1;
|
| 60 |
+
|
|
|
|
|
|
|
|
|
|
| 61 |
$product->setStockData($stockData);
|
| 62 |
$product->save();
|
| 63 |
+
|
| 64 |
+
// After we have saved all the details, lets check to see if we need to update variation scale prices.
|
| 65 |
+
if (strcmp($productData->ScalePricing,'Y') == 0)
|
| 66 |
+
{
|
| 67 |
+
//$pricesHelper = Mage::helper('bulkapi/prices');
|
| 68 |
+
//$pricesHelper->scalePrices($product);
|
| 69 |
+
}
|
| 70 |
}
|
| 71 |
}
|
| 72 |
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>eSellerProPlugin</name>
|
| 4 |
-
<version>1.1.1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -19,9 +19,9 @@
|
|
| 19 |
<p>For more information about how <a href="http://www.volocommerce.com/">Volo</a> and Magento can help you and your business achieve its full potential, please contact <a href="mailto:sales_uk@volocommerce.com">sales_uk@volocommerce.com</a> or visit <a href="http://www.volocommerce.com/">www.volocommerce.com</a></p></description>
|
| 20 |
<notes>If you wish to integrate Magento with Volo, then please contact your account manager at Volo.</notes>
|
| 21 |
<authors><author><name>Volo</name><user>Volo</user><email>magento@volocommerce.com</email></author></authors>
|
| 22 |
-
<date>2015-
|
| 23 |
-
<time>
|
| 24 |
-
<contents><target name="magelocal"><dir name="Sandbourne"><dir name="BulkApi"><dir name="Helper"><file name="Array.php" hash="0a04d7af6b6d84fed6d1a0097a558abf"/><file name="Attribute.php" hash="b02d50e3f8a69a90e9d44026febfc4bf"/><file name="AttributeCache.php" hash="258e7fd95a78ff62ff121f4a4776a3a8"/><file name="AttributeOptionCache.php" hash="be30b904d71df0f46f62ed77d6e2fc93"/><file name="Category.php" hash="8d35ba24b7d4d4650d711b61c373cc6e"/><file name="CategoryCache.php" hash="9201e35bd5e461e5483ea9b66b1306d0"/><file name="ConfigurableProduct.php" hash="6127acd0c0d96a864ed6294ef5445ebd"/><file name="Data.php" hash="7aa739540136122fdba1fa12c72a9cad"/><file name="Image.php" hash="
|
| 25 |
<compatible/>
|
| 26 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min/><max/></package></required></dependencies>
|
| 27 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>eSellerProPlugin</name>
|
| 4 |
+
<version>1.1.1.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
| 7 |
<channel>community</channel>
|
| 19 |
<p>For more information about how <a href="http://www.volocommerce.com/">Volo</a> and Magento can help you and your business achieve its full potential, please contact <a href="mailto:sales_uk@volocommerce.com">sales_uk@volocommerce.com</a> or visit <a href="http://www.volocommerce.com/">www.volocommerce.com</a></p></description>
|
| 20 |
<notes>If you wish to integrate Magento with Volo, then please contact your account manager at Volo.</notes>
|
| 21 |
<authors><author><name>Volo</name><user>Volo</user><email>magento@volocommerce.com</email></author></authors>
|
| 22 |
+
<date>2015-11-26</date>
|
| 23 |
+
<time>10:29:47</time>
|
| 24 |
+
<contents><target name="magelocal"><dir name="Sandbourne"><dir name="BulkApi"><dir name="Helper"><file name="Array.php" hash="0a04d7af6b6d84fed6d1a0097a558abf"/><file name="Attribute.php" hash="b02d50e3f8a69a90e9d44026febfc4bf"/><file name="AttributeCache.php" hash="258e7fd95a78ff62ff121f4a4776a3a8"/><file name="AttributeOptionCache.php" hash="be30b904d71df0f46f62ed77d6e2fc93"/><file name="Category.php" hash="8d35ba24b7d4d4650d711b61c373cc6e"/><file name="CategoryCache.php" hash="9201e35bd5e461e5483ea9b66b1306d0"/><file name="ConfigurableProduct.php" hash="6127acd0c0d96a864ed6294ef5445ebd"/><file name="Data.php" hash="7aa739540136122fdba1fa12c72a9cad"/><file name="Image.php" hash="19a5c6f3859e3961fc3e4cd155c59c75"/><file name="Prices.php" hash="a1a1772279a05cd7bdfe981439cac7bd"/><file name="RelatedProducts.php" hash="e927612b277080a5c835d0ceebd8598c"/><file name="TestData.php" hash="71aca3edc71e31b9738d37011109e5f3"/><file name="Utils.php" hash="29beb209f25ab4a462051be7fa6c681b"/><file name="Website.php" hash="0e67b9ba7cd1bbfe8c840991d0aa3079"/></dir><dir name="Model"><dir name="FullImage"><dir name="Api"><file name="V2.php" hash="d998bacd61159399567d1c46e63507a2"/></dir><file name="Api.php" hash="fcff5388032e5cde7485314c6a1d3bf2"/></dir><dir name="FullProduct"><dir name="Api"><file name="V2.php" hash="3cfb906b7c4c72906e3baccb4fdeee40"/></dir><file name="Api.php" hash="4ad21ca3a44f12ea3d434f7d9281b796"/></dir><dir name="PartialProduct"><dir name="Api"><file name="V2.php" hash="5e9375e74f6ba74bb79f20cce7574ba7"/></dir><file name="Api.php" hash="ad0fae2fade18db8c3c455e7650ad597"/></dir></dir><dir name="etc"><file name="api.xml" hash="ee96f5255bb710f934c2dcef8e35cd89"/><file name="config.xml" hash="5ec4835b59d63ec52206204e81903bb7"/><file name="wsdl.xml" hash="9e291f850362a99b265645a978e45b09"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sandbourne_BulkApi.xml" hash="4418f8514205d4d52a309e83d5050c0d"/></dir></target></contents>
|
| 25 |
<compatible/>
|
| 26 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min/><max/></package></required></dependencies>
|
| 27 |
</package>
|
