FAQ Database Discussion Community


How can I force module's install() function to copy files to override folder?

prestashop,prestashop-1.6
I'm creating a module which includes a new version of list_footer.tpl which exists in presta\admin1234\themes\default\template\helpers\list\list_footer.tpl So basically all I want from my module is to copy my list_footer.tpl to presta\override folder. Question is, how should I write the install() function for this purpose? I tried: public function install() { if...

Adding new table in rest api of prestashop webservice

php,web-services,rest,prestashop
I've been successful in creating an extra table in the prestashop products table throught rest api of webservice , however the api link http://127.0.0.1/prestashop/api/wb3d/1 wb3d is the new table which I have created in webservice . Which holds a path to an images directory somewhere on the web . This...

Prestashop - Add multiple category trees with helper form

php,prestashop,prestashop-1.6
I'm creating a prestashop module which need to select 2 categories root. I tried to add 2 fields with type "categories", but on the second category tree, it has the same ID and the same NAME as the first tree. $fields_form[1]['form'] = array( 'legend' => array( 'title' => $this->l('Setting'), ),...

prestashop CSS issue with in top menu

html,css,prestashop
I have modified top menu in order to make a dropdown submenu, I made it work, however I cannot reduce the height of the vertical items, although I have set to 15px (They have 60px in reallity) Here's my code (superfish-modified.css): /*** ESSENTIAL STYLES ***/ .sf-contener { clear: both; }...

How to create a custom facebook like button?

javascript,php,smarty,prestashop
I need to create facebook like button in product list page in prestashop. I created the face book like button in below . <div class="fb-like" data-href="{$product.link|escape:'html':'UTF-8'}" data-width="78" data-height="32" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div> But I need to create facebook like using <a> tag. How to create facebook like button in custom...

prestashop css vertical and horizontal centering [closed]

css,geometry,prestashop,centering
Hi i need help with centering few images on my prestashop webpage. I need help with 3 circles on bottom of the page (not with social icons) . I don't how center the images in circles. Please help...

Prestashop - Retrieve searched products results to custom module

