- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Prestashop 1.6.x Troubleshooter. Options set for image slider module do not work
June 15, 2015
This tutorial shows how to solve the issue with “Image slider for your homepage” module (when options set in admin section do not work).
-
Open “Image slider for your home page” module in Modules->Modules section. We can see that width 1170 px is specified:
-
Inspect slider using Firebug in Firefox or Developer tool in Chrome browser. We can see that width 900px is specified in the source code:
-
In order to resolve this issue, we should access Prestashop database. Access prestashop database using database management tool like PhpMyAdmin. Open ps_configuration table:
-
Set Maximum number of rows. In this case you will see all database table records (such field can be represented as text input and depends on version of PhpMyAdmin):
-
IMPORTANT: Be sure to back up database before performing modifications.
Press Ctrl+F and perform search using homeslider keyword. We can see duplicated records for the same options. Also, we can see that some records have NULL in id_shop_group and id_shop fields. Check those records and remove them:
-
Now we should modify the following file:
modules/homeslider/homeslider.php. Download the file and open it in editor. Find the following code:$slider = array( 'width' => Configuration::get('HOMESLIDER_WIDTH'), 'speed' => Configuration::get('HOMESLIDER_SPEED'), 'pause' => Configuration::get('HOMESLIDER_PAUSE'), 'loop' => (bool)Configuration::get('HOMESLIDER_LOOP'), );
Replace it with the following code:
$slider = array( 'width' => Configuration::get('HOMESLIDER_WIDTH', null, $this->context->shop->getGroup(), $this->context->shop->id), 'speed' => Configuration::get('HOMESLIDER_SPEED', null, $this->context->shop->getGroup(), $this->context->shop->id), 'pause' => Configuration::get('HOMESLIDER_PAUSE', null, $this->context->shop->getGroup(), $this->context->shop->id), 'loop' => (bool)Configuration::get('HOMESLIDER_LOOP', null, $this->context->shop->getGroup(), $this->context->shop->id), );
This code specifies that shop and group IDs will be added to database record (please check the screenshot with modified code):
-
Now we should modify the following code:
return array( 'HOMESLIDER_WIDTH' => Tools::getValue('HOMESLIDER_WIDTH', Configuration::get('HOMESLIDER_WIDTH')), 'HOMESLIDER_SPEED' => Tools::getValue('HOMESLIDER_SPEED', Configuration::get('HOMESLIDER_SPEED')), 'HOMESLIDER_PAUSE' => Tools::getValue('HOMESLIDER_PAUSE', Configuration::get('HOMESLIDER_PAUSE')), 'HOMESLIDER_LOOP' => Tools::getValue('HOMESLIDER_LOOP', Configuration::get('HOMESLIDER_LOOP')), );
Replace it with this code:
return array( 'HOMESLIDER_WIDTH' => Tools::getValue('HOMESLIDER_WIDTH', Configuration::get('HOMESLIDER_WIDTH', null, $this->context->shop->getGroup(), $this->context->shop->id)), 'HOMESLIDER_SPEED' => Tools::getValue('HOMESLIDER_SPEED', Configuration::get('HOMESLIDER_SPEED', null, $this->context->shop->getGroup(), $this->context->shop->id)), 'HOMESLIDER_PAUSE' => Tools::getValue('HOMESLIDER_PAUSE', Configuration::get('HOMESLIDER_PAUSE', null, $this->context->shop->getGroup(), $this->context->shop->id)), 'HOMESLIDER_LOOP' => Tools::getValue('HOMESLIDER_LOOP', Configuration::get('HOMESLIDER_LOOP', null, $this->context->shop->getGroup(), $this->context->shop->id)), );
Please check the screenshot with modified code:
-
Save changed and upload the modified file.
IMPORTANT: Be sure to save this file on storage device or cloud as this file will be replaced when Prestashop will provide update for this module.
-
Open the module in admin section. You will see that settings are not set (blank fields). Specify appropriate settings. Save changes:
-
Clear Prestashop and browser cache. Refresh the page. Now slider has width that was specified in module settings:
Feel free to check the detailed video tutorial below: