prestashop

Access Prestashop webservice from JavaScript

半世苍凉 提交于 2020-01-10 09:22:26
问题 In the Prestashop backend I activated the webservice and I created an authentication key. Testing in browser works well but now I want to access the webservice via JavaScript in a Cordova application. The response I am getting is 401 (Unauthorized) . I'm performing this ajax call (using AngularJS): $http.get('http://AUTHENTICATION_KEY@url.com/api/employees/2', {}) How do I have to send the authentication key? I've been searching on the Internet but I did not found anything interesting that

How to change meta title in prestashop module?

情到浓时终转凉″ 提交于 2020-01-07 09:26:35
问题 I'm using prestashop 1.6 and one module is not editable in SEO&URL, to change is meta. Actually, i have the default pretashop meta title. How can i add a custom header.tpl for this module ? Thank you for your help Tony 回答1: Assuming you are talking about a module with a controller, you can add in the base file /modules/mymodule/mymodule.php , inside the method __construct() , a object like this $this->controllers = array('controller_file_name'); , where the controller_file_name is the file

PrestaShop module classes not found (namespaces)

旧街凉风 提交于 2020-01-06 12:33:34
问题 This is my PrestaShop module file structure: -mymodule/ --src/ --mymodule.php ---Presta/ ---Webhooks.php ----Controller/ -----MyPrestaController.php mymodule.php cannot find Webhooks.php class, I've tried use in mymodule.php, but still it provides errors: ClassNotFoundException in mymodule.php line 55: Attempted to load class "Webhooks" from namespace "src\Presta". Did you forget a "use" statement for another namespace? When I try to use autoload/include/require in mymodule.php it throws

PrestaShop module classes not found (namespaces)

僤鯓⒐⒋嵵緔 提交于 2020-01-06 12:33:04
问题 This is my PrestaShop module file structure: -mymodule/ --src/ --mymodule.php ---Presta/ ---Webhooks.php ----Controller/ -----MyPrestaController.php mymodule.php cannot find Webhooks.php class, I've tried use in mymodule.php, but still it provides errors: ClassNotFoundException in mymodule.php line 55: Attempted to load class "Webhooks" from namespace "src\Presta". Did you forget a "use" statement for another namespace? When I try to use autoload/include/require in mymodule.php it throws

PrestaShop module classes not found (namespaces)

大憨熊 提交于 2020-01-06 12:32:28
问题 This is my PrestaShop module file structure: -mymodule/ --src/ --mymodule.php ---Presta/ ---Webhooks.php ----Controller/ -----MyPrestaController.php mymodule.php cannot find Webhooks.php class, I've tried use in mymodule.php, but still it provides errors: ClassNotFoundException in mymodule.php line 55: Attempted to load class "Webhooks" from namespace "src\Presta". Did you forget a "use" statement for another namespace? When I try to use autoload/include/require in mymodule.php it throws

product export to xml, using sql queries

被刻印的时光 ゝ 提交于 2020-01-06 07:27:44
问题 I have a sql query that runs out the output I will That works perfectly. Now I want to use the sql query in a php script to give a xml output every time I trigger the php. This is the code I have now, but it runs out on a 500 error (I believe the error is created in line 24 - 25) <?php // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT psc5

First connect from Prestashop to Google Cloud SQL always fails

非 Y 不嫁゛ 提交于 2020-01-06 07:01:07
问题 I'm setting up a PrestaShop installation on a development server which is a GCE instance and using Cloud SQL as a database server. Everything works just fine except one thing: whenever there is a long period of inactivity on the site, the first page load after that always gives me this error: Link to database cannot be established: SQLSTATE[HY000] [2003] If I refresh the page the error is gone and never appears again until I stop using the site for an hour or so. It almost looks like database

Prestashop saving invoices manually and automatically

风流意气都作罢 提交于 2020-01-05 04:21:10
问题 My invoices are saving to my server automatically when I press "view invoice" button from admin panel. The automatic saving works, but when I try to save invoice manually.. It will save it and when I open it.. I will have an blank(white) pdf page. I'm using two overrides to accomplysh automatic save PDF.php class PDF extends PDFCore { public function render($display = true) { if($this->template == PDF::TEMPLATE_INVOICE) parent::render('F', true); return parent::render($display); } }

prestashop 1.7 how to edit the “add product” page in backoffice

对着背影说爱祢 提交于 2020-01-04 06:50:27
问题 I am trying without any success, to edit the page in the subject, because I have added 7 more fields in the product table that I would like to manage in the backoffice. I have seen that the 1.6 version of Prestoshop had a specific view for that page and that it was pretty simple to add fields to the form. As to the 1.7 I'm going literally crazy, because I cannot find any view that manages the "add product" page. Any hint? I know that it could probably have something to do with the

How to solve the serve static content from a cookieless domain in prestashop 1.5?

房东的猫 提交于 2020-01-04 05:41:15
问题 I test my website on gtmetrix.com it show me the following error to improve my website yslow scrore. serve static content from a cookieless domain how to solve this error? 回答1: You should create some subdomains for example: media1.example.com , media2.example.com , media3.example.com . Configure those subdomains to point to your website as your main domain does. In Prestashop backoffice go to Performances and register your new content domains in the media area. Those domains will only be used