Here's a little snippet I use in my ajax files: $module_name = 'mymodule'; if (Module::isInstalled($module_name) && Module::isEnabled($module_name)) { $mod = Module::getInstanceByName($module_name); if (method_exists($mod, 'doSomething')) $mod->doSomething(); } Now you could use Module::getInstanceByName('mymodule')->l('string'), but I almost sure it would work. This is because translations controller scans for $this->l\((.*)\) inside module folder using...

most likely you need installing a module to add custom html. here is one to add on the bottom/footer area. http://www.prestashop.com/forums/topic/165066-free-prestashop-module-easy-footer/ you can add custom html content on footer area and it will be visible to whole website....

You need to go to your Phpmyadmin, click on the prestashop database then go to the your database prefix_configuration table and look for the HOME_SLIDER fields. To make this easier, if you click the name colum, it will sort them out alphabetically. Now what you need to do is make...

It turned out it was a problem with Youstice v1.7.2 module It was causing the API error, what we did in the end was change the name of a folder in the public_html>modules from- "yousticeresolutionsystem" to "yousticeresolutionsystemX" because it wouldn't allow me to delete the folder to stop the API...

It may be due to inconsistent hooks names, you registered leftColumn hook, however, all hooks since 1.5 (I think) begin with either action or display. Therefore, try registerting displayLeftColumn and have a method hookDisplayLeftColumn or rename your current method to hookLeftColumn.

You can go for absolute position those images inside their container, and work your way from there like so: position: relative for .certifikat class, so any absolute positioned children, will be bound to their container position: absolute for <img> inside the .certifikat class So to wrap it up, for the...

Perhaps you just can ALTER the table: ALTER TABLE ps_attribute_lang as al ORDER BY CASE WHEN al.`name` LIKE '% - white' THEN 1 WHEN al.`name` LIKE '% - black' THEN 2 ELSE SUBSTRING(al.`name`, LOCATE(' - ', al.`name`)+3) #prefix for color END ASC EDIT Try to do the re-numbering this way:...

No need to another code development hassle. Use very good and free Ship to Pay module . Works with 1.6/1.5 and even with 1.4 How its works? You have ex. Cash on Delivery shipping/payment method. So in next Payment step Your customer will not see any Bankwire, PayPal, Pick Up...

The problem is it seems there are few resources around. Is there any library already there/ offical one / or I need to start create the API from stratch? In contrast to one of the comments on your question, Prestashop does actually offer a REST service. In the documentation...

You won't find anything useful into the Product class because the attribute-image association done on Prestashop for Attributes value is done in a silly and simply way. when you save an image associated to an attribute, a image file is created under the specific folder _THEME_COL_DIR_ that is nothing more...

This is a well known bug/situation in PrestaShop. PrestaShop tries to manually copy class methods to \override\classes\* files, and sometimes the lines miss-match or the line break are wrong, and the end result is incorrectly copied lines which cause syntax errors. That happens both on installation and uninstallation. Basically, you...

Your module name is set incorrectly: $this->name='mymodule'; // This is internal module name in lowercase letters, // must match the folder name too // Class name must match too but it can be in camel case : MyModule ...

We can able to enable or disable the product compare option using the following location in backend. "Preference -> Products -> Product comparison" To Disable: Set the value "0" to disable product comparison. To enable: Set the maximum number(like "3") of products want to compare....

I found the solution :) I did a misstake with my variables ... To many variables, that's don't help ^^' So the right solution to get the sql value is that one : $query='SELECT `data` FROM `'._DB_PREFIX_.'customtable` WHERE `option` = \'ZC_HEALTHBAND_DATA\';'; $ZC_HEALTHBAND_DATA = Db::getInstance()->getValue($query); $helper->fields_value['ZC_HEALTHBAND_DATA'] = $ZC_HEALTHBAND_DATA; ...

Talking about images: first make a cycle foreach to repeat this: $img = new Image(); $img->id_product = $product->id; $img->add(); You can do here much more. Languages and etc.. After this just update: $this->copyImg($product->id, $img->id, $yourImagePath) ...

Your usage of Microdata and Schema.org is not wrong. The Google Structured Data Testing Tool is just "complaining" that you did not specify all properties Google Search needs for displaying one of their Rich Snippets. It seems that the culprit is the last Offer: <span itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> <link itemprop="availability"...

You can check the class ProductCore in classes/Product.php for various methods and properties Generally, you would write some code like this //assuming you have the product id as $id_product $product = new Product($id_product); //change the product properties $product->quantity = 10; $product->price = 60.2; //save the changes $product->save(); Edit: To update...

For a detailed overview of the prestashop Database schema i suggest to check these two pages: https://www.prestashop.com/blog/en/a-new-physical-data-model-available-for-prestashop/ http://doc.prestashop.com/display/PS14/Database+Structure The first link contains a png/mysql workbench image of the whole prestashop db structure, and the second one contains a list of all the tables, with their description and primary keys. N.B....

