prestashop

Prestashop Module with controller throws 404

☆樱花仙子☆ 提交于 2019-12-11 06:39:37
问题 I am developing a module with a controller which is intended to read id_cart and do some actions. But I cannot invoke Controller, it always returns 404 error. Module: <?php if (!defined('_PS_VERSION_')) exit; class CartPortkey extends Module { public function __construct() { $this->name = 'cartportkey'; $this->tab = 'checkout'; $this->version = '1.0.0'; $this->author = 'Me and nobody else'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);

How to remove the /en/ url in the website

孤街醉人 提交于 2019-12-11 04:46:36
问题 How to remove the /en/ url in the website by default site showing as like above. please check the following url http://www.plrebooksstore.com it goes to http://www.plrebooksstore.com/en/ Please help me out Honney. 回答1: In prestashop, country code appears only if you have more than one language. If en is your only option, disabling the rest will let your store without the code. 回答2: You have 2 languages activated. Just de-activate one language, rewrite the .htaccess file and the links will

Prestashop 1.6 gamification module always adding and editing files

百般思念 提交于 2019-12-11 04:42:56
问题 I am developing a custom Prestashop 1.6 module. I added all the website to git in order to track my changes. I created the .gitignore file using gitignore.io. The problem is there are always new added files and changed files in the gamification module. Should I add the gamification module folder to .gitignore or there is another solution? 回答1: Here is the content of my .gitignore file: # Created by .ignore support plugin (hsz.mobi) ### Prestashop template # Private files # The following files

Prestashop 1.7.4 - Module error with namespace

末鹿安然 提交于 2019-12-11 03:23:41
问题 i'm studding prestashop for a futur project. I follow the documentation for create a module https://devdocs.prestashop.com/1.7/modules/concepts/hooks/use-hooks-on-modern-pages/ But when i follow all steps i have this error : Attempted to load class "ProductRepository" from namespace "Foo\Repository". Did you forget a "use" statement for another namespace? my structure is that : Module - foo - config services.yml - src - Repository ProductRepository.php - foo.php my services.yml # modules/foo

Prestashop 1.7.1 - Top banner which hook shall be used?

◇◆丶佛笑我妖孽 提交于 2019-12-11 02:22:21
问题 Following this question I have created a new banner. Now I want to insert a hook, but I am wondering which hook shall be used to display it on top of every page (as a promotional banner). Thanks 回答1: Assuming you're using the classic theme, you can use the displayBanner hook. If you look at header.tpl you can find the following block: {block name='header_banner'} <div class="header-banner"> {hook h='displayBanner'} </div> {/block} which should be displayed on top of every page 来源: https:/

smarty nested if condition is not working properly?

橙三吉。 提交于 2019-12-11 02:12:12
问题 I have written my code like this, {if $quant eq 1} {if $val neq ""} .....//some code {else} .....//some code {/if} {else if $quant eq 0} .....//some code {/if} but the above nested smarty if condition is not working as expected and it always give the results in else condition.Can anyone help me please, Don't know where am making mistake... 回答1: In smarty you have to write if else condition like that: {if $quant eq 1} {elseif $val neq ""} .....//some code {elseif $val neq "3"} .....//some code

virtualhost keeps redirecting to deleted alias information

﹥>﹥吖頭↗ 提交于 2019-12-11 00:53:52
问题 I have a DigitalOcean droplet (i.e. a VPS server), with Ubuntu 14.04 and Apache 2.2. I had 4 virtualhosts configured, with 4 different domains pointing to 4 different folders, no problem. I needed to point a 5th domain (let's call it www.someshop.tld ) containing a PrestaShop installation. I added the following Alias to the apache2/sites-available/domain1.conf file so that www.domain1.tld/someshop would lead to www/prestashop , and it worked fine <VirtualHost *:80> ServerName www.domain1.tld

why doesn't prestashop layered navigation block show on the front end?

ⅰ亾dé卋堺 提交于 2019-12-11 00:01:04
问题 I read docs, activated the layered navigation block, rebuilt the indexes, created a template, but it doesn't show at all on the front end. Why? Thank you 回答1: Make sure the category currently active in the module's configuration. Steps: 1. go to layered navigation block configuration 2. edit template 3. check the categories in "Categories used for this template" 回答2: In order to use the Layered Navigation Block you need to have mod_rewrite enabled and active on your server. You also need to

Prestashop and null fields in DB

非 Y 不嫁゛ 提交于 2019-12-10 23:41:30
问题 I have a very simple piece of code : $dropOrder = new DropOrder($dropOrderId); $dropOrder->is_supplier_paid = $payValue; $dropOrder->save(); It works and saves a 'is_supplier_paid' field value into the database. But it also does unexpected actions and fills all null valued fields with 0 values. I try to save it like this : $dropOrder->save(true); But I still have the same strange behavior. I want to change one field only and don't touch the other ones. 回答1: Values are formated by ObjectModel: