prestashop

Prestashop 1.6 - Add custom field to category

落爺英雄遲暮 提交于 2019-12-06 02:28:06
问题 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 , and my field is well displayed . override\classes\Category.php <?php class Category extends CategoryCore { public $description_long; /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'category', 'primary' =

Prestashop Endless Spinning Product Save Button

a 夏天 提交于 2019-12-06 00:53:21
I was running Prestashop 1.6.1.1. The product save buttons would take about 45seconds to load. I upgraded to 1.6.1.3 and they now don't load at all. I tried rolling back and upgraded to 1.6.1.4. I deleted Smarty Cache, Deleted Chrome's history, cookies etc. I tried on multiple computers at work. I replaced admin/theme and controller folders with 1.6.1.4 directly. When I inspect the Network requests I see a handful of the tabs are not loading and get 500 errors and one with 404. The product save buttons won't completely load until all the tabs have loaded. In Firefox when I chose to resend the

Get sibling categories in category.tpl for the current category in prestashop

☆樱花仙子☆ 提交于 2019-12-06 00:16:31
I need to list sibling categories in the category page in a Prestashop theme. Currently it does show the sub-categories if any but not the sibling categories. A quick answer would really be appreciated! Thanks. For to start i would have created a override file in /override/controllers/, named CategoryController.php And add this: <?php class CategoryController extends CategoryControllerCore { public function displayContent() { // Get the global smarty object. global $smarty; // Get current category's parent. $parent_category = new Category($this->category->id_parent, self::$cookie->id_lang); //

401 Error when connecting to PrestaShop webservice from android

最后都变了- 提交于 2019-12-05 20:54:54
I am trying to call a webservice in PrestaShop but i get 401 not authorized error. Even though i have passed the username key. I tried the authenticator too but i get an error HttpRetryingError. Find below the code snippet of what i have done. Method one: final String username = "key_here"; final String password = "";// leave it empty URL urlToRequest = new URL(urlStr); urlConnection = (HttpURLConnection) urlToRequest.openConnection(); urlConnection.setDoOutput(true); urlConnection.setRequestMethod("GET"); urlConnection.setRequestProperty("Content-Type", "text/xml;charset=utf-8"); String

PrestaShop: Delete all testing data before production

北城余情 提交于 2019-12-05 16:06:33
I'm searching a script to run on MySql to delete (truncate table) all the testing data (customer, order,cart, etc) on a PrestaShop database version 1.4.9. Thank Pascal Install the Prestashop Cleaner and in configure you have options to delete catalog, orders and customers For 1.5.6.2 (probably works for 1.5.6*, even maybe for 1.5.*) : TRUNCATE `ps_access`; TRUNCATE `ps_address`; TRUNCATE `ps_alias`; TRUNCATE `ps_attribute`; TRUNCATE `ps_attribute_group`; TRUNCATE `ps_attribute_group_lang`; TRUNCATE `ps_attribute_group_shop`; TRUNCATE `ps_attribute_lang`; TRUNCATE `ps_attribute_shop`; TRUNCATE

add category programmatically prestashop

假装没事ソ 提交于 2019-12-05 11:52:23
I would like to add categories programmatically to prestashop, i tried this code $object = new Category(); $object->name = "xcvxvvx"; if (!$parent_id){ $parent_id = Configuration::get('PS_HOME_CATEGORY'); } $object->id_parent = $parent_id; $object->link_rewrite = array((int)(Configuration::get('PS_LANG_DEFAULT')) => $category); $object->add(); $object->id_category = $object->id; $object->id_category_default = $object->id; $object->update(); I get this error message : Fatal error: Uncaught exception 'PrestaShopException' with message 'Property Category->name is empty' in /var/www/autospareparts

PrestaShop Images

我只是一个虾纸丫 提交于 2019-12-05 09:23:43
I have Prestashop 1.4.9.0 installed with my PHP project. When I add a new product, I upload an image in PNG format, but when it is shown on the client side, the image is in JPG format. How can you keep the image extension? At Back Office > Preferences > Images you have 3 options for "Image quality": Use JPEG Use PNG only if the base image is in PNG format Use PNG for all images By default all the images are in JPEG (PNG are converted), so you can either choose to use the 2nd option (to not convert images) or the 3rd option - to convert the JPEG images to PNG. If you have try first answer (At

How to get Prestashop current user id?

蓝咒 提交于 2019-12-05 07:02:32
I used the below code to try to get the current user ID in prestashop.. am placing this code in another php file in my module directory and call it through by the module file. $id = $this->context->customer->id_customer; but its not working for me.. am using prestashop 1.5 .. I certainly couldn't get it to work in my test either. However, you can try $id = (int)$this->context->cookie->id_customer; which works for me. I'm not at all sure that this is the best way to do it though. First check if user is logged in than get the id by $this->context->customer->id_customer if ($this->context-

Add Google AdWords Conversion Tracking (javascript) code into a PrestaShop / Smarty page

萝らか妹 提交于 2019-12-05 07:01:49
问题 I'm running a PrestaShop site and want to integrate it with Google AdWords and with the Conversion Tracking feature. The PrestaShop code is in Smarty 3. Now I've found that I could put Google's JS code at the end of a tpl file: order-confirmation.tpl. Here's the google code: <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = <my id>; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion

Prestashop how to add static contents in different language in tpl file

☆樱花仙子☆ 提交于 2019-12-05 06:41:31
问题 I need add some custom text in Prestashop template file, but there are two languages in my store, and I want to add these contents in different language statically? Can I check current language by language id? 回答1: statically {if $lang_iso == en } english text {else} Other language {/if} 回答2: You have multiple ways to achieve this goal depending on the kind of .tpl file you are editing: If it is a .tpl in your Theme, the easiest way is: {l s='My text to translate'} If it is .tpl file included