It's good practice to use {literal} tags around JS blocks: {literal} <script> /... </script> {/literal} But when you need to insert some smarty into JS block, it won't work; To make it work you have to do the close and reopen tags (looks like a little bit of a hack...

I assume this AdminController for your model. Now a model obviously can't hold a file in table column. What you can do is hold path to the uploaded file. That's what you can save. You should look in AdminController class (which you extended). When you submit a form, one of...

it's probably cause by poorly written CSS rules. Your logos are positioned using position:absolute;,which is causing all the trouble. The anchor element <a> is positioned statically, meanwhile the image inside is position:absolute;. Therefore, the anchor element doesnt have any height or width and is unclickble. What you can do is...

It's because Prestashop uses 1) Module overrides and 2) Template cache system. You should disable cache memory in BO in Settings -> Performance and then clean the cache with the button on the top right. Next You need to edit: not: root/modules/blockcontactinfos/blockcontactinfos.tpl but root/themes/yourthemename/modules/blockcontactinfos/blockcontactinfos.tpl file. This should help fix Your...

If you are using the itemprop attribute for an a element, the property value will be the URL specified in the href attribute, not the content of the a element. So in your example, the image property has the value link-to-product (which will be interpreted as URL): schema:Product → schema:image...

You problem is definitely about permissions. It depends on how Apache and PHP are set up. First, check who owns the folders. For example, simple apache2 and php installation runs as www-data user. For example, if you connected to FTP with 'user1' and uploaded your files there, then the files...

That's kind of strange, because that image is used everywhere, where the image is set, but doest exist in file. The image used here is img/404.gif, but if you change it, it will be used in other places too. If you want to change category images (sub-category images I assume?)...

I actually have a similar setup. I installed Bitnami's Redmine VM on google cloud compute. Most Bitnami VMs come with git installed, but not all. So try this: Login to your Google Cloud Instance. then run (omitting the $, of course): $ which git should display something like /usr/bin/git if...

I did not find a rational explanation for this, so I just went around and changed the link_rewrite validation just to return true no matter what. Checked and the link works. Hope this someday helps someone. In ROOT/Classes/Validate.php On line 325: public static function isLinkRewrite($link) { if (Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL')) return preg_match('/^[_a-zA-Z0-9\-\pL]+$/u',...

File default-bootstrap/sass/modules/blocktopmenu/css/blocktopmenu.scss compiles into default-bootstrap/css/modules/blocktopmenu/css/blocktopmenu.css If you have found the .scss file, there must also exist a corresponding .css file. Now most users just modify .css file directly and there is nothing wrong about it, but if you're doing lots of styles changes (like changing color scheme for the entire...

You can change all of the error statements in the backoffice of Prestashop Go to your Prestashop backoffice: Localisation->translations in the select option box, select "error message translations" there you can adjust all of the error messages in the whole website. It's better to do this instead of changing some...

The feature value field should be 255 characters long, unless you are using some special characters or different encoding. Anyway, change the column type in ps_feature_value_lang table to your preference, Then make an override for FeatureValue.php class. Make a file at override/classes/FeatureValue.php and inside this file: class FeatureValue extends FeatureValueCore...

Well, it was because I used double quotes instead of a single quote in this line : {l s="My new string"} Cf: https://www.prestashop.com/forums/topic/376146-cant-translate-strings-from-included-tpl-in-a-custom-module/...

if u want to add other webservice table as your association to your product , you can take a look at how associations is done in category.php located in prestashop/classes. 'associations' => array( 'categories' => array('getter' => 'getChildrenWs', 'resource' => 'category', ) ) as you can see there is a...

Here is the solution I found after reading admin\themes\default\template\helpers\form\form.tpl In this file, there is this condition {elseif $input.type == 'categories_select'} {$input.category_tree} So, I used 'type' = 'categories_select' instead of 'type' = 'categories', and I generated the categories trees manually. $root = Category::getRootCategory(); //Generating the tree for the first column $tree...

If smbdy will get in trouble with this. Possible solution is: There is a trigger in admin panel that turns off all other modules except native. The path is: Admin panel -> Configuration -> Performance -> Turn off all non-native modules. It has to be off.

These example are usually old and poorly written. They lack structure. But for your purpose I suppose they're ok. Use hookDisplayCarrierList($args). Check $args to see which carrier has been selected, then return <select> element which you shop addresses. This hook is triggered every time a user selects a carrier...

You have to override the template of your theme: go to themes/<your_theme>/modules/ Find the blockbestsellers directory. Inside this directory, you'll find a tab.tpl file, empty it. Then in the blockbestseller-home.tpl file wrap the if statement with a row: <div class="row"> the content already present </div> Do the same for blocknewproducts...

if you have the the price with tax and the price without tax you can calculate the tax amount and store the value in variable: {assign var='totalTax' value=$total_products_wt - $total_products} {displayWtPriceWithCurrency price=$totalTax currency=$currency}</span> ...

Ok, the answer is to just use the 'switch' type: that will build a 'slider' switch on backoffice page. For future reference, I'm gonna report 3 different ways to accomplish the same task: radio, select and switch. They have all been tested on AdminAddressesController and are bound to a custom...

I would count the number of elements with the error class: if it's 0, enable button, if not, disable it $(document).on('focusout', 'input.validate, textarea.validate', function() { if ($(this).hasClass('is_required') || $(this).val().length) { var result = window['validate_'+$(this).attr('data-validate')]($(this).val()) if (result) { $(this).parent().removeClass('form-error').addClass('form-ok'); // There's the chance of no errors, check it. var numItems =...

You can use Configuration::updateValue('YOUR_CUSTOM_NAME', 'your_value') to save and update your custom value and Configuration::get('YOUR_CUSTOM_NAME') to retrieve it. These values are stored in the ps_configuration table of the PrestaShop database and they will not be overwritten by updates....

I took a look at it again, it may be because parent functions is private : private function generateCategoriesMenu($categories, $is_children = 0) As you know, private functions are only visible in that class in which it was declared. In this case the whole situation works a little bit like declaring...

There are two problems I see with your code. 1) you have not put {} brackets around $mysmartyvariable2. This will assign 'undefined' to height2 as smarty will not process this variable at all, and the javascript variable named $mysmartyvariable2 is not defined. 2) you need to use {literal} {/literal} tags...

The filters for BO orders are created by controllers\admin\AdminOrdersController.php. In order to preserve prestashop core code it's indicated you create an override for this controller, where you'll need to join the table that you need (if not already joined), specify where in your table is the field you want to...

It means jsut what it says. Your code tries to declare a class twice (with the same), so there is a conflict. I also do not understand why your class is named ProductOverrideOriginal. All Prestashop overrides must override original PrestaShop classes, for example class Product extends ProductCore { ... From...

There are a couple of things I see just looking at the configuration. You have your vhost config named etc/apache2/sites-enabled/prestashop.config But that is not the file type that is being included in the apache.conf file. # Include the virtual host configurations: IncludeOptional sites-enabled/*.conf Your apache setup looks for .conf files...

First Backup Your Entire code.Then follow step by step Step 1 : When I try moving the images I get the following error. Error: Your server configuration is not compatible with the new image system. No images were moved. Step 2 : First disable friendly URL in SEO(backend) then Go...

I won't be possible because all classes and module use SQL queries; I would be theoretically possible to build your own Db driver implementation, but then again you couldn't use it since it needs to process SQL. Currently there are 3 Db driver type: PDO, mysqli and MySQL, the best...

It is hookDisplayFooterProduct not hookdisplayFooterProduct and you should use hookRightColumn instead of hookdisplayHeader (correctly hookDisplayHeader): public function hookDisplayFooterProduct($params) { return $this->hookRightColumn($params); } ...

@gskema Thank you for pointing me in the right direction. Also i want to say that I'm aware that its not a good idea to run my query's on each page view. I was planning to add an timer so it only runs a query every 30 minutes when a...

Apart from upgrading to v1.6.0.11, the solution was to add SetEnv HTTPS On at the very top of .htaccess. That's because several prestashop functions rely on $_SERVER['HTTPS'] and/or $_SERVER['SSL'] vars to guess the urls. One of the most notable functions using them and itself used by many others is Tools::usingSecureMode()....

to add a field in your backoffice you willl need to override the AdminCategoriesController, precisely the function renderForm() and add the new field in it. To achieve this create a new file AdminCategoriesController under the /override/controllers/admin/, then declare in it the extension of the original controller and copy in the...

There are only 2 parameters passed to that hook implementation: $params['query'] - which is the string customer search for $params['total'] - which is the total number of results The search results are not being passed, so you can't get them that way. To get them you will need to override...

You won't be able to do it easily. When you import a CSV file, PS copies the image from the URL to it's server, then it has to make copies of this image in different sizes, in other words prepare the image in it's own standards/configuration. If you really really...

Ok, a lot more digging and creative googling - and I found my answer: this great Miva_Password PHP class by Brandon0 on GitHub. I created a simple test - and managed to match the password hash. Unfortunately, to do this properly, I'd have to make quite a few changes to...

Texts are located at themes/default/order-carrier.tpl Line 184 {l s='Free'} Which means that this text is translatable as Front-Office string. Easy way to find it is look at compiled HTML for specific classes/ids, for example <div class="delivery_option_price"> Then search through all your PrestaShop files for this string and you will find...

Okey, so did u enable product.tpl left column? You could see menu on left column by default. Just do this: Go preferences->themes->Advanced settings and turn on product page left column. (http://prntscr.com/6xico8) And this is what I see on product page now: http://prntscr.com/6xicxh . If still nothing, try to reset your...

If you want to translate text in FrontController, you can only do it in two ways: Translate the texts inside a template // Inside module front controller $template = '.../template.tpl' $this->context->smarty->fetch($template) // Inside template.tpl {l s='Translateable text' mod='mymodule'} Or use strings already translated inside main module file // Inside module...

I found the solution ! The problem came from the cart tpl file in the theme folder (in modules/blockcart). The tpl has a replacement method for ' that replace / too. As the attributes was created with / in the name, that was a real mess. I commented the line...