prestashop

Prestashop shipping cost by state

不羁岁月 提交于 2019-12-22 11:24:55
问题 Is there by any chance a way to set shipping cost by state in a carrier in prestashop? i.e. let's say i want a different shipping cost to send in Alabama than in Alaska with the same carrier Thanks 回答1: There are a couple ways of doing this. You can purchase an external module, such as this one, or create an override like so: 1) Copy "classes/Address.php" to "override/classes/Address.php". 2) In line 28 change class name from AddressCore to Address 3) Before function getZoneById, paste this

Confused about prestashop PDF generated process. Where is the code to handle the logic?

走远了吗. 提交于 2019-12-22 08:33:55
问题 I want to deep understand prestahop inside structure and amend some parts. I am stoped in the PDF. I want can't find the controller used to handle the AdminPdf and generateDeliverySlipPDF {if $order->delivery_number} <a class="btn btn-default _blank" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id}"> <i class="icon-truck"></i> </a> {/if} Who can help me figure out the inside processes? I can't find the methods to handle

How to get Prestashop current user id?

本秂侑毒 提交于 2019-12-22 05:31:19
问题 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 .. 回答1: 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. 回答2:

Add product to PrestaShop 1.5 via Web Service

北城余情 提交于 2019-12-21 22:47:28
问题 I try to add a product via web service and I receive bellow error code: RETURN HTTP BODY <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <message><![CDATA[Internal error. To see this error please display the PHP errors.]]></message> </error> </errors> </prestashop> I am searching 2 days but nothing. Please can anyone help me? My Code is below. define('DEBUG', true); define('_PS_DEBUG_SQL_', true); define('PS_SHOP_PATH', 'http:/

Search products in a specific category

不羁的心 提交于 2019-12-21 21:44:10
问题 I am trying to extend the default behaviour of the search mechanism provided by the default module blocksearch in Prestashop 1.6.0.6. I added to the default form a select input returning categories. Everything is working in both controller and view sides. The whole form is sending the correct parameter to the SearchController . But, in Model, I still don't know what are the changes to apply on Search.php entity so that the method find returns products that belong to the specified category. I

Calculating the size of a box for multiple products for carrier module in prestashop

怎甘沉沦 提交于 2019-12-21 06:25:39
问题 I am currently developing a carrier module for Kuroneko which is a door-to-door Japanese delivery company. This carrier, along with the weight, takes the size of the box into consideration. But it doe not use the volume, it would be too easy. It uses the sum of the three dimensions (height, weight and depth). If you've got only one product to box, it's still easy but what happens when you need to box 2 products? Let's say you have two products of dimensions (x1,y1,z1) and (x2,y2,z2), how do

Prestashop Web Service API keeps asking for authentication

坚强是说给别人听的谎言 提交于 2019-12-21 05:36:17
问题 I am having this problem I enabled the webservice from prestashop and I can access it if I write the URL directly passing the parameter from post method http://underwearstudio.mx/pruebas/api?&ws_key="mykey". But If I try to access without passing the ws_key as parameter it keeps asking me to authenticate. From what I read when authentication is prompted you need to use the API key as username and leave the blank password, but it just keeps prompting the authentication. What can I do? I was

Prestashop 1.7 JS files not being added

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 07:30:53
问题 Working on Prestashop 1.7 and updated my theme.yml file to look like the below but it doesn't add in the file. The file is in that directory but it isn't being pulled in. Any suggestions to the code? I want to include the JS file but it isn't being pulled in. assets: # If you're using this theme as child and you want to load # the parent theme assets, uncomment this line. # use_parent_assets: true # The following lines are showing how to load assets in your page # Uncomment and change value

Create product from a module in prestashop

。_饼干妹妹 提交于 2019-12-18 12:45:31
问题 I guys i try to create a custom product from a module with this code : $defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT'))); /* Add a new product */ $object = new Product(); $object->price = 22; $object->id_tax_rules_group = 0; $object->name = 'test'; $object->id_manufacturer = 0; $object->id_supplier = 0; $object->quantity = 1; $object->minimal_quantity = 1; $object->additional_shipping_cost = 0; $object->wholesale_price = 0; $object->ecotax = 0; $object->width = 0;

add a field in edit product page of prestashop admin

╄→尐↘猪︶ㄣ 提交于 2019-12-18 12:43:02
问题 I have add a field "mystock" in product table of prestashop database. Now i want to display/edit this filed in edit product page. It also be update when product will update. 回答1: This process require some work around in steps. Below i have listed them. 1) Open classes/Product.php. Place public $mystock; in the class properties list, which you can see after the class is started. 2) Down the file, find public static $definition = array( , it will be a long array. Find the 'fields' => array( in