FAQ Database Discussion Community


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',...

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...

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 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...

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...

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 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...

Update product from a module in prestashop

php,mysql,prestashop
I have to update the price and quantity values of specific products in a database. As I understand, simply executing sql commands is not a great option since there are a lot of tables which have similar informations. I have read that Product() object should be created. How should I...

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...

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 - 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...

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; }...

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 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 =>...

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...

Prestashop 1.6 extend max size of product feature value

prestashop
This is my first question on stackoverflow :) I need to import a csv file with product features values longer than 128 characters. How can I extend the maximum size of product features values in prestashop 1.6?

How to add image during programmatic product import in prestashop?

php,prestashop,prestashop-1.5
I can't find a proper documentation on adding images during product inserting. Here is the working code of my xml product import script. I have no idea how to add product images also while adding a product. foreach ($xml->Products as $product_xml) { if ($product_xml->Valid_internet_product == 1) { /* Update an...

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...

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, 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...

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,...

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...

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...

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...

Filter employees by profile_id in back office Employees tab

sql,prestashop,prestashop-1.6
i try to apply a filter by profile on my tab "employees" in back-office, just need to list the employees with profile_id = 6. I found this part of code in AdminEmployeesController.php, line 175 to 184 : public function renderList() { $this->_select = 'pl.`name` AS profile '; $this->_join = 'LEFT...

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...

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

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 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...

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...

Prestashop, in .tpl, how to use smarty variable in _r} but that's print both the...

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 display custom field in Feature Add/Edit form

php,smarty,e-commerce,prestashop,prestashop-1.6
I am able to display my custom field in Feature Value Add/Edit form by overriding AdminFeaturesController and overriding initFormFeatureValue() function. I want to do the same for Feature Add/Edit form but cannot find function to override. I tried renderForm() function but didn't work. Which file/class/controller/function should I look into to...

Prestashop 1.6 product_list: get number of attached attribute combinations

php,e-commerce,prestashop
I'm building my first prestashop. I have a couple of products with attribute combinations that have an impact on the price. In list views, I would like to detect if a product has more than one combination attached to it, in order to display a 'from' before the price. I...

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...

All Payment Modules in Prestasop Not Displaying

module,prestashop,payment,prestashop-1.6
please help me None of my payment modules are being displayed on the final checkout page . I have installed and configured the following modules correctly payment by cheque Bank Wire Cash on delivery. Payu (payment gateway like paypal ) All the above worked fine until past month when they...

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....

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...

AH01630: client denied by server configuration Apache

linux,apache,.htaccess,prestashop,prestashop-1.6
I get this error when trying to access localhost via a browser. 403 Forbidden I use Ubuntu 14.04 LTS Here is my configuration file: etc/apache2.conf # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See http://httpd.apache.org/docs/2.4/ for...

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...

Where should development variables go in Prestashop?

prestashop,prestashop-1.6
I'm trying to add custom variables to use in Prestashop. In other packages I would throw them in the config file as constants but with Prestashop it looks like it can recreate the settings.inc.php file when upgrading. I don't want to run the risk of losing the vars. Is there...

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...

Uploading category languages in prestashop error

php,csv,import,prestashop
I'm trying to migrate categories from osCommerce 2.2 to the newest Prestashop using the Prestashop's own CSV import. I have succeeded in uploading English, Finnish, Deutch, Italian and French category languages. I am now facing a problem with Russian. The CSV file imports just fine until row 85-86, which are:...

Prestashop Change description error on validation

prestashop
I want to change description this error: There is 1 error address1 is invalid. « Back I want to change from "is invalid" to "is invalid. Address field must not contain @, #, % and other" I searched file, whose show errors. (./themes/default-bootstrap/errors.tpl) {if isset($errors) && $errors} <div class="alert alert-danger">...

Prestashop custom php file with query

php,include,connection,prestashop,require
I am new to prestashop and I have made a custom php file which is called by ajax and has SQL queries. The problem is that this file doesn't have a connection. What should I include or require in it to achieve it?

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...

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...

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 ?

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...

Prestashop changes to theme

prestashop
I am totally new to Prestashop, I have only just looked at the dashboard today for the first time. I have been tasked with making a small design change (CSS) to a Prestashop site that used an off the shelf theme. I know in WordPress you can make a child...

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...

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...

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...

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 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 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...