-
Posts
135 -
Joined
-
Last visited
About innovacy
- Birthday 02/14/1978
Contact Methods
-
Skype
kdimi1
Profile Information
-
Location
Germany
-
First Name
Dimitrios
-
Last Name
Karvounaris
-
Activity
Marketing / SEO Agency
Web Development Agency
Freelancer
Developer
Module Developer
innovacy's Achievements
-
Front controller doesn't redirect to api url.
innovacy replied to pg_dev's topic in Addons, modules and themes developers
Can you provide any more information? It's hard to provide some advice with as little info only. -
To change the order of products in the search results page and the AJAX live search in PrestaShop, you will need to modify the core code to adjust the sorting behavior. Please note that modifying core files is not recommended, as it may cause issues during future updates. However, if you still wish to proceed, in the PrestaShop core files, locate the file SearchController.php. This file is usually located in the /controllers/front/ folder. Locate the methods $query->orderBy(...) and variables called $orderBy and Tools::getProductsOrder(...) (for AJAX). Change to your hearts desire, however, using an override is suggested. Please note, this is based on my memory and it may not be 100% accurate, however, in that case they should be named similar.
-
Update product quantity of a specific combination in using API
innovacy replied to TanvirSharif's topic in Core developers
In newer PrestaShop versions, the stock of a combination is managed by the stock_available entity. The "quantity" field is not being used and has been superseded. To update the stock of a combination using the PrestaShop Web Service API, follow these steps: Retrieve the id_stock_available: To get the id_stock_available for a specific combination, you can use the GET method with the /combinations resource: GET https://yourshop.com/api/stock_availables?display=[id]&filter[id_product]=YOUR_PRODUCT_ID&filter[id_product_attribute]=YOUR_COMBINATION_ID Replace yourshop.com with your domain, YOUR_PRODUCT_ID with the specific product ID you want to update, and YOUR_COMBINATION_ID with the specific combination ID (id_product_attribute). Update the stock available quantity: Now that you have the id_stock_available (returned as id), you can update the stock quantity using the PUT method with the /stock_availables resource: PUT https://yourshop.com/api/stock_availables/STOCK_AVAILABLE_ID Replace yourshop.com with your domain, and STOCK_AVAILABLE_ID with the id_stock_available you obtained in the previous step. In the XML body of your PUT request, set the new stock quantity: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <stock_available> <id><![CDATA[STOCK_AVAILABLE_ID]]></id> <id_product><![CDATA[YOUR_PRODUCT_ID]]></id_product> <id_product_attribute><![CDATA[YOUR_COMBINATION_ID]]></id_product_attribute> <quantity><![CDATA[NEW_QUANTITY]]></quantity> <depends_on_stock><![CDATA[0]]></depends_on_stock> <out_of_stock><![CDATA[2]]></out_of_stock> </stock_available> </prestashop> Replace STOCK_AVAILABLE_ID with the id_stock_available, YOUR_PRODUCT_ID with the specific product ID you want to update, YOUR_COMBINATION_ID with the specific combination ID (id_product_attribute), and NEW_QUANTITY with the desired stock quantity. In newer versions of PrestaShop, you can utilize the PATCH method to update only the id and quantity, allowing you to bypass the need to include other required fields. That's the method we use to efficiently perform tens of thousands of stock updates on a daily basis. Please refer to the API reference to ensure that all my provided examples are accurate, as I haven't tested them personally, but simply sharing them based on my memory of the PrestaShop API.- 2 replies
-
- 1
-
- prestashop1.7
- webservice api
-
(and 1 more)
Tagged with:
-
translate custom strings in email layouts
innovacy replied to mavalentin's topic in Addons, modules and themes developers
In PrestaShop, the email translation system relies on the catalog generated from the available email templates. If your custom strings are not showing up in the translation interface, you may need to clear the cache and refresh the translation catalog. Please follow these steps: Clear cache: Go to your PrestaShop root folder. Delete the content of the following folders: /var/cache/dev/translations/ /var/cache/prod/translations Refresh the translation catalog: Go to your PrestaShop back office. Navigate to International -> Translations. Select "Email translations" in the "Modify translations" section. Choose the email theme (your custom email theme) and the language you want to translate. Click the "Modify" button. This will refresh the translation catalog and should include your custom strings. If your custom strings still do not show up in the translation interface, make sure that your custom email theme is correctly structured and your custom strings follow the correct syntax. Additionally, you can try to add your custom strings directly to the Emails.Body.xlf translation files located in the /app/Resources/translations/ folder. Make sure to follow the correct format when adding the strings, and then clear the cache as mentioned earlier. However, this approach is not recommended as it will make future updates more complicated, and you may lose your custom translations if the core files are updated. -
Front controller doesn't redirect to api url.
innovacy replied to pg_dev's topic in Addons, modules and themes developers
Did you had a look at https://github.com/PrestaShop/paymentexample/ yet? -
The error you're encountering, "This file does not seem to be a valid module zip," usually occurs when PrestaShop is unable to recognize the uploaded file as a valid module archive. Here are some common issues and their respective solutions: 1. Incorrect file format: Ensure that the file you are trying to upload is in the ZIP format. PrestaShop only accepts module files in this format. If your file is in another format, such as RAR or TAR, convert it to a ZIP file using a file archiver like 7-Zip or WinRAR. 2. Corrupted or incomplete ZIP file: The uploaded file might be corrupted or incomplete. Try downloading the module again from its original source, and then upload the new file to PrestaShop. 3. Module structure issue: Ensure that the module files are structured correctly within the ZIP archive. The module's main PHP file should be in the root of the archive, not inside a subfolder. For example, if your module is named 'examplemodule', the main PHP file should be 'examplemodule.php' and located at the root of the ZIP file. 4. File size limit: Some server configurations might have a limit on the maximum upload file size. Check your server's settings (e.g., in the php.ini file) and increase the 'upload_max_filesize' and 'post_max_size' if necessary. After making changes, restart your web server and try uploading the module again. 5. File permissions: Ensure that the proper file permissions are set on your server for the '/modules' directory. You may need to set the permissions to '755' or '775' depending on your server configuration. 6. Compatibility issues: Make sure that the module is compatible with your PrestaShop version. If the module is designed for a different version of PrestaShop, it may not be recognized as a valid module. If none of these solutions resolves the issue, consider reaching out to the module's developer for further assistance, as there could be a specific issue with the module itself.
-
Forced to go to Debug Mode in module manager
innovacy replied to Noel123's topic in Addons, modules and themes developers
Check if the mentioned file ps_checkpayment.php exists. If it does, check it's permissions, if it's accessible. -
I was wondering, if someone was to create a new module for release today, how important would it be still today, to make the module compatible with older PrestaShop versions, specifically either v1.6 or if staying within the 1.7 branch only, for earlier versions than the last 2-3 1.7 releases? Are shop owners still looking for modules for older versions quite frequently? I would like to use the advanced features which are available only after versions like 1.7.6, being able to add Symfony services, routes etc. as also using only the newer translation service and even some of the much newer features. If 1.6 should be supported though, many of these just can't be used or can't be used to their full extent. However, I'm hesitant to abandon support for more legacy versions, knowing that if I decide to go that route, there's not one simple way or feasible to make these later compatible with older versions or to turn back. I don't want to use these newer features just for the sake of using the latest technology, but rather focus on what the actual demand is. However, I don't have enough insight on numbers big enough or something like that myself, to make good conclusions on that. Would I do best, to skip using those newer and great features and keep the modules more compatible, or rather focus on providing the best value for the latest versions by leveraging these features?
-
There is no "reserved stock" in PrestaShop. What it does is, to show to the customer who have added the product in the cart, as many less than they have in cart. It may make the wrong impression to you, that it's reserved, but it is not. It is only for the reason, so that SPECIFIC customer cannot add more to the cart that are available in stock. You can check this yourself, by opening another window in another browser profile or in an incognito window, Do not reuse the same browser, so you are a different guest to PrestaShop. You'll see that all of your stock is available to order as another guest, while the first one still has stock visible subtracted by what they have in their own cart only.
-
Well, if you look at the way you calling that, you got your answer. If it's the url determining the resource you requesting, then no, you can't pack several URLs in one HTTP request. You can ask for several entries of the same resource, with the help of filters, but you cannot do different resources in the same HTTP GET request.
-
To my knowledge, there hasn't been announced something specifically in that regard and PrestaShop themselves seems to have other focuses right now. Myself, I wouldn't put my hope in this. Since performance of the site and especially cart operations & checkout is very essential, as it can really make the difference of several percentages of having more (or less if it's worse) sales, I would suggest to get a developer on board who knows to pin down what's causing such issues, knows to distinguish what matters especially in terms of browser performance, how to address them in the best manner and can solve them for you. I've been doing that for almost every store I've been working on, always with great results and seeing my customers benefiting greatly from it In default PrestaShop there are so many things which can be improved in terms of performance, especially in the theme. This however hasn't been a priority or a concern most of the time for the PrestaShop team.
-
Best method I suggest: -> Create a new brand and call it something like "Unknown brand". Grab the ID, you will need it on the next step. -> Navigate to "Advanced Parameters > Database" and add a new query. Replace on the following one "<ID>" with just the id from above (using no quotes or anything). update ps_product set id_manufacturer = <ID> where id_manufacturer = 0; -> Once you have added it, execute it. Now you can navigate to "Brands & Suppliers" and VIEW from there the associated products, which you can edit and re-assign as required. Whenever new products without a brand are added, they can be either assigned to this "placeholder" brand or the query run again. As soon they are assigned properly to another brand, everything is immediately good, nothing to delete or change.
-
Adding Product on Prestashop using webservice API
innovacy replied to kekawia's topic in General topics
Have you seen this part of the documentation? It explains how to add/create a resource. https://devdocs.prestashop.com/1.7/webservice/tutorials/prestashop-webservice-lib/create-resource/ -
Because people still get to this post even though it is old (it is one of the first in google), here is the solution: To receive the data for several entries of one resource, you are calling the URL without an ID, as example: /api/products/ On this you can add several additional parameters to limit what you receive, with the 'filter' keyword. If you need a list of specific IDs, you can request: /api/products/?filter[id]=[1|2|3|5|10] And last you add what data you want to receive, with the 'display' keyword. You can use either 'full' or a list of fields to return, like this: /api/products/?filter[id]=[1|2|5|10]&display=full /api/products/?filter[id]=[1|2|3|5|10]&display=[id,name] For a full list of capabilities using 'filter' and all available keywords, see: https://devdocs.prestashop.com/1.7/webservice/tutorials/advanced-use/additional-list-parameters/
-
Hello, the way to do this is to create a module which extends the webservice resources Prestashop supports. If you know how to create modules, this blog explains some further details on which hooks you must use for that and how. https://www.knowband.com/blog/prestashop-tutorials/create-prestashop-module-web-service-api/#how-to-create-prestashop-module-webservice-api-for-prestashop-1-7