prestashop,prestashop-1.6,prestashop-1.5
I need to retrieve the ($search['result']) from SearchController.php in my module when user has performed a prestashop search result. My code is the next public function hookActionSearch($params) { $my_var = $this->context->smarty; //1st test $my_var = $this->context->controller; //2nd test $my_var = $params; //3rd test $var_dump($my_var); //in the three cases Couldn't see...

Custom upload file on Prestashop page

php,file-upload,prestashop
I made a separate page (following this guide) so he can upload pdf files (certificates of their products). And another page to the customer's search according to the selected product. On the file upload page, the logic is as follows: In a form: Select the product (from a selector), and...

import image in Prestashop with a website URL

csv,prestashop
I have a website on which my all products are display and all product images are save on this website server. my new website making in prestashop on another server. I have a csv file which make according to prestashop. in this csv file images fill like : http://example.net/images/demo.jpg Like...

Prestashop on delivery select hide/show payment method

javascript,jquery,ajax,prestashop
I'm trying to figure out how to show/hide payment method on delivery method select. I tryed couple solutions but it didn't worked for me. One of them is this one: <script> $(document).ready(function(){ toggleFields(); $('.delivery_option_radio').on('change', function() { toggleFields(); }); }); function toggleFields() { if ($('#delivery_option_3_0').is(':checked')) { alert("Selected") } else { alert("Not...

Structure table of prestashop

prestashop
Do you know which table I can find users purchases (with its id) and the id of the producers? I'm trying but your help would speed my work....

prestashop: adding a product to cart, with custom fields

php,module,prestashop,cart
Good day all. I'm developing a module for prestashop, in which the user choose some settings, and then it is possible to save these settings and add a custom product to cart, using them as values for custom fields. I've added a new product, with 7 custom text fields. then...

Prestashop 1.6 - Add custom field to category

php,prestashop,prestashop-1.6
I would like to know how I can add a custom field to a category and how I can edit in the back office (under the description field). the field I would like to add is name description_long The field type is TEXT I already have overwritten my Front office...

Prestashop override Blocktopmenu function

php,prestashop,prestashop-1.6,method-overriding,function-overriding
I'm trying to override the generateCategoriesMenu function from blocktopmenu.php class BlocktopmenuOverride extends Blocktopmenu { public function generateCategoriesMenu($categories, $is_children = 0) { die( var_dump ('hello I am an override') ); } } I've set up this in the folder override/modules cleared the cache file class_index.php when I load my index page...

How does prestashop display modules

php,prestashop
my quest is to swap position of 2 modules in left column. I read that normally I should do this in administration panel -> live edit The problem is that prestashop used by this web was little bit edited, some modules were deleted, so live edit does not work. In...

Using schema.org/Product image on a non image element

seo,prestashop,product,schema.org,microdata
I am editing a Prestashop installation and have a slightly odd situation. In PS when you add a colour attribute to a product it shows an <a> tag with a background colour to show the colour choices. In the shop I am building for an art supplier, we are having...

prestashop a new product with features and images through a module

php,prestashop
Product information successfully added besides features and image. Here is my code: $product = new Product(); $image = new Image(); $langId = (int) (Configuration::get('PS_LANG_DEFAULT')); $name = Tools::getValue('pr_name'); $product->id_supplier = $arr['pr_supp'][0]; $product->id_manufacturer = Tools::getValue('pr_manuf'); $product->description_short = Tools::getValue('pr_short_desc'); $product->description = Tools::getValue('pr_desc'); $product->quantity = Tools::getValue('pr_cant'); $product->name = array($langId =>...

prestashop search by category and quantity of products

prestashop
I only reached: $results = $db->executeS(' SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_product` cp '.(Group::isFeatureActive() ? 'INNER JOIN `'._DB_PREFIX_.'category_group` cg ON cp.`id_category` = cg.`id_category`' : '').' INNER JOIN `'._DB_PREFIX_.'category` c ON cp.`id_category` = c.`id_category` INNER JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product` '.Shop::addSqlAssociation('product', 'p', false).' WHERE c.`active` = 1 AND product_shop.`active` = 1...

prestashop 1.4 to 1.6 image missing issue

prestashop,prestashop-1.6
I've upgraded a Prestashop site manually from 1.4 to 1.6.I can get the category images to appear but not the product images. My product path on the old 1.4 site takes the following route .../img/p/11-638-home.jpg but version 1.6 is asking for Original image is missing or empty (/.../.../../img/p/1/1.jpg) for product...

Prestashop, custom module, Get SQL value for the configuration form with $helper->fields_value

php,sql,prestashop
I'm currently creating my first Prestashop module, and I use the native function $helper to generate my configuration forms. I'm ok when using the basic fonction "Configuration::get" but because the limited size of the table ps_configuration, I use a new sql table, and I wish to load the data of...

Getting javascript var from database record in Smarty

javascript,jquery,smarty,prestashop
I'm working on a PrestaShop page with the file extension ".tpl". I get the javascript code to auto complete like this: var currencies = [ { value: 'Afghan afghani', data: 'AFN' }, { value: 'Albanian lek', data: 'ALL' }, { value: 'Algerian dinar', data: 'DZD' }, { value: 'European euro',...

Update SQL with Inner Join in Prestashop in DB

mysql,database,sql-update,prestashop,prestashop-1.6
I try to update the quantity in a Prestashop table. I have an INNER JOIN to get the upc from the table "ps_product_attribute" UPDATE ps_stock_available SET ps_stock_available.quantity = ps_stock_available.quantity - 1 INNER JOIN ps_product_attribute ON ps_product_attribute.id_product_attribute = ps_stock_available.id_product_attribute WHERE ps_product_attribute.ups = 01900000118; But I always have this error: #1064 -...

Prestashop 1.6 - TAX Calculation - Explanation

php,prestashop,prestashop-1.6
I've got a problem on PS 1.6.0.9 after about one mounth of customizzazions I found out a problem in TAX calculations. I have used the TAX calculations for Switzerland, with the lowest rate (2,5%). There is something wrong in the calculation algorithm. (See the attached picture. Sorry, my backoffice is...

Prestashop remove the call us info header

templates,header,task-parallel-library,prestashop
In which module and tpl file I can delete the "call us" info and number phone that appear in the Header template I'm using? Using Prestashop 1.6...

Prestashop Custom Module, how to update my sql value?

php,sql,prestashop
I wish to update my sql value for my custom module, but since this value is in a separated sql table, I stuck ... The first value, MY_TOPBAR, is updated correctly since she is updated in the ps_configuration table, but my second value, MY_HTML_DATA, isn't updated correctly in my table...

how to use prestashop with mongoDB?

php,mongodb,prestashop
I am starting to implement an e-commerce module with PHP. I analyzed and get prestashop is perfact for my requirement. I read almost all documentation of prestashop but I never find mongoDB. I decided to use database mongoDB. But I am not sure how to use it with prestashop. Can...

Prestashop select attribute combination photos

prestashop,prestashop-1.6
Short version : I want to get product photos that are assigned to product's attribute groups. Long version : I want to accomplish the feature by creating a custom module : on product page, you can choose a product color by choosing from a list of product's photos representing different...

REST service from Cordova with WAMP (local)

cordova,rest,prestashop
I am trying to extract products in a web service (prepared by my PrestaShop website), using WAMP (in local so). My code : index.js var app = { initialize: function() { this.bindEvents(); }, bindEvents: function() { this.onDeviceReady(); }, onDeviceReady: function() { var password = ''; var key = 'F51Q7VWPRREG7TA25DEY8UIZT8V79E5V'; var...

delphi XE8 REST Interface PUT in prestashop

rest,delphi,prestashop
I'm trying to update a manufacturer in Prestashop through the REST interface. So far I've been able to GET the information, but when I try to PUT, I Always get an HTTP 500 error. try Memo1.Text := '<prestashop><manufacturer><id><![CDATA[804]]></id><name><![CDATA[DisneyLand]]></name></manufacturer></prestashop>'; RESTRequest1.Params.Clear; //authentication does not work with PUT, use token as suffix.... RESTClient1.Authenticator...

How to disable product or enable compare in prestashop 1.6?

prestashop,prestashop-1.6
How to enable or disable the product compare option in the prestashop 1.6 ?

Prestashop 1.6 Module error: Notice on line 719 in file prestashop16\tools\smarty\sysplugins\smarty_internal_templatebase.php

php,smarty,e-commerce,prestashop,prestashop-1.6
I'm developing a module and extended AdminFeaturesController.php to display my custom field Add/Edit Feature Value, but it is showing following error in popup: Notice on line 719 in file D:\xampp\htdocs\prestashop16\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code [8] Undefined index: value I think it is due to I override the function initFormFeatureValue() in my...

Prestashop - Unable to add the product (parsererror) when product has attributes

jquery,ajax,prestashop
I have a website using Prestashop 1.4.7.3 (and cannot upgrade it for now) and have trouble since 2 days when I try to add a product in ajax cart, this is the error message : TECHNICAL ERROR: unable to add the product. Details: Error thrown: [object XMLHttpRequest] Text status: parsererror...

How to disable module hooks for certain controllers in Prestashop?

php,prestashop
I'm writing my own module and the essential option is to control controller from the module options. I know how to control tpl and js via module options but I can't get the way to control Prestashop controller from the module php file. Simply I want to know the way...

Can I override a scss style in Prestashop?

css,sass,prestashop
I'm using a default theme in Prestashop 1.6 and I have a problem. What I'm trying to accomplish is to simply move the navbar 25px higher. I know that I need to remove or change #block_top_menu { padding-top: 25px; } in blocktopmenu.scss, which is located not in the modules directory,...

prestashop changing page icon doesn't work

php,prestashop
I am using Prestashop for the first time. I try to change icons in the default theme but the change doesn't reflect on the UI E.g: in block contact info, I have originally <li> <i class="icon-phone"></i>{l s='Call us now:' mod='blockcontactinfos'} <span>{$blockcontactinfos_phone|escape:'html':'UTF-8'}</span> </li> I want to remove <i class="icon-phone"></i> and add...

PRESTASHOP1.6 Display categories block on product.tpl page

php,prestashop
My category block appeared fine on the left column on category page. But when I clicked on single product page, the category block is gone. I tried many things the last 2 days, it still won't show up. I tried to transplant the module to displayLeftColumnProduct (I assumed this is...

prestashop add extra tab to product management with some angular

jquery,angularjs,prestashop
I'm trying to add functionalities to prestashop product management system. With a simple module called Advprod. Using displayAdminProductsExtra hook I was able to add section to product management in prestashop backoffice. In this new section I've to work with angular. My actual tpl is correctly loaded by an ajax request...

Add AJAX loader gif in prestashop

ajax,prestashop
I have two questions regarding prestashop. 1) How do I add an ajax loader image in prestashop for an ajax call? 2) Can I add an AJAX loader image to every ajax call in prestashop by placing some code in one place? I am new to prestashop, so pardon my...

How to integrate prestashop with android?

php,android,api,prestashop,prestashop-1.6
Recently I have created a eshop website using prestashop https://www.prestashop.com/en/ And since I am going to build the android app for it. What includes in apps are only some basic function e.g. create customer account / list product / order product / pay / view order etc..common eshop functions... The...

How do I limit voucher's binding per transaction in Prestashop

bind,prestashop,cart
One of the prestashop's feature in cart pricing rules is the ability to bind different vouchers in one transaction. By default, you can bind 20 vouchers on a single transaction. The question is: How do I limit the vouchers per transaction as 10 vouchers only? Do I need to customize...

Existing eCommerce Framework vs custom eCommerce solution for Scalability [closed]

php,woocommerce,e-commerce,prestashop,scalability
We are planning to start an ecommerce startup and are evaluating scalability options for choosing between (PrestaShop/WooCommerce/OpenCart) or our own custom ecommerce solution. We have thought of the following optimization techniques for scalability: 1) CDN for static resources. 2) Load balancer for horizontal scaling once the traffic goes high. 3)...

How to create a page in a prestashop module such that the output is not wrapped in the site's template html AND using translation?

module,controller,prestashop
What I know to do: 1) Create a module controller that allows translation. I can declare texts to translate either in the controller itself or in the template: /modules/mymodule/controllers/front/list.php class myModuleListModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->l('Some text to translater'); $this->setTemplate('list.tpl'); } } /modules/mymodule/views/templates/front/list.tpl {l s='Some other...

How to change list sequence field register in prestashop 1.6?

sequence,prestashop
i want to change list sequence of field register in prestashop 1.6 like country - state - city, i have tried edit in themes - default-bootsrap - address but cannot work

Split best seller and new arrivals in prestashop

css,prestashop,prestashop-1.6
I'll like to split best seller and new arrival blocks in two rows. So there is a title with "NUEVOS" with the new arrivals products then below a title again "LOS MAS VENDIDOS" with the best seller items (removing the "tabs", just titles) Thanks you very much...

Smarty in prestashop .tpl, how to print only the value, not the full array

php,arrays,smarty,prestashop
I wish to print only the value "data" of this result : $ZC_HEALTHBAND_DATA Smarty_Variable Object (3) ->value = Array (1) 0 => Array (3) id => "3" option => "ZC_HEALTHBAND_DATA" data => "<table width="100%"><tr><td></td><td ..." ->nocache = false ->scope = "/..." I tried with {$ZC_HEALTHBAND_DATA|@print_r} but that's print both the...

Prestashop HelperFrom/List - messy layout

forms,list,prestashop,helpers
I'm new to prestashop and I worked the whole day on creating a back office interface that allows the user to write, edit, and delete articles. It is sort of a blog. I used Prestashop's Helpers (Form and List) and everything works great. I also added a new tab in...

Using translation with jquery in prestashop

javascript,jquery,smarty,prestashop
I'm trying to translate some terms when I'm using jQuery inside a smarty file. This is my jQuery code: else { $("#message").val("{l s='Please try to be clear.'}"); This phrase appears exactly as {l s='Please try to be clear.'} in my web page and doesn't take into consideration the translation mode....

No change in the front office in Prestashop in my first module

php,css,prestashop,prestashop-1.6
First day on PrestaShop. Using PrestaShop 1.6 from the PrestaShop tutorial: Creating a PrestaShop Module I have created a module(mymodule). But I don't see anything special in the front office. My module is listed in the modules' list. Installed and followed the tutorial. But still there's no change in the...

Prestashop 1.6 : Display a line TotalProductsTaxes in order-detail.tpl

order,prestashop,prestashop-1.6
I want to display a Total Taxes line in the Order-Detail.tpl I added that line of code but I don't know what to write to get TotalProductsTaxes instead of TotalProductsWithoutTaxes. I tried several things but they all broke the page. <tr class="item"> <td colspan="{if $return_allowed}2{else}1{/if}"> <strong>{l s='TVA :'}</strong> </td> <td...

Prestashop, in .tpl, how to use smarty variable in