-
Posts
135 -
Joined
-
Last visited
Contact Methods
- Website
-
Skype
tarek.fellah
Profile Information
-
Location
tunisia
-
Activity
Developer
tarek.fellah's Achievements
-
I have upgraded a customer website from Prestashop 1.6 to 1.7 version, i set it in a VPS hosting, it was my fault i'm not too technical on VPS security and configuration. The website, suddenly, become too slow and consumes a lot of memory, so i had doubt about the server performance (2G RAM), so i informed the client about that and tell that about upgrading, the customer refused, so i decided to use her shared hosting (with the old live website), in a folder and to make a redirection if all became ok. Now sometimes i had access to back end pages and the front is never opened, I got this error on chrome Gateway Timeout The gateway did not receive a timely response from the upstream server or application. I'm using the database from the vps, and i think the website is hacked since i found an empty folder with point prefix ".well-known" and a file ".eslintrc.json". This is the link of the website : http://terre-cosmos.com/terre-cosmos/index.php I would to know to found the infected files? Sorry for my english, and i'm open for all help. Thanks.
-
You can use action hooks, actionProductAdd and actionProductUpdate You need this hooks on the module install and add function for each hook Hook::exec are called on AdminProductController.php Hook::exec('actionProductAdd', array('id_product' => (int)$this->object->id, 'product' => $this->object)); public function HookActionProductUpdate($params){ Var_dump($params['product']);exit; } Cordially.
-
Hi, I searched a lot for this question and i didn't the correct answer, i have made a script to clear Prestashop cache, smarty cache, I got the code from adminPerformances controller, Tools::clearSmartyCache(); Tools::clearXMLCache(); Media::clearCache(); Tools::generateIndex(); I read that it cleared the cache from /cache/smarty/cache, but when executing the script or clicking in clear cache in performances page it doesn't remove subfolders from this folder. Any body knows 'clear cache' will affect which folders/files. Thanks.
-
clear smarty cache automatically ?
tarek.fellah replied to intershop's topic in Configuring and using PrestaShop
Hi, I have presta 1.6.1.10, i tried to clear cache by code, but modules folders in cache/smarty/cache are not removed, You know why? Thanks. -
PROBLEM WITH BACKOFFICE AFTER MIGRATION
tarek.fellah replied to FELINA's topic in Configuring and using PrestaShop
I had the same problem but i think that i solved it by clearing cache browser and cookies -
You have to create a FrontController, defaut.php class ModuleNameDefaultModuleFrontController extends ModuleFrontController { public function initContent(){ $row = array(); parent::initContent(); if(Tools::getValue('ajax')){ $id_product = (int)Tools::getValue("id_product"); if($id_product){ $row['id_product'] = $id_product; $product_informations = Product::getProductProperties($this->context->language->id, $row); } if (isset($product_informations) and $product_informations) $json = array( 'productInformations' => $product_informations ); else $json = array( 'status' => 'error', 'message' => $this->l('Error when getting product informations.') ); } else $json = array( 'status' => 'error', 'message' => $this->l('Error when getting product informations.') ); die(Tools::jsonEncode($json)); } } JS in the TPL var id_product = $('input[name="id_product"]').val(); $.ajax({ type: "POST", url: '{$link->$this->context->getModuleLink('modulename', 'default')}', async: false, cache: false, data: "product_id="+id_product+"&ajax=1", success: function(html){ $("#price").html(html.price); $('#link').html(result.productInformations.link); }, error: function() { alert("ERROR:"); } }); You can see using ajax in admin also in this article http://magento-web.blogspot.com/2017/01/utilisation-dajax-en-front-et-back.html it's in frensh, but i think that the code is clear. Best regards.
-
You can add js or css in the the getContent method in the configuration page, if (method_exists($this->context->controller, 'addJquery')) { $this->context->controller->addJquery(); } $this->context->controller->addJs($this->_path.'views/js/custom_script.js'); Or in the hook hookDisplayBackOfficeHeader public function hookDisplayBackOfficeHeader(){ if (method_exists($this->context->controller, 'addJquery')) { $this->context->controller->addJquery(); } $this->context->controller->addJs($this->_path.'views/js/custom_script.js'); }
-
I would like to override the HomeSlide class for the module homeslider, for that I created a file HomeSlide.php and i placed it under override/modules/homeslider. I tried this HomeSlide.php : class HomeSlide extends HomeSlideCore{ public $start_date; public $end_date; public function __construct($id_slide = null, $id_lang = null, $id_shop = null, Context $context = null) { self::$definition['fields']['start_date'] = array('type' => self::TYPE_DATE, 'validate' => 'isDate'); self::$definition['fields']['end_date'] = array('type' => self::TYPE_DATE, 'validate' => 'isDate'); parent::__construct($id_slide, $id_lang, $id_shop); [spam-filter] But I got this error Class 'HomeSlideCore' not found Any help would be appreciated. Thanks.