ISSUE API PRESTASHOP 1.7

I currently have a problem with the prestashop API. I’m trying to update the amount of a combination of a product. <?php $request = new HttpRequest(); $request->setUrl(‘https://myurl.com/api/combinations/15544’); $request->setMethod(HTTP_METH_PUT); $request->setQueryData(array( ‘io_format’ => ‘JSON’ )); $request->setHeaders(array( ‘cache-control’ => ‘no-cache’, ‘Connection’ => ‘keep-alive’, ‘Accept-Encoding’ => ‘gzip, deflate’, ‘Host’ => ‘myurl.com’, ‘Cache-Control’ => ‘no-cache’, ‘Accept’ => ‘*/*’, ‘User-Agent’ =>…

Discover more

Datatrics Prestahop

I need to add the Datatrics code into checkout.tpl, cart.tpl and product.tpl pages. But, I don’t know how to call the product and order variables. Here’s the code for Product Views script: <script type=”text/javascript”> // Set the view of a product _paq.push([‘setEcommerceView’, “SKU”, // (required) SKU: Product unique identifier “NAME”, // (optional) Product name “CATEGORYNAME”,…

Discover more

Prestashop Link::getProductLink() returns wrong link (without category in it)

Link::getproductLink() returns incorrect url, after opening this url it’s either redirection or error message when in dev mode. Someone here (PrestaShop $link -> getProductLink($product) gives incorrect URL) had the same problem, people answered him to disable the DEV mode then the message ([Debug] This page has moved Please use the following URL instead:…) is gone…

Discover more

Prestashop Link::getProductLink() returns wrong link (without category in it)

Link::getproductLink() returns incorrect url, after opening this url it’s either redirection or error message when in dev mode. Someone here (PrestaShop $link -> getProductLink($product) gives incorrect URL) had the same problem, people answered him to disable the DEV mode then the message ([Debug] This page has moved Please use the following URL instead:…) is gone…

Discover more

Defining an API caller class with ASP.NET Core

I’m developing an App that makes calls to the Prestashop API. I’ve worked with APIs before but not in ASP.NET Core. On the client side in Java (retrofit) we used to have an interface where we defined our URL calls and function names like so: public interface TodoApi { @POST(“/owners/login”) Call<String> loginP(@Body UserLogin login); @POST(“/workers/login”)…

Discover more

How to display theme’s .tpl in module (in hook)?

I am making a module, that suposed to use templates from my custom theme. The problem is that I don’t understand the function Module::display(), it gets two arguments “file” and “template”, what is the file? What is it for? If I do this: public function hookDisplayHome{ return $this->display(__FILE__, ‘../../templates/my_custom_theme/mb_templates/aboutus.tpl’); } It displays error “Not found…

Discover more