prestashop

How to test if a category already exists? PrestaShop

不问归期 提交于 2019-12-13 04:09:21
问题 I get the category from other database web service and I put them on PrestaShop when I refresh the file to add categories I wanna make sure if the category id exists, if exist I wanna update the category. $XMLRQString = '<?xml version="1.0" encoding="utf-8"?>'. '<x:Winmax4GetFamiliesRQ xmlns:x="urn:Winmax4GetFamiliesRQ">'. '</x:Winmax4GetFamiliesRQ >'; $return = $client->GetFamilies($Params); $XMLRSString = new SimpleXMLElement($return->GetFamiliesResult); if ($XMLRSString->Code > 0) echo '<

Error loading background in PrestaShop when using homemodalwindow module

纵然是瞬间 提交于 2019-12-13 03:58:14
问题 When using the homemodalwindow popup module, there is an object which cant load in the background and all the background fails to load. Aparently the error is around here according to Google Chrome <div class="fancybox-overlay fancybox-overlay-fixed" style="width: auto; height: auto; display: block;"> ... <div class="fancybox-inner" style="overflow: hidden; width: 500px; height: 100px;"> ----------- "Error: Failed to execute 'webkitMatchesSelector' on 'Element': ':hidden' is not a valid

How to edit Front Address form - Prestashop

旧城冷巷雨未停 提交于 2019-12-13 03:29:53
问题 I'm trying to use drop down list instead of textbox for 'City' field.(Like country list).I tried to edit address-form.tpl file.but it's contain smarty values.I don't know which .tpl/Controller i want to edit. address-form.tpl <section class="form-fields"> {block name='form_fields'} {foreach from=$formFields item="field"} {block name='form_field'} {form_field field=$field} {/block} {/foreach} {/block} </section> 回答1: finally i got a solution 1) add form type to city field classes/form

Category Page Product Filter

你离开我真会死。 提交于 2019-12-13 02:59:13
问题 I am new to prestashop and I am trying to create a simple product filter to be displayed on the category page. I managed to output my filter on the page using the hook for the hookDisplayLeftColumn method, however I have a few questions. Right now I am hooking to the leftColumn but the filter will show on any page that has it.I want to show it only on the category page. public function hookDisplayLeftColumn($params) { $data = array( 'bar' => 'foo' ); $this->context->smarty->assign($data);

Associating an item to multiple other items (of a different class) using Prestashop's backoffice

橙三吉。 提交于 2019-12-13 02:42:41
问题 Having just arrived at Prestashop 1.5, I am making a very simple module: a video of the week, associated with multiple products that need to appear right next to it. I decided to start from the Backoffice. Right now, I can view, add, edit and remove all the Video entries but I'm a bit lost on how to map the N-N association between a video and its related products... The lack of documentation isn't helping either. Any ideas how to pull this off? Here's a bit of my code, the Video class is

RESTomancy: Getting products from category in Prestashop 1.5

纵饮孤独 提交于 2019-12-13 02:17:00
问题 Disclaimers: This is oriented towards Prestashop 1.5 but if the answer is: " this is fixed in version 1.x " then I'll raise a petition to update our shop . I'm also tagging it as REST because I think I explained it throughly enough so you don't need actual experience with Prestashop to understand it. So in Prestashop we have this Web Services which lack support for use cases as simple as search by category . 1. Let's say you want to get all the products from categories 1, 3 and 17: So what is

New products from specific category prestashop

谁说胖子不能爱 提交于 2019-12-13 00:33:09
问题 I want get new products from a category, so I tried to change the controller. In prestashop 1.7 is NewProductsController.php, And inside there is this function protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setQueryType('new-products') ->setSortOrder(new SortOrder('product', 'date_add', 'desc')) ; return $query; } And I changed it into protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setIdCategory('MY-NEW-ID

add my css to theme in prestashop

你离开我真会死。 提交于 2019-12-12 18:22:29
问题 I'm new in prestashop. I created my css file and want to add it to prestashop theme. How can i add the new fill and make prestashop read the file in the header section? In forums i see that they said to add it to hookheader , i tried to add it to some module and do the following: 1) add to the theme header file {hook h="myCssHook"} 2) add to some rendom module function: public function myCsshook(&params) { $this->context->controller->addCSS(($this->_path).'prestashop/myshop/theme/css

Prestashop uploading file while sending message

天涯浪子 提交于 2019-12-12 18:09:44
问题 I am trying to add function to attach file in order details page. There is an message sending form and i am trying to implement file upload in there. I have added this to order-detail.tpl <div class="form-group"> <input type="file" name="fileUpload" id="msgfile" class="inputfile" /> <label for="msgfile"><i class="icon-cloud-upload"></i> {l s='Prisegti failą'}</label> <p id="nbchars"></p> </div> and values to OrderDetailController.php if (Tools::isSubmit('submitMessage')) { $extension = array(

Prestashop: Creating a custom page for my module

非 Y 不嫁゛ 提交于 2019-12-12 17:06:19
问题 I looking for code which can create a custom page. The code must include all hooks and I should moderate the "home" hook and put my content there... Anything is helpful - sample code for example, tutorials, documentations or something. Best regards, George! 回答1: Edit: The standard way (for PS1.5 & PS1.6) is to make a controller Another way (not recommended) is to make a file like this wher you include the header/your content/the footer <?php global $smarty; include( '../../config/config.inc