// Merge -> 8910
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>ebay</name>
|
||||
<displayName><![CDATA[eBay]]></displayName>
|
||||
<version><![CDATA[1.2.6]]></version>
|
||||
<version><![CDATA[1.2.8]]></version>
|
||||
<description><![CDATA[Open your shop on the eBay market place !]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[market_place]]></tab>
|
||||
|
||||
@@ -1096,7 +1096,8 @@ class eBayRequest
|
||||
foreach ($this->response->OrderArray->Order as $order)
|
||||
{
|
||||
$name = str_replace(array('_', ',', ' '), array('', '', ' '), (string)$order->ShippingAddress->Name);
|
||||
$name = explode(' ', $name);
|
||||
$name = preg_replace('/\-?\d+/', '', $name);
|
||||
$name = explode(' ', $name, 2);
|
||||
$itemList = array();
|
||||
for ($i = 0; isset($order->TransactionArray->Transaction[$i]); $i++)
|
||||
{
|
||||
@@ -1110,6 +1111,8 @@ class eBayRequest
|
||||
$tmp = explode('-', (string)$transaction->Item->SKU);
|
||||
if (isset($tmp[1]))
|
||||
$id_product = $tmp[1];
|
||||
if (isset($tmp[2]))
|
||||
$id_product_attribute = $tmp[2];
|
||||
}
|
||||
if (isset($transaction->Variation->SKU))
|
||||
{
|
||||
@@ -1160,8 +1163,8 @@ class eBayRequest
|
||||
'status' => (string)$order->CheckoutStatus->Status,
|
||||
'date' => substr((string)$order->CreatedTime, 0, 10).' '.substr((string)$order->CreatedTime, 11, 8),
|
||||
'name' => (string)$order->ShippingAddress->Name,
|
||||
'firstname' => $name[0],
|
||||
'familyname' => (isset($name[1]) ? $name[1] : $name[0]),
|
||||
'firstname' => trim($name[0]),
|
||||
'familyname' => (isset($name[1]) ? trim($name[1]) : trim($name[0])),
|
||||
'address1' => (string)$order->ShippingAddress->Street1,
|
||||
'address2' => (string)$order->ShippingAddress->Street2,
|
||||
'city' => (string)$order->ShippingAddress->CityName,
|
||||
|
||||
+14
-3
@@ -59,7 +59,7 @@ class Ebay extends Module
|
||||
{
|
||||
$this->name = 'ebay';
|
||||
$this->tab = 'market_place';
|
||||
$this->version = '1.2.6';
|
||||
$this->version = '1.2.8';
|
||||
$this->author = 'PrestaShop';
|
||||
parent::__construct ();
|
||||
$this->displayName = $this->l('eBay');
|
||||
@@ -656,7 +656,7 @@ class Ebay extends Module
|
||||
success: function(data)
|
||||
{
|
||||
if (data == \'OK\')
|
||||
window.location.href = \''.Tools::safeOutput($_SERVER['REQUEST_URI']).'&action=validateToken\';
|
||||
window.location.href = \'index.php?tab='.Tools::safeOutput($_GET['tab']).'&configure='.Tools::safeOutput($_GET['configure']).'&token='.Tools::safeOutput($_GET['token']).'&tab_module='.Tools::safeOutput($_GET['tab_module']).'&module_name='.Tools::safeOutput($_GET['module_name']).'&action=validateToken\';
|
||||
else
|
||||
setTimeout ("checkToken()", 5000);
|
||||
}
|
||||
@@ -1111,10 +1111,11 @@ class Ebay extends Module
|
||||
$ad = dirname($_SERVER["PHP_SELF"]);
|
||||
|
||||
// Display Form
|
||||
$forbiddenJs = array('textarea', 'script', 'onmousedown', 'onmousemove', 'onmmouseup', 'onmouseover', 'onmouseout', 'onload', 'onunload', 'onfocus', 'onblur', 'onchange', 'onsubmit', 'ondblclick', 'onclick', 'onkeydown', 'onkeyup', 'onkeypress', 'onmouseenter', 'onmouseleave', 'onerror');
|
||||
$html = '<form action="index.php?tab='.Tools::safeOutput($_GET['tab']).'&configure='.Tools::safeOutput($_GET['configure']).'&token='.Tools::safeOutput($_GET['token']).'&tab_module='.Tools::safeOutput($_GET['tab_module']).'&module_name='.Tools::safeOutput($_GET['module_name']).'&id_tab=3§ion=template" method="post" class="form" id="configForm3">
|
||||
<fieldset style="border: 0">
|
||||
<h4>'.$this->l('You can customise the template for your products page on eBay').' :</h4>
|
||||
<textarea class="rte" cols="100" rows="50" name="ebay_product_template">'.Tools::safeOutput(Tools::getValue('ebay_product_template', Configuration::get('EBAY_PRODUCT_TEMPLATE'))).'</textarea><br />
|
||||
<textarea class="rte" cols="100" rows="50" name="ebay_product_template">'.str_replace($forbiddenJs, '', Tools::getValue('ebay_product_template', Configuration::get('EBAY_PRODUCT_TEMPLATE'))).'</textarea><br />
|
||||
|
||||
'.(substr(_PS_VERSION_, 0, 3) == '1.3' ? '
|
||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
|
||||
@@ -1498,6 +1499,14 @@ class Ebay extends Module
|
||||
}
|
||||
}
|
||||
|
||||
public function findIfCategoryParentIsMultiSku($id_category_ref)
|
||||
{
|
||||
$row = Db::getInstance()->getRow('SELECT `id_category_ref_parent`, `is_multi_sku` FROM `'._DB_PREFIX_.'ebay_category` WHERE `id_category_ref` = '.(int)$id_category_ref);
|
||||
if ($row['id_category_ref_parent'] != $id_category_ref)
|
||||
return $this->findIfCategoryParentIsMultiSku($row['id_category_ref_parent']);
|
||||
return $row['is_multi_sku'];
|
||||
}
|
||||
|
||||
private function _syncProducts($productsList)
|
||||
{
|
||||
$fees = 0;
|
||||
@@ -1529,6 +1538,8 @@ class Ebay extends Module
|
||||
// Load default category matched in cache
|
||||
if (!isset($categoryDefaultCache[$product->id_category_default]))
|
||||
$categoryDefaultCache[$product->id_category_default] = Db::getInstance()->getRow('SELECT ec.`id_category_ref`, ec.`is_multi_sku`, ecc.`percent` FROM `'._DB_PREFIX_.'ebay_category` ec LEFT JOIN `'._DB_PREFIX_.'ebay_category_configuration` ecc ON (ecc.`id_ebay_category` = ec.`id_ebay_category`) WHERE ecc.`id_category` = '.(int)$product->id_category_default);
|
||||
if ($categoryDefaultCache[$product->id_category_default]['is_multi_sku'] != 1)
|
||||
$categoryDefaultCache[$product->id_category_default]['is_multi_sku'] = $this->findIfCategoryParentIsMultiSku($categoryDefaultCache[$product->id_category_default]['id_category_ref']);
|
||||
|
||||
// Load Pictures
|
||||
$pictures = array();
|
||||
|
||||
Reference in New Issue
Block a user