prestashop-1.7

Prestashop custom page with own template

孤人 提交于 2019-12-23 03:03:12
问题 I am running my own prestashop theme and want to add a new page without the css. Therefore I added the three files php, controller and template. I placed the php in the root directory of my prestashop, added the controller to root/controllers/front and placed the template in root/themes/my-theme. If I call http://localhost/prestashop/?page=custom-page, I see the index start page, If I call localhost/prestashop/custom-page, I get a HTTP 404. Can someone help me to get my page displayed? PHP: <

Prestashop 1.7 JS files not being added

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 07:30:53
问题 Working on Prestashop 1.7 and updated my theme.yml file to look like the below but it doesn't add in the file. The file is in that directory but it isn't being pulled in. Any suggestions to the code? I want to include the JS file but it isn't being pulled in. assets: # If you're using this theme as child and you want to load # the parent theme assets, uncomment this line. # use_parent_assets: true # The following lines are showing how to load assets in your page # Uncomment and change value

Can't add js and css files to back office

牧云@^-^@ 提交于 2019-12-20 07:14:12
问题 I want to add JS and CSS files to back office in my module. But I get error: Attempted to call an undefined method named "registerStylesheet" of class "AdminModulesController". I've seen other posts (like this Show my module JS at footer in prestashop) or here https://devdocs.prestashop.com/1.7/themes/getting-started/asset-management/ So I want to avoid addJS() function as this is depreciated. But when I try to use $this->context->controller->registerStylesheet() and $this->context-

Link external JS file to Prestashop

一世执手 提交于 2019-12-13 20:16:18
问题 I'm creating a custom module in Prestashop 1.7, and I've tried many solutions but nothing solved my problem. I would add an external JS file to the header or footer of the website where the module is installed (and only when it's installed). <script src="https://cdn.monurl.com/file.js"></script> // JS file to include I tried to use the addJS() method in the displayHeader hook: public function hookDisplayHeader($params) { if (!$this->active) return; $this->context->controller->addJS('https:/

Upgrading Prestashop from 1.7.0.3 to latest with 1-click Upgrade module

て烟熏妆下的殇ゞ 提交于 2019-12-13 10:20:03
问题 I currently have a 1.7.0.3 Prestashop that I'd like to upgrade to the latest stable version. When I start upgrading from the 1-click Upgrade module, the latest version is downloaded correctly but I get an error about the backup name not specified. I then disabled this option of backing up files and database as I couldn't find where to fill in this information (I made manual backups). I am then told that 17152 files have to be modified, whereas the version comparison tells me that only 5157

how to override tpl module in prestashop 1.7.1.1

筅森魡賤 提交于 2019-12-13 01:53:56
问题 im trying to override the tpl of ps_categorytree module, but it didn't work i tried to put the file under override like this: override/themes/laber_ethan_home5/modules/ps_categorytree/views/templates/hook/ps_categorytree.tpl -im using prestashop 1.7.1.1 and i bought a theme. Help please! 回答1: you don't need to put this in override folder, simply use the modules folder that is in the active theme. The correct way to put your tpl file is: /themes/laber_ethan_home5/modules/ps_categorytree/views

New products from specific category prestashop

谁说胖子不能爱 提交于 2019-12-13 00:33:09
问题 I want get new products from a category, so I tried to change the controller. In prestashop 1.7 is NewProductsController.php, And inside there is this function protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setQueryType('new-products') ->setSortOrder(new SortOrder('product', 'date_add', 'desc')) ; return $query; } And I changed it into protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setIdCategory('MY-NEW-ID

Prestashop 1.7 admin theme css overrides

折月煮酒 提交于 2019-12-12 03:46:17
问题 I am trying to modify the PS 1.7 admin theme - simply to hide a few options and menu items. I modified ./adminFolder/themes/default/css/override.css And it works everywhere, except at Catalog/Products and Modules - as if there were no overrides. How can I get the css overrides to work globally in the admin area? 回答1: If you want to hide menu/sub-menus, you can set the visibility from within the database in the table [PREFIX]_tab (default is ps_tab ). The top menu has 0 for id_parent and

prestashop 1.7 set template .header footer not displaying

倾然丶 夕夏残阳落幕 提交于 2019-12-11 14:47:46
问题 Here is the controller code if($fortParams['Result'] == 'CAPTURED'){ Tools::redirect('index.php?controller=order-confirmation); }else{ $this->setTemplate('module:knetPayment/views/templates/front/confirm.tpl'); } tpl file code <h2>your payment succeasdadss. </h2> and output is only displaying message with no header footer leftcolumn 回答1: I had the same problem. I was migrating a module from 1.6 to 1.7. Finally, I solved the issue by modifying my .tpl file so that it includes {block ...}

RedirectMatch old product urls (without ID) to new url with basic (using ID) structure

独自空忆成欢 提交于 2019-12-11 08:07:27
问题 I'am facing a problem with our PrestaShop 1.7.5 installation. About 2 weeks ago, I tried to upgrade our PrestaShop version (from 1.7.4 to 1.7.5). Unfortunately 1 important module is not working any longer (override of the dispatcher is outdated), this module generates SEO-friendly URLs, without ID's in the URL, like this: domain/{category}/{rewrite} We prefer to do no roll-back and are considering two options. Option 1: Redirect all old product URLs to the new URLs Old url format: domain/