Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Request Order Cancellation Feature From Vendor Panel Rate Topic   - - - - -

 
  • Bygora
  • Member
  • Members
  • Join Date: 14-Jan 22
  • 19 posts

Posted 01 August 2022 - 09:47 AM #1

Hi there, 

We're trying to implement the option to request an order cancelation from the vendor panel in the view orders page. The idea is to rely on order status change : when the vendor clicks on the request cancelation button, the order status changes to await cancelation status … in the admin panel, we add an order tab in the moderation menu, that page will only display the orders with the await cancelation status, the admin can either approve the cancelation or deny it, both actions will also change the order status: Cancelled if approved or previous status before cancelation request if denied. 

Now the question is : After adding the button like shown below in design/backend/templates/views/orders/manage.tpl

 

{if $runtime.company_id}
<li>{btn type="list" href="" text={__("request_cancellation")}}</li>
{/if}

I need to call the order_status_change API to change the order status to await cancelation: something like this: used in the delete order button

href="orders.delete?order_id=`$o.order_id`&redirect_url=`$current_redirect_url`"

Any ideas on how to do it ?

Thanks 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22945 posts

Posted 01 August 2022 - 01:17 PM #2

Please try

orders.update_status?id=`$o.order_id`&status=I

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • Bygora
  • Member
  • Members
  • Join Date: 14-Jan 22
  • 19 posts

Posted 02 August 2022 - 09:56 AM #3

 

Please try

orders.update_status?id=`$o.order_id`&status=I

Hello, 

Thanks for the answer, I tried calling the API this way, but I get a 404 not found message after clicking on the request cancellation as shown in the screenshots below. 
 

Attached Thumbnails

  • 02.png


 
  • CS-Cart team
  • CS-Cart support team
  • Moderators
  • Join Date: 04-Apr 11
  • 3943 posts

Posted 02 August 2022 - 11:59 AM #4

Hello, 

Thanks for the answer, I tried calling the API this way, but I get a 404 not found message after clicking on the request cancellation as shown in the screenshots below. 
 

The update_status mode of the orders dispatch accepts only POST requests, GET requests will result in 404 page.


Sincerely yours, CS-Cart Support Team

 

User guide       |  Developer documentation  |  Core API documentation


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22945 posts

Posted 02 August 2022 - 01:03 PM #5

Hello, 

Thanks for the answer, I tried calling the API this way, but I get a 404 not found message after clicking on the request cancellation as shown in the screenshots below. 
 

 

Add cm-post class to your link


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • Bygora
  • Member
  • Members
  • Join Date: 14-Jan 22
  • 19 posts

Posted 03 August 2022 - 08:31 AM #6

Add cm-post class to your link

The status change is working, but the button redirects me to a blank page, can I add an option to reload the same page after the status change?


The update_status mode of the orders dispatch accepts only POST requests, GET requests will result in 404 page.

Thanks for the input, adding the cm-post class fixed the issue. 



 
  • Bygora
  • Member
  • Members
  • Join Date: 14-Jan 22
  • 19 posts

Posted 03 August 2022 - 09:54 AM #7

 {$current_redirect_url=$config.current_url|escape:url}
 <li>{btn type="list" href="orders.update_status?id=`$o.order_id`&status=A&redirect_url=`$current_redirect_url`" class="cm-post" text={__("request_cancellation")}
 method="POST"}
 </li>

This was my attempt but it's not working. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22945 posts

Posted 03 August 2022 - 12:41 PM #8

Try to replace

redirect_url=

with

return_url=

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)