// Merge -> revision 8734

This commit is contained in:
rMalie
2011-09-23 14:06:47 +00:00
parent dc957d3d3a
commit 1d44d06528
4 changed files with 20 additions and 12 deletions
+2 -2
View File
@@ -1957,7 +1957,7 @@ class ProductCore extends ObjectModel
*/
public function getPrice($tax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = false, $usereduc = true, $quantity = 1)
{
return self::getPriceStatic((int)($this->id), $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity);
return Product::getPriceStatic((int)($this->id), $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity);
}
public function getIdProductAttributeMostExpensive()
@@ -1975,7 +1975,7 @@ class ProductCore extends ObjectModel
public function getPriceWithoutReduct($notax = false, $id_product_attribute = false)
{
return self::getPriceStatic((int)($this->id), !$notax, $id_product_attribute, 6, NULL, false, false);
return Product::getPriceStatic((int)($this->id), !$notax, $id_product_attribute, 6, NULL, false, false);
}
/**
+1 -1
View File
@@ -66,7 +66,7 @@ class ToolsInstall
!isset($_GET['name']) OR empty($_GET['name']) OR !Validate::isUnixName($_GET['name']),
!isset($_GET['login']) OR empty($_GET['login']) OR !Validate::isUnixName($_GET['login']),
!isset($_GET['password']),
!isset($_GET['tablePrefix']) OR !Validate::isTablePrefix($_GET['tablePrefix']),
(!isset($_GET['tablePrefix']) OR !Validate::isTablePrefix($_GET['tablePrefix'])) && !empty($_GET['tablePrefix']),
);
foreach ($data_check AS $data)
+1 -1
View File
@@ -372,7 +372,7 @@ function verifyDbAccess ()
+"&password="+encodeURIComponent($("#dbPassword").val())
+"&engine="+$("#dbEngine option:selected").val()
+ "&name=" + $("#dbName").val()
+ "&tablePrefix=" + $("#db_prefix").val(),
+ "&tablePrefix=" + encodeURIComponent($("#db_prefix").val()),
success: function(ret)
{
ret = ret.getElementsByTagName('action')[0];
+16 -8
View File
@@ -49,15 +49,14 @@ class BlockLayered extends Module
public function install()
{
if ($this->registerHook('leftColumn') && $this->registerHook('header') && $this->registerHook('footer')
if (parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header') && $this->registerHook('footer')
&& $this->registerHook('categoryAddition') && $this->registerHook('categoryUpdate') && $this->registerHook('attributeGroupForm')
&& $this->registerHook('afterSaveAttributeGroup') && $this->registerHook('afterDeleteAttributeGroup') && $this->registerHook('featureForm')
&& $this->registerHook('afterDeleteFeature') && $this->registerHook('afterSaveFeature') && $this->registerHook('categoryDeletion')
&& $this->registerHook('afterSaveProduct') && $this->registerHook('productListAssign') && $this->registerHook('postProcessAttributeGroup')
&& $this->registerHook('postProcessFeature') && $this->registerHook('featureValueForm') && $this->registerHook('postProcessFeatureValue')
&& $this->registerHook('afterDeleteFeatureValue') && $this->registerHook('afterSaveFeatureValue') && $this->registerHook('attributeForm')
&& $this->registerHook('postProcessAttribute') && $this->registerHook('afterDeleteAttribute') && $this->registerHook('afterSaveAttribute')
&& parent::install())
&& $this->registerHook('postProcessAttribute') && $this->registerHook('afterDeleteAttribute') && $this->registerHook('afterSaveAttribute'))
{
Configuration::updateValue('PS_LAYERED_HIDE_0_VALUES', 0);
Configuration::updateValue('PS_LAYERED_SHOW_QTIES', 1);
@@ -65,24 +64,32 @@ class BlockLayered extends Module
$this->rebuildLayeredStructure();
$this->rebuildLayeredCache();
self::_installPriceIndexTable();
self::_installFriendlyUrlTable();
self::_installIndexableAttributeTable();
self::_installProductAttributeTable();
$this->_installFriendlyUrlTable();
$this->_installIndexableAttributeTable();
$this->_installProductAttributeTable();
$this->indexUrl();
$this->indexAttribute();
if(Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'product`') < 10000) // Lock price indexation if too many products
self::fullIndexProcess();
return true;
}
else
{
// Installation failed (or hook registration) => uninstall the module
$this->uninstall();
return false;
}
}
public function uninstall()
{
/* Delete all configurations */
Configuration::deleteByName('PS_LAYERED_HIDE_0_VALUES');
Configuration::deleteByName('PS_LAYERED_SHOW_QTIES');
Configuration::deleteByName('PS_LAYERED_INDEXED');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_price_index');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_friendly_url');
@@ -96,7 +103,7 @@ class BlockLayered extends Module
return parent::uninstall();
}
private function _installPriceIndexTable()
private static function _installPriceIndexTable()
{
Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_price_index`');
@@ -986,7 +993,8 @@ class BlockLayered extends Module
Db::getInstance()->Execute('
INSERT INTO `'._DB_PREFIX_.'layered_price_index` (id_product, id_currency, price_min, price_max)
VALUES '.implode(',', $values));
VALUES '.implode(',', $values).'
ON DUPLICATE KEY UPDATE id_product = id_product # avoid duplicate keys');
}
public function hookLeftColumn($params)