Jump to content

tehy

Members
  • Posts

    5
  • Joined

  • Last visited

  • Days Won

    1

tehy last won the day on July 21 2023

tehy had the most liked content!

Profile Information

  • First Name
    Teppo
  • Last Name
    Hytönen

tehy's Achievements

Newbie

Newbie (1/14)

1

Reputation

1

Community Answers

  1. Thanks for the reply. Strange part is that the sendemail=1 addition seems to have worked for some people when adding an order history event, but I wonder why it does nothing in this case. The carriers X and Y are just normal shipping methods really, it's just that they have specific states the orders are set to depending on the selected carrier. Also accordingly carrier Y is a method that never has a tracking code as defined by the shop owner's internal process, so while technically giving it one via the back office would send the email, it's never added. It just would've been nice to have simple solution for this. It wouldn't be too hard to send a mail from the script that accesses the webservice, except for the part where Prestashop automatically sends the mail in the correct language and so forth.
  2. Hi! The store (Prestashop version 1.5.4.0, it's a client's store so can't update it myself or anything like that) is setup so that if shipping method X is used, an email notification is sent to the customer when a tracking code is added. If shipping method Y is used, the notification is sent when the order is put into a certain state (a variation of the SHIPPED state). Neither of these notifications happen if the update is done via the webservice. The tracking code is added by adding the tracking code via order_carriers of the order and the order status is changed via order_history (which also changes the current_state of the order object). To my knowledge these are the correct ways to do these changes. I know of the sendemail=1 addition to the resource. I'm using the webservice directly via PHP's cURL, as the Prestashop Webservice Library causes gray hairs. As such the URL of the order_history for example is: www.storeurl.com/api/order_histories?sendemail=1 but it still doesn't work. I also added that to the tracking code addition URL, though I don't even know if it is supposed to work with that call exactly like that. So, while everything else works, the email notifications via webservice updates do not. What could I do to get this to work?
  3. Ugh, actually got it to work, after some more googling found that I had to add 'xml=' in front of the XML payload. But even the PSWebServiceLibrary doesn't seem to do that, further lowering my opinion of said library. Now the only problem remaining is emails don't get set upon the statusupdate, despite the ?sendemail=1 in the resource URL.
  4. Hi. I'm having a strange problem. I'm using the webservice via direct cURL calls, because I had problems with the PSWebServiceLibrary doing stupid things and mainly just getting in the way (though I did briefly test this with the library as well, with the same error). I'm trying to add order_histories via the webservice to update the order status and history (as merely updating the order via the orders resource doesn't change the order history, and I'm not sure if it'll send the email to the customer either). Anyway, for some strange reason it does not work. Editing an existing order_histories with PUT request works, but as soon as I try to POST, I get this error: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code><![CDATA[127]]></code> <message><![CDATA[xml error : String could not be parsed as XML XML length : 0 Original XML : ]]></message> </error> </errors> </prestashop> The obvious problem is XML length: 0. As if I hadn't sent the XML at all. But the Content-Length of my outgoing request isn't 0, so the XML itself is definitely being sent in CURLOPT_POSTFIELDS. And the exact same function (except for the different CURLOPT_CUSTOMREQUEST setting, and of course adding the ID for PUT in the XML data) is sending the PUT request where the XML is recognized (if there's a problem with the XML I get an error as I should, but even then XML length is correct and the original XML is listed). So basically everything else being identical, PUT request works, POST doesn't. What on earth could cause this? I've been banging my head at this for hours, with no luck.
×
×
  • Create New...