prestashop

How to add javascript in a prestashop module

孤者浪人 提交于 2019-12-10 23:38:35
问题 Is it possible to integrate javascript in a module without a direct injection in the template smarty? 回答1: Solved , I added a Js file in my module directory (ex : mymodule/views/js/abo_front.js). In my module class, I created a Hook to the header to declare my js file in the header. public function install() { return parent :: install() && $this->resetDb() && $this->registerHook('header'); } public function hookHeader($params) { $this->context->controller->addJS(($this->_path).'views/js/abo

checkbox styling and making it checked

元气小坏坏 提交于 2019-12-10 21:57:06
问题 The checkbox retrieved from database is so long that it is going downwards, is there any way to make it as four layers when clicked on "all fields" checkbox all checkbox must be checked. How this to be done? My code :- protected function getConfigForm() { $sql = 'SELECT id_order_state,name FROM '._DB_PREFIX_.'order_state_lang'; $results = Db::getInstance()->ExecuteS($sql); $values_query = array(array( 'id' => 'AllFields', 'name' => $this->l('All Fields'), 'val' => 'All', )); foreach ($results

Prestashop, cannot require Module class

蓝咒 提交于 2019-12-10 18:36:06
问题 Problem Related issue, I have been trying to apply related solution to my project, however I am not able to execute Module::getInstanceByName('modulename'); I do not even have access to Module class, which makes it hard for me to access application context and my own module context class_exists('Module') Returns false . I also provide the directory structure of my module from which I am attempting to access Module . ├── mymodule.php ├── config.xml └── somedirectory └── index.php Where

Prestashop - Module, SEO & URL and parameters?

坚强是说给别人听的谎言 提交于 2019-12-10 17:39:43
问题 I made a module for Prestashop that will display content based on the given ID in parameter (&id=X). I'd like to set a nice url for this module. Using SEO and URLS, I see that it's possible, but it keeps the ?id=X in the url. For example, if I define the url to my module to be /pretty-module I will have the same links but with the different id : /pretty-module?id=1 /pretty-module?id=23 What I'd like to do, is the following : /pretty-module => will set id to 1 /even-prettier-module => will set

can't override class file in module in prestashop

喜欢而已 提交于 2019-12-10 17:24:41
问题 I want to override class(Product.php) file using my module. If i put it in root/override/classes/Product.php then it is working. But I want to put it in modules/my_module/override/classes/Product.php Then it is not working for me. If anyone done something like this then please let me know how can I do that ? Thanks. 回答1: The location that you put the file is the correct one. Note that the file must be there before you install the module. Putting it there after it's installed will do nothing,

Extend prestashop webservice resource

别来无恙 提交于 2019-12-10 15:18:58
问题 I'm trying to extend carts resource with one more field which should output result of Cart::getSummaryDetails call. I've extended CartCore class to add new parameter and corresponding method like this: class Cart extends CartCore { protected $webserviceParameters = [ 'fields' => [ 'id_address_delivery' => ['xlink_resource' => 'addresses'], 'id_address_invoice' => ['xlink_resource' => 'addresses'], 'id_currency' => ['xlink_resource' => 'currencies'], 'id_customer' => ['xlink_resource' =>

Prestashop Error 404 at moving to server

邮差的信 提交于 2019-12-10 11:41:00
问题 At moving from local to a server my prestashop web, appears all the text (I think it connects correctly to the database), but it doesn´t visualizing any images,CSS,etc... I´ve modified config/settings.inc.php file and modified PS_SHOP_DOMAIN, PS_SHOP_DOMAIN_SSL and SHOP_URL from the database and also deleted the .htaccess file. Thanks! The same is with the backoffice: 回答1: you can do it by two ways: navigate into backoffice to SEO&URL link, set correct values for Shop domain & SSL domain &

Prestashop: Out of Memory (allocated …) in ../../../classes/Configuration.php

丶灬走出姿态 提交于 2019-12-10 11:13:55
问题 Prestashop suddenly gives an http 500 error . I turned on error log and got this: "Fatal error: Out of memory (allocated 709623808) (tried to allocate 130968 bytes) in /var/www/vhosts/44/252639/webspace/httpdocs/shop.mywebsite.com/classes/Configuration.php on line 206". I double checked the Configuration.php on line 206 and it's just a standard prestashop file, nothing weird in it. After all it's an "Out of memory" error so maybe I should increase memory. phpinfo() shows memory_limit 1024M ,

Where to register global smarty modifier in PrestaShop?

南楼画角 提交于 2019-12-10 10:15:57
问题 I'm creating a store based on PrestaShop (v 1.6), and I want to register my custom modifier plugin to be accessible from any templates (includinf front and back-officetemplates). The question is where to place the registration code? Now I use a Tools class override to add function to handle modifier (that is acceptable practice in case of store-specific functionality, afaik), and smarty.config.inc.php to register plugin (because all PrestaShop plugins are registereg here), but this file

Get sibling categories in category.tpl for the current category in prestashop

独自空忆成欢 提交于 2019-12-10 09:37:46
问题 I need to list sibling categories in the category page in a Prestashop theme. Currently it does show the sub-categories if any but not the sibling categories. A quick answer would really be appreciated! Thanks. 回答1: For to start i would have created a override file in /override/controllers/, named CategoryController.php And add this: <?php class CategoryController extends CategoryControllerCore { public function displayContent() { // Get the global smarty object. global $smarty; // Get