Jump to content

index strange behavior


Recommended Posts

Hi. I  tried to change hook of module blockspecial from             && $this->registerHook('displayHomeTab') to             && $this->registerHook('displayHome') and from 

public function hookDisplayHomeTab($params) { 
if (Configuration::get('PS_CATALOG_MODE')) return; 
if (!$this->isCached('tab.tpl', $this->getCacheId('blockspecials-tab'))) {
BlockSpecials::$cache_specials = Product::getPricesDrop(intval($params['cookie']->id_lang), 0, 200); shuffle($PricesDrop); 
array_splice($PricesDrop, Configuration::get('BLOCKSPECIALS_SPECIALS_NBR') ); 
}
if (BlockSpecials::$cache_specials) { shuffle(BlockSpecials::$cache_specials); array_splice(BlockSpecials::$cache_specials, ($nb ? $nb : Configuration::get('BLOCKSPECIALS_SPECIALS_NBR'))); 
} 
if (BlockSpecials::$cache_specials === false) return false; 
return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('blockspecials-tab')); 


to

 public function hookDisplayHome($params) { 
if (Configuration::get('PS_CATALOG_MODE')) return; 
if (!$this->isCached('tab.tpl', $this->getCacheId('blockspecials-tab'))) {
BlockSpecials::$cache_specials = Product::getPricesDrop(intval($params['cookie']->id_lang), 0, 200); shuffle($PricesDrop); 
array_splice($PricesDrop, Configuration::get('BLOCKSPECIALS_SPECIALS_NBR') ); 
}
if (BlockSpecials::$cache_specials) { shuffle(BlockSpecials::$cache_specials); array_splice(BlockSpecials::$cache_specials, ($nb ? $nb : Configuration::get('BLOCKSPECIALS_SPECIALS_NBR'))); 
} 
if (BlockSpecials::$cache_specials === false) return false; 
return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('blockspecials-tab')); 
}

But after installing proccess my homepage go nuts. Some modules stop showing, css hover on horizontal menu not working.Footer modules dissapear. 

Deleted module, like uninstall then delete

Tried backup day old, clear cache from BO and manually. Didnt help

With debug true i got something like that in php error log

PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/var/www/domains/domainname.ru/cache/smarty/cache/blockspecials/20200125/110/20200125/1/1/1/1/19/5b/0c/0c): failed to open dir: No such file or directory' in /var/www/domains/domainname.ru/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php:196\nStack trace:\n#0 [internal function]: RecursiveDirectoryIterator->__construct('/var/www/domain...', 0)\n#1 /var/www/domains/domainname.ru/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php(196): RecursiveDirectoryIterator->getChildren()\n#2 /var/www/domains/domainname.ru/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php(130): Smarty_Internal_CacheResource_File->clear(Object(SmartyCustom), NULL, NULL, NULL, NULL)\n#3 /var/www/domains/domainname.ru/tools/smarty/Smarty.class.php(825): Smarty_Internal_CacheResource_File->clearAll(Object(SmartyCustom), NULL)\n#4 /var/www/domains/domainname.ru/classes/SmartyCustom.php(147): Smarty->clearAll in /var/www/domains/domainname.ru/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php on line 196, referer: https://www.domainname.ru/

PREG_BACKTRACK_LIMIT_ERROR in function packJSinHTML

 prestashop 1.6.1.16 with default theme

Unrelated pics deleted

Please help. How to reveret back

 

 

 

Unfortunately cant find any errors with debug on(only some js error of some module)

Looks like im damage somehow hookHome 

I dunno uninstall and install every missed module on home page still the same, all tpl files are okay, no errors. Maybe its sql problem?

Disable override thing fix index 

 

Found it. There was a module(not by prestashop) and aparently he override of the controller. Disable it and we back.

Edited by butlerov (see edit history)
Link to comment
Share on other sites

What you need to do is call displayproductTabContent instead, tab only displays the snipped. You don't need to change it, just add

public function hookDisplayHome($params) {

return $this->displayHomeTabContent($params);

}

You might have to check if it caches. If so, you'll need to clone the method and assign the products regardless of the presence of displayTab

Link to comment
Share on other sites

On 1/30/2020 at 4:42 PM, NemoPS said:

What you need to do is call displayproductTabContent instead, tab only displays the snipped. You don't need to change it, just add

public function hookDisplayHome($params) {

return $this->displayHomeTabContent($params);

}

You might have to check if it caches. If so, you'll need to clone the method and assign the products regardless of the presence of displayTab

Well, all i trying to do is move module contents lower some modules on DisplayHome.

When Im tried and put the code you suggested, lowering the module is possible in live edit. But unfortanatly after save via live edit module, got 500 error on homepage.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...