FAQ Database Discussion Community

Getting javascript var from database record in Smarty

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

prestashop changing page icon doesn't work

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

Adding new table in rest api of prestashop webservice

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

Filter employees by profile_id in back office Employees tab

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

Where should development variables go in Prestashop?

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 on delivery select hide/show payment method

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

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

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

How to create a custom facebook like button?

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

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

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

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

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

prestashop 1.4 to 1.6 image missing issue

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

How to disable product or enable compare in prestashop 1.6?

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

Structure table of 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 - module - Load on each pageload

I'm developing a prestashop module The goal of this module is that when a page on the front office is loaded a mysql query runs. The query starts to sync the quantity's of all products. So they match the quantity's of a external stock management system. The code is already...

Prestashop 1.6 extend max size of product feature value

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?

Update SQL with Inner Join in Prestashop in DB

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

Add AJAX loader gif in 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...

Prestashop custom php file with query

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?

Prestashop override Blocktopmenu function

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

Prestashop select attribute combination photos

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

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