prestashop-1.7

Displaying value from the “ps_product” table in a twig file in prestashop 1.7.5

夙愿已清 提交于 2020-03-16 11:20:11
问题 I'm currently migrating an old shop in which the fields isDirect and isMotor already exist in the ps_product table. I added these two fields in the ps_product table of the new shop. These two fields are tinyint type, and their value is 0 or 1 . Here is my Product class : public $isMotor; public $isDirect; with following data-structure: 'isMotor' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'isDirect' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), Then when I try

Displaying value from the “ps_product” table in a twig file in prestashop 1.7.5

99封情书 提交于 2020-03-16 11:19:19
问题 I'm currently migrating an old shop in which the fields isDirect and isMotor already exist in the ps_product table. I added these two fields in the ps_product table of the new shop. These two fields are tinyint type, and their value is 0 or 1 . Here is my Product class : public $isMotor; public $isDirect; with following data-structure: 'isMotor' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'isDirect' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), Then when I try

Displaying value from the “ps_product” table in a twig file in prestashop 1.7.5

﹥>﹥吖頭↗ 提交于 2020-03-16 11:19:11
问题 I'm currently migrating an old shop in which the fields isDirect and isMotor already exist in the ps_product table. I added these two fields in the ps_product table of the new shop. These two fields are tinyint type, and their value is 0 or 1 . Here is my Product class : public $isMotor; public $isDirect; with following data-structure: 'isMotor' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'isDirect' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), Then when I try

Add product to basket via Javascript (jQuery) in Prestashop 1.7.5.0

懵懂的女人 提交于 2020-01-24 22:45:08
问题 I'm creating a theme for prestashop 1.7 and I try to create an ajax call from javascript (jQuery) that adds the product with a specific name to the shoppingbasket. (I read through documentation, looked at modules, googled for hours, but no luck). So basically: <button id="buyProduct" data-productname="myProduct">Buy Product</button> $('#buyProduct).click(function(){ var productname = $(this).data('productname'); // Do Prestashop Magic }); 回答1: Add products by name is bad idea. You need id

prestashop 1.7 how to edit the “add product” page in backoffice

对着背影说爱祢 提交于 2020-01-04 06:50:27
问题 I am trying without any success, to edit the page in the subject, because I have added 7 more fields in the product table that I would like to manage in the backoffice. I have seen that the 1.6 version of Prestoshop had a specific view for that page and that it was pretty simple to add fields to the form. As to the 1.7 I'm going literally crazy, because I cannot find any view that manages the "add product" page. Any hint? I know that it could probably have something to do with the

Make an ajax request from a Prestashop module

吃可爱长大的小学妹 提交于 2020-01-01 00:48:13
问题 I am making a module and I need to make an ajax request, with JSON response if possible, how can i do this ? I don't understand really well the structure of Prestashop 1.7 on this. Thanks ! 回答1: This is pretty simple, you just have to make the controller with Prestashop's standards then link it to your frontend Javascript. Name a php file like this : ./modules/modulename/controllers/front/ajax.php Then put inside : <?php // Edit name and class according to your files, keep camelcase for class

How to override prestashop core files

☆樱花仙子☆ 提交于 2019-12-25 01:49:36
问题 Can you please explain how to override following core files properly in presatashop. Prestashop 1.7.1.2 allowed only controllers, modal and tpl files in override folder. We can not override src folders in same way. src/PrestaShopBundle/Controller/Admin/ProductController.php src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig 回答1: I don't believe this is possible in Prestashop 1.7. See their post here : it seems like they want you to use hooks, ie extending not overriding... 回答2:

Top ad banner Prestashop 1.7.1

孤街浪徒 提交于 2019-12-25 00:51:25
问题 I would like to understand how this top banner (SALE 70% OFF ALL PRODUCTS) included in this image can be done: https://medias2.prestastore.com/906398-pbig/banner-manager.jpg Is it needed an extra module for that? If so, which one? If not, how can you modify the theme to include it? 回答1: This is Banner Block (blocbanner in files) module, included by default, that you can manage in your backoffice. 来源: https://stackoverflow.com/questions/47274748/top-ad-banner-prestashop-1-7-1

How can I add a custom product “Sort by” field in prestashop?

◇◆丶佛笑我妖孽 提交于 2019-12-24 15:03:07
问题 I am new to Prestashop and I am trying to add a new "Sort by" field ( where by default you have: "Relevance" , "Name, A to Z" , "Name, Z to A", "Price, low to high", "Price, high to low" ) As you guys know, the functionality is located in the module called: "Ps_facetedsearch" , link here. I tried: Editing the module files, this works, but I can't upgrade the module anymore if I want to keep the functionality. Overriding, but can't seem to get it working, it still uses the same old module, not

SessionHandler::gc(): ps_files_cleanup_dir | Permission denied (13)

走远了吗. 提交于 2019-12-23 12:08:25
问题 i have a problem with PHP7 in CentoOS (WHM/CPANEL) and Prestashop 1.7 the system gives me this messagges: Notice on line 429 in file /home/onywf3fr9a/public_html/app/cache/dev/classes.php [8] SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/cpanel/php/sessions/ea-php70) failed: Permission denied (13) 回答1: I have the same issue, I changed the session.save_path to "/tmp" in my php.ini 回答2: For fixing the «Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir("/var/cpanel/php