// Merge -> revision 7875

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7877 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-03 16:16:49 +00:00
parent 6f08bcb12e
commit f2b5ee338b
38 changed files with 320 additions and 85 deletions
+4 -1
View File
@@ -116,7 +116,10 @@ function reloadContent(params_plus)
data = $('#layered_form').serialize();
$('.layered_slider').each( function () {
data += '&'+$(this).attr('id')+'='+$(this).slider('values', 0)+'_'+$(this).slider('values', 1);
var sliderStart = $(this).slider('values', 0);
var sliderStop = $(this).slider('values', 1);
if(typeof(sliderStart) == 'number' && typeof(sliderStop) == 'number')
data += '&'+$(this).attr('id')+'='+sliderStart+'_'+sliderStop;
});
if ($('#selectPrductSort').length)
+2 -1
View File
@@ -633,7 +633,7 @@ class BlockLayered extends Module
$selectedFilters[$res[1].($id_key ? '_'.$id_key : '')] = array();
$selectedFilters[$res[1].($id_key ? '_'.$id_key : '')][] = (int)$value;
}
elseif (in_array($res[1], array('weight')))
elseif ($res[1] == 'weight')
$selectedFilters[$res[1]] = $tmpTab;
}
}
@@ -715,6 +715,7 @@ class BlockLayered extends Module
break;
case 'weight':
if($selectedFilters['weight'][0] != 0 || $selectedFilters['weight'][1] != 0)
$queryFilters .= ' AND p.`weight` BETWEEN '.(float)($selectedFilters['weight'][0] - 0.001).' AND '.(float)($selectedFilters['weight'][1] + 0.001);
break;
}
+11
View File
@@ -151,5 +151,16 @@
<p style="margin: 20px 0; text-align: center;"><img src="{$img_ps_dir}loader.gif" alt="" /><br />{l s='Loading...' mod='blocklayered'}</p>
</div>
</div>
{else}
<div id="layered_block_left" class="block">
<div class="block_content">
<form action="#" id="layered_form">
<input type="hidden" name="id_category_layered" value="{$id_category_layered}" />
</form>
</div>
<div id="layered_ajax_loader" style="display: none;">
<p style="margin: 20px 0; text-align: center;"><img src="{$img_ps_dir}loader.gif" alt="" /><br />{l s='Loading...' mod='blocklayered'}</p>
</div>
</div>
{/if}
<!-- /Block layered navigation module -->
+1 -2
View File
@@ -310,8 +310,7 @@ class DateOfDelivery extends Module
private function _setCarrierRuleForm()
{
$carriers = Carrier::getCarriers($this->context->language->id, true , false,false, NULL, ALL_CARRIERS);
$carriers = Carrier::getCarriers($this->context->language->id, true, false, false, null, Carrier::ALL_CARRIERS);
if (Tools::isSubmit('editCarrierRule') AND $this->_isCarrierRuleExists(Tools::getValue('id_carrier_rule')))
$carrier_rule = $this->_getCarrierRule(Tools::getValue('id_carrier_rule'));
+1 -1
View File
@@ -125,7 +125,7 @@ class Dejala extends CarrierModule
$djlCarrier = DejalaCarrierUtils::getCarrierByName($this->name) ;
if (Configuration::get('PS_CARRIER_DEFAULT') == (int)($djlCarrier->id))
{
$carriers = Carrier::getCarriers($this->context->language->id, true, false, false, NULL, PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
$carriers = Carrier::getCarriers($this->context->language->id, true, false, false, NULL, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
foreach($carriers as $carrier)
{
if ($carrier['active'] AND !$carrier['deleted'] AND ($carrier['external_module_name'] != $this->name))
+3 -2
View File
@@ -86,8 +86,9 @@ class DejalaCarrierUtils
return true;
}
public static function getCarrierByName($name) {
$carriers = Carrier::getCarriers(Context::getContext()->language->id, true, false, false, NULL, ALL_CARRIERS);
public static function getCarrierByName($name)
{
$carriers = Carrier::getCarriers(Context::getContext()->language->id, true, false, false, null, Carrier::ALL_CARRIERS);
foreach($carriers as $carrier)
if (!$carrier['deleted'] AND $carrier['external_module_name'] == $name)
return new Carrier((int)$carrier['id_carrier']) ;
+2 -1
View File
@@ -12,7 +12,8 @@ if (file_exists($configPath))
$nbProducts = Db::getInstance()->getValue('
SELECT COUNT(`id_product`) as nb
FROM `'._DB_PREFIX_.'product`
WHERE `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_ebay_category` > 0 AND `sync` = 1)');
WHERE `quantity` > 0 AND `active` = 1
AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_ebay_category` > 0 AND `sync` = 1)');
echo $nbProducts;
}
+2 -2
View File
@@ -2,9 +2,9 @@
<module>
<name>ebay</name>
<displayName><![CDATA[eBay]]></displayName>
<version><![CDATA[1.1]]></version>
<version><![CDATA[1.2]]></version>
<description><![CDATA[Open your shop on the eBay market place !]]></description>
<author><![CDATA[]]></author>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[market_place]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
+22 -4
View File
@@ -374,7 +374,7 @@ class eBayRequest
$requestXml .= ' <ErrorLanguage>fr_FR</ErrorLanguage>'."\n";
$requestXml .= ' <WarningLevel>High</WarningLevel>'."\n";
$requestXml .= ' <Item>'."\n";
$requestXml .= ' <SKU>prestashop-'.$datas['id_product'].'</SKU>';
$requestXml .= ' <SKU>prestashop-'.$datas['id_product'].(isset($datas['reference']) ? '-'.$datas['reference'] : '').'</SKU>';
$requestXml .= ' <Title>'.substr($datas['name'], 0, 55).'</Title>'."\n";
if (isset($datas['pictures']))
{
@@ -503,7 +503,7 @@ class eBayRequest
$requestXml .= ' <WarningLevel>High</WarningLevel>'."\n";
$requestXml .= ' <Item>'."\n";
$requestXml .= ' <ItemID>'.$datas['itemID'].'</ItemID>'."\n";
$requestXml .= ' <SKU>prestashop-'.$datas['id_product'].'</SKU>';
$requestXml .= ' <SKU>prestashop-'.$datas['id_product'].(isset($datas['reference']) ? '-'.$datas['reference'] : '').'</SKU>';
$requestXml .= ' <Quantity>'.$datas['quantity'].'</Quantity>'."\n";
$requestXml .= ' <StartPrice>'.$datas['price'].'</StartPrice>'."\n";
if (Configuration::get('EBAY_SYNC_OPTION_RESYNC') != 1)
@@ -653,7 +653,7 @@ class eBayRequest
foreach ($datas['variations'] as $key => $variation)
{
$requestXml .= ' <Variation>'."\n";
$requestXml .= ' <SKU>prestashop-'.$key.'</SKU>'."\n";
$requestXml .= ' <SKU>prestashop-'.$key.(isset($variation['reference']) ? '-'.$variation['reference'] : '').'</SKU>'."\n";
$requestXml .= ' <StartPrice>'.$variation['price'].'</StartPrice>'."\n";
$requestXml .= ' <Quantity>'.$variation['quantity'].'</Quantity>'."\n";
$requestXml .= ' <VariationSpecifics>'."\n";
@@ -1005,6 +1005,24 @@ class eBayRequest
}
if ($id_product > 0)
$itemList[] = array('id_product' => $id_product, 'id_product_attribute' => $id_product_attribute, 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
else
{
$id_product = Db::getInstance()->getValue('
SELECT `id_product` FROM `'._DB_PREFIX_.'product`
WHERE `reference` = \''.pSQL((string)$transaction->item->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->item->CustomLabel).'\'
OR `reference` = \''.pSQL((string)$transaction->Variation->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->Variation->CustomLabel).'\'');
if ((int)$id_product > 0)
$itemList[] = array('id_product' => $id_product, 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
else
{
$row = Db::getInstance()->getValue('
SELECT `id_product`, `id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute`
WHERE `reference` = \''.pSQL((string)$transaction->item->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->item->CustomLabel).'\'
OR `reference` = \''.pSQL((string)$transaction->Variation->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->Variation->CustomLabel).'\'');
if ((int)$row['id_product'] > 0)
$itemList[] = array('id_product' => $row['id_product'], 'id_product_attribute' => $row['id_product_attribute'], 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
}
}
}
$orderList[] = array(
@@ -1014,7 +1032,7 @@ class eBayRequest
'date' => substr((string)$order->CreatedTime, 0, 10).' '.substr((string)$order->CreatedTime, 11, 8),
'name' => (string)$order->ShippingAddress->Name,
'firstname' => $name[0],
'familyname' => $name[1],
'familyname' => (isset($name[1]) ? $name[1] : $name[0]),
'address1' => (string)$order->ShippingAddress->Street1,
'address2' => (string)$order->ShippingAddress->Street2,
'city' => (string)$order->ShippingAddress->CityName,
+50 -9
View File
@@ -56,7 +56,8 @@ class Ebay extends Module
{
$this->name = 'ebay';
$this->tab = 'market_place';
$this->version = '1.1';
$this->version = '1.2';
$this->author = 'PrestaShop';
parent::__construct ();
$this->displayName = $this->l('eBay');
$this->description = $this->l('Open your shop on the eBay market place !');
@@ -92,6 +93,10 @@ class Ebay extends Module
// Check if installed
if (self::isInstalled($this->name))
{
// Upgrade eBay module
if (Configuration::get('EBAY_VERSION') != $this->version)
$this->upgrade();
// Generate warnings
if (!Configuration::get('EBAY_API_TOKEN'))
$this->warning = $this->l('You must register your module on eBay.');
@@ -225,6 +230,20 @@ class Ebay extends Module
return true;
}
public function upgrade()
{
$version = Configuration::get('EBAY_VERSION');
if ($version == '1.1' || empty($version))
{
// Upgrade SQL
include(dirname(__FILE__).'/sql-upgrade-1-2.php');
foreach ($sql as $s)
if (!Db::getInstance()->Execute($s))
return false;
Configuration::updateValue('EBAY_VERSION', $this->version);
}
}
/******************************************************************/
/** Hook Methods **************************************************/
@@ -292,15 +311,28 @@ class Ebay extends Module
if (Configuration::get('EBAY_ORDER_LAST_UPDATE') < date('Y-m-d', strtotime('-45 minutes')).'T'.date('H:i:s', strtotime('-45 minutes')).'.000Z')
{
$ebay = new eBayRequest();
$orderList = $ebay->getOrders(Configuration::get('EBAY_ORDER_LAST_UPDATE'), $dateNew);
$orderList = $ebay->getOrders(date('Y-m-d', strtotime('-90 days')).'T'.date('H:i:s', strtotime('-45 minutes')).'.000Z', $dateNew);
if ($orderList)
foreach ($orderList as $order)
if ($order['status'] == 'Complete'&&
isset($order['product_list']) && count($order['product_list']))
if ($order['status'] == 'Complete' && $order['amount'] > 0.1 && isset($order['product_list']) && count($order['product_list']))
{
if (!Db::getInstance()->getValue('SELECT `id_ebay_order` FROM `'._DB_PREFIX_.'ebay_order` WHERE `id_order_ref` = \''.pSQL($order['id_order_ref']).'\''))
{
$result = Db::getInstance()->getRow('SELECT `id_customer` FROM `'._DB_PREFIX_.'customer` WHERE `active` = 1 AND `email` = \''.pSQL($order['email']).'\' AND `deleted` = 0'.(substr(_PS_VERSION_, 0, 3) == '1.3' ? '' : ' AND `is_guest` = 0'));
$id_customer = (isset($result['id_customer']) ? $result['id_customer'] : 0);
// Check for empty name
$order['firstname'] = str_replace('_', '', trim($order['firstname']));
$order['familyname'] = str_replace('_', '', trim($order['familyname']));
if (empty($order['familyname']))
$order['familyname'] = $order['firstname'];
if (empty($order['firstname']))
$order['firstname'] = $order['familyname'];
if (Validate::isEmail($order['email']) && !empty($order['firstname']) && !empty($order['familyname']))
{
// Add customer if he doesn't exist
if ($id_customer < 1)
{
@@ -382,6 +414,11 @@ class Ebay extends Module
Db::getInstance()->autoExecute(_DB_PREFIX_.'orders', $updateOrder, 'UPDATE', '`id_order` = '.(int)$id_order);
foreach ($order['product_list'] as $product)
Db::getInstance()->autoExecute(_DB_PREFIX_.'order_detail', array('product_price' => floatval($product['price']), 'tax_rate' => 0, 'reduction_percent' => 0), 'UPDATE', '`id_order` = '.(int)$id_order.' AND `product_id` = '.(int)$product['id_product'].' AND `product_attribute_id` = '.(int)$product['id_product_attribute']);
// Register the ebay order ref
Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_order', array('id_order_ref' => pSQL($order['id_order_ref']), 'id_order' => (int)$id_order), 'INSERT');
}
}
}
}
@@ -1075,11 +1112,13 @@ class Ebay extends Module
$nbProductsModeA = Db::getInstance()->getValue('
SELECT COUNT(`id_product`) as nb
FROM `'._DB_PREFIX_.'product`
WHERE `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_ebay_category` > 0)');
WHERE `quantity` > 0 AND `active` = 1
AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_ebay_category` > 0)');
$nbProductsModeB = Db::getInstance()->getValue('
SELECT COUNT(`id_product`) as nb
FROM `'._DB_PREFIX_.'product`
WHERE `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_ebay_category` > 0 AND `sync` = 1)');
WHERE `quantity` > 0 AND `active` = 1
AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_ebay_category` > 0 AND `sync` = 1)');
$nbProducts = $nbProductsModeA;
if (Configuration::get('EBAY_SYNC_MODE') == 'B')
@@ -1213,7 +1252,7 @@ class Ebay extends Module
Configuration::updateValue('EBAY_SYNC_MODE', 'A');
// Retrieve product list for eBay (which have matched categories)
$productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0)');
$productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE `quantity` > 0 AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0)');
// Send each product on eBay
$this->_syncProducts($productsList);
@@ -1227,7 +1266,7 @@ class Ebay extends Module
Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_category_configuration', array('sync' => 0), 'UPDATE', '');
foreach ($_POST['category'] as $id_category)
Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_category_configuration', array('sync' => 1), 'UPDATE', '`id_category` = '.(int)$id_category);
$productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1)');
$productsList = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product` WHERE `quantity` > 0 AND `active` = 1 AND `id_category_default` IN (SELECT `id_category` FROM `'._DB_PREFIX_.'ebay_category_configuration` WHERE `id_category` > 0 AND `id_ebay_category` > 0 AND `sync` = 1)');
// Send each product on eBay
$this->_syncProducts($productsList);
@@ -1282,6 +1321,7 @@ class Ebay extends Module
{
$variationsList[$c['group_name']][$c['attribute_name']] = 1;
$variations[$c['id_product'].'-'.$c['id_product_attribute']]['id_attribute'] = $c['id_product_attribute'];
$variations[$c['id_product'].'-'.$c['id_product_attribute']]['reference'] = $c['reference'];
$variations[$c['id_product'].'-'.$c['id_product_attribute']]['quantity'] = $c['quantity'];
$variations[$c['id_product'].'-'.$c['id_product_attribute']]['variations'][] = array('name' => $c['group_name'], 'value' => $c['attribute_name']);
$variations[$c['id_product'].'-'.$c['id_product_attribute']]['price_static'] = Product::getPriceStatic((int)$c['id_product'], true, (int)$c['id_product_attribute']);
@@ -1322,6 +1362,7 @@ class Ebay extends Module
// Generate array and try insert in database
$datas = array(
'id_product' => $product->id,
'reference' => $product->reference,
'name' => str_replace('&', '&amp;', $product->name),
'brand' => $product->manufacturer_name,
'description' => $product->description,
@@ -1688,4 +1729,4 @@ class Ebay extends Module
}
?>
+28 -1
View File
@@ -48,5 +48,32 @@
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
// Create Order Table in Database
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ebay_order` (
`id_ebay_order` int(16) NOT NULL AUTO_INCREMENT,
`id_order_ref` varchar(128) NOT NULL,
`id_order` int(16) NOT NULL,
UNIQUE(`id_order_ref`),
PRIMARY KEY (`id_ebay_order`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
// Create Sync History Table in Database
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ebay_sync_history` (
`id_ebay_sync_history` int(16) NOT NULL AUTO_INCREMENT,
`is_manual` tinyint(1) NOT NULL,
`datetime` datetime NOT NULL,
PRIMARY KEY (`id_ebay_sync_history`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
// Create Sync History Product Table in Database
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ebay_sync_history_product` (
`id_ebay_sync_history_product` int(16) NOT NULL AUTO_INCREMENT,
`id_ebay_sync_history` int(16),
`id_product` int(16),
KEY (`id_ebay_sync_history`),
PRIMARY KEY (`id_ebay_sync_history_product`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
?>
+4 -1
View File
@@ -5,5 +5,8 @@
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ebay_category`;';
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ebay_category_configuration`;';
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ebay_product`;';
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ebay_order`;';
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ebay_sync_history`;';
$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ebay_sync_history_product`;';
?>
+6
View File
@@ -0,0 +1,6 @@
<?php
// Init
$sql = array();
+32
View File
@@ -0,0 +1,32 @@
<?php
// Init
$sql = array();
// Create Order Table in Database
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ebay_order` (
`id_ebay_order` int(16) NOT NULL AUTO_INCREMENT,
`id_order_ref` varchar(128) NOT NULL,
`id_order` int(16) NOT NULL,
UNIQUE(`id_order_ref`),
PRIMARY KEY (`id_ebay_order`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
// Create Sync History Table in Database
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ebay_sync_history` (
`id_ebay_sync_history` int(16) NOT NULL AUTO_INCREMENT,
`is_manual` tinyint(1) NOT NULL,
`datetime` datetime NOT NULL,
PRIMARY KEY (`id_ebay_sync_history`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
// Create Sync History Product Table in Database
$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ebay_sync_history_product` (
`id_ebay_sync_history_product` int(16) NOT NULL AUTO_INCREMENT,
`id_ebay_sync_history` int(16),
`id_product` int(16),
KEY (`id_ebay_sync_history`),
PRIMARY KEY (`id_ebay_sync_history_product`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;';
+2 -3
View File
@@ -29,8 +29,7 @@
{if $editorial->body_home_logo_link}<a href="{$editorial->body_home_logo_link|escape:'htmlall':'UTF-8'}" title="{$editorial->body_title|escape:'htmlall':'UTF-8'|stripslashes}">{/if}
{if $homepage_logo}<img src="{$link->getMediaLink($image_path)}" alt="{$editorial->body_title|escape:'htmlall':'UTF-8'|stripslashes}" {if $image_width}width="{$image_width}"{/if} {if $image_height}height="{$image_height}" {/if}/>{/if}
{if $editorial->body_home_logo_link}</a>{/if}
{if $editorial->body_logo_subheading}<p id="editorial_image_legend">{$editorial->body_logo_subheading|stripslashes}</p>
{elseif $editorial->body_logo_subheading}<p id="editorial_image_legend">{$editorial->body_logo_subheading}</p>{/if}
{if $editorial->body_logo_subheading}<p id="editorial_image_legend">{$editorial->body_logo_subheading|stripslashes}</p>{/if}
{if $editorial->body_title}<h1>{$editorial->body_title|stripslashes}</h1>
{elseif $editorial->body_title}<h1>{$editorial->body_title|stripslashes}</h1>{/if}
{if $editorial->body_subheading}<h2>{$editorial->body_subheading|stripslashes}</h2>
@@ -38,4 +37,4 @@
{if $editorial->body_paragraph}<div class="rte">{$editorial->body_paragraph|stripslashes}</div>
{elseif $editorial->body_paragraph}<div class="rte">{$editorial->body_paragraph|stripslashes}</div>{/if}
</div>
<!-- /Module Editorial -->
<!-- /Module Editorial -->
+8 -6
View File
@@ -321,11 +321,13 @@ class Hipay extends PaymentModule
{
// Delete all configurated zones
foreach ($_POST as $key => $val)
{
if (strncmp($key, 'HIPAY_AZ_ALL_', strlen('HIPAY_AZ_ALL_')) == 0)
{
$id = substr($key, -(strlen($key) - strlen('HIPAY_AZ_ALL_')));
Configuration::updateValue('HIPAY_AZ_'.$id, 'ko');
}
}
Db::getInstance()->ExecuteS('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE `id_module` = '.(int)$this->id);
// Add the new configuration zones
@@ -353,17 +355,17 @@ class Hipay extends PaymentModule
if (Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) != Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code']))
Configuration::updateValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'], false);
Configuration::updateValue('HIPAY_ACCOUNT_'.$currency['iso_code'], Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code']));
Configuration::updateValue('HIPAY_PASSWORD_'.$currency['iso_code'], Tools::getValue('HIPAY_PASSWORD_'.$currency['iso_code']));
Configuration::updateValue('HIPAY_SITEID_'.$currency['iso_code'], Tools::getValue('HIPAY_SITEID_'.$currency['iso_code']));
Configuration::updateValue('HIPAY_ACCOUNT_'.$currency['iso_code'], trim(Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'])));
Configuration::updateValue('HIPAY_PASSWORD_'.$currency['iso_code'], trim(Tools::getValue('HIPAY_PASSWORD_'.$currency['iso_code'])));
Configuration::updateValue('HIPAY_SITEID_'.$currency['iso_code'], trim(Tools::getValue('HIPAY_SITEID_'.$currency['iso_code'])));
Configuration::updateValue('HIPAY_CATEGORY_'.$currency['iso_code'], Tools::getValue('HIPAY_CATEGORY_'.$currency['iso_code']));
if ($this->prod AND Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code']))
$accounts[Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'])] = 1;
Configuration::updateValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code']));
Configuration::updateValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code']));
Configuration::updateValue('HIPAY_SITEID_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code']));
Configuration::updateValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'], trim(Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'])));
Configuration::updateValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code'], trim(Tools::getValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code'])));
Configuration::updateValue('HIPAY_SITEID_TEST_'.$currency['iso_code'], trim(Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code'])));
Configuration::updateValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code']));
if (!$this->prod AND Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code']))
+1 -1
View File
@@ -185,7 +185,7 @@ class MailAlerts extends Module
// Filling-in vars for email
$template = 'new_order';
$subject = $this->l('New order', $id_lang);
$subject = $this->l('New order').' - '.sprintf('%06d', $order->id);
$templateVars = array(
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
+1 -1
View File
@@ -884,7 +884,7 @@ class PayPal extends PaymentModule
Configuration::updateValue('PAYPAL_BUSINESS', trim(Tools::getValue('email_paypal')));
Configuration::updateValue('PAYPAL_HEADER', Tools::getValue('banner_url'));
Configuration::updateValue('PAYPAL_API_USER', trim(Tools::getValue('api_username')));
Configuration::updateValue('PAYPAL_API_PASSWORD', Tools::getValue('api_password'));
Configuration::updateValue('PAYPAL_API_PASSWORD', trim(Tools::getValue('api_password')));
Configuration::updateValue('PAYPAL_API_SIGNATURE', trim(Tools::getValue('api_signature')));
Configuration::updateValue('PAYPAL_EXPRESS_CHECKOUT', (int)(Tools::isSubmit('paypal_express')));
Configuration::updateValue('PAYPAL_MODE_DEBUG', (int)(Tools::isSubmit('paypal_debug')));
+1 -1
View File
@@ -407,7 +407,7 @@ class Socolissimo extends CarrierModule
'inputs' => $inputs, 'serialsInput' => $serialsInput, 'finishProcess' => $this->l('To choose SoColissimo, click on a delivery method')));
$country = new Country((int)($params['address']->id_country));
$carriers = Carrier::getCarriers($cookie->id_lang, true , false,false, NULL, ALL_CARRIERS);
$carriers = Carrier::getCarriers($cookie->id_lang, true , false,false, NULL, Carrier::ALL_CARRIERS);
$ids = array();
foreach($carriers as $carrier)
$ids[] = $carrier['id_carrier'];
+12 -2
View File
@@ -46,7 +46,7 @@ class Treepodia extends Module
{
$this->name = 'treepodia';
$this->tab = 'front_office_features';
$this->version = '1.3';
$this->version = '1.4';
$this->displayName = 'Treepodia';
parent::__construct();
@@ -123,13 +123,23 @@ XML;
foreach ($languages AS $language)
$infos->addChild('lang', $language['iso_code']);
$limit_sql = '';
$limit_start = (int)Tools::getValue('limit_start');
$limit_end = (int)Tools::getValue('limit_end');
if ($limit_start > 0)
{
if ($limit_end < $limit_start)
$limit_end = $limit_start + 10;
$limit_sql = ' LIMIT '.(int)$limit_start.','.(int)$limit_end;
}
$sqlProducts = Db::getInstance()->ExecuteS('
SELECT p.id_product, p.reference, p.weight, m.name manufacturer, s.name supplier, p.on_sale, p.id_manufacturer, pd.id_product_download
FROM '._DB_PREFIX_.'product p
LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer)
LEFT JOIN '._DB_PREFIX_.'supplier s ON (s.id_supplier = p.id_supplier)
LEFT JOIN '._DB_PREFIX_.'product_download pd ON (pd.id_product = p.id_product)
WHERE p.active = 1');
WHERE p.active = 1'.$limit_sql);
foreach ($sqlProducts AS $sqlProduct)
{