Prestashop 1.6.x Troubleshooter. 为图像滑块模块设置的选项不起作用
June 15, 2015
Prestashop 1.6.x Troubleshooter. 图片滑块为您的主页. 在“管理”部分设置的选项不起作用
本教程展示了如何使用“Image”解决这个问题 slider for your homepage” module (当在admin部分设置的选项不起作用时).
-
Open “Image slider for your home page” module in Modules->Modules section. 我们可以看到宽度1170像素被指定:
-
Inspect slider 使用Firefox中的Firebug或Chrome中的Developer工具 browser. 我们可以看到900px的宽度是在源代码中指定的:
-
为了解决这个问题,我们应该访问prestshop database. Access prestashop database using database management tool like PhpMyAdmin. Open ps_configuration table:
-
Set Maximum number of rows. 在这种情况下,您将看到所有 database table 记录(这样的字段可以表示为文本输入,并取决于版本) PhpMyAdmin):
-
IMPORTANT: Be sure to back up database 修改前.
Press Ctrl+F and perform search using homeslider keyword. 我们可以看到相同选项的重复记录. 同时,我们可以看到一些记录 NULL in id_shop_group and id_shop fields. 检查这些记录并删除它们:
-
现在我们应该修改以下文件:
模块/ homeslider / homeslider.php. 下载文件并打开 editor. Find the following code:$slider = array( 'width' => 配置::(' HOMESLIDER_WIDTH '), 'speed' => 配置::(' HOMESLIDER_SPEED '), 'pause' => 配置::(' HOMESLIDER_PAUSE '), 'loop' => (bool)配置::(' HOMESLIDER_LOOP '), );
将其替换为以下代码:
$slider = array( 'width' => 配置::(' HOMESLIDER_WIDTH ', null, $this->context->shop->getGroup(), $this->context->shop->id), 'speed' => 配置::(' HOMESLIDER_SPEED ', null, $this->context->shop->getGroup(), $this->context->shop->id), 'pause' => 配置::(' HOMESLIDER_PAUSE ', null, $this->context->shop->getGroup(), $this->context->shop->id), 'loop' => (bool)配置::(' HOMESLIDER_LOOP ', null, $this->context->shop->getGroup(), $this->context->shop->id), );
此代码指定将添加到的商店和组id database record (please check the screenshot with modified code):
-
现在我们应该修改以下代码:
return array( 'HOMESLIDER_WIDTH' => Tools::getValue('HOMESLIDER_WIDTH', 配置::(' HOMESLIDER_WIDTH ')), 'HOMESLIDER_SPEED' => Tools::getValue('HOMESLIDER_SPEED', 配置::(' HOMESLIDER_SPEED ')), 'HOMESLIDER_PAUSE' => Tools::getValue('HOMESLIDER_PAUSE', 配置::(' HOMESLIDER_PAUSE ')), 'HOMESLIDER_LOOP' => Tools::getValue('HOMESLIDER_LOOP', 配置::(' HOMESLIDER_LOOP ')), );
用下面的代码替换它:
return array( 'HOMESLIDER_WIDTH' => Tools::getValue('HOMESLIDER_WIDTH', 配置::(' HOMESLIDER_WIDTH ', null, $this->context->shop->getGroup(), $this->context->shop->id)), 'HOMESLIDER_SPEED' => Tools::getValue('HOMESLIDER_SPEED', 配置::(' HOMESLIDER_SPEED ', null, $this->context->shop->getGroup(), $this->context->shop->id)), 'HOMESLIDER_PAUSE' => Tools::getValue('HOMESLIDER_PAUSE', 配置::(' HOMESLIDER_PAUSE ', null, $this->context->shop->getGroup(), $this->context->shop->id)), 'HOMESLIDER_LOOP' => Tools::getValue('HOMESLIDER_LOOP', 配置::(' HOMESLIDER_LOOP ', null, $this->context->shop->getGroup(), $this->context->shop->id)), );
Please check the screenshot with modified code:
-
保存更改并上传修改后的文件.
重要:请务必将此文件保存在存储设备或 cloud 因为这个文件将被替换,当Prestashop将提供 update for this module.
-
Open the module in admin section. 您将看到没有设置(空白字段). 指定适当的设置. Save changes:
-
Clear Prestashop and browser cache. Refresh the page. Now slider 是否指定了宽度 module settings:
请随时查看下面的详细视频教程:
Prestashop 1.6.x Troubleshooter. 图片滑块为您的主页. 在“管理”部分设置的选项不起作用