Little help with Orders Automatic Cancel Plugin

  • Posts: 126
  • Thank you received: 2
12 years 2 months ago #64103

Hello,

I setup this plugin to run at 31 days. Cron work fine (i use cron from our server) and i get this message when i open the link in browser:

Orders checked
Rates successfully updated
Waitlist notifies checked

HikaShop Triggered at 06 Septembrie 2012 10:45

Orders checked

Rates successfully updated

Waitlist notifies checked



But i can't "close" the orders older than 31 days. Should i have to do anyting else?

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 2 months ago #64225

Hi,

Can you do a screenshot of the plugin's options ?

Please Log in or Create an account to join the conversation.

  • Posts: 126
  • Thank you received: 2
12 years 2 months ago #64272

This options?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 2 months ago #64397

The value 2678400 equals to 310 days not 31. You should remove a 0.

Please Log in or Create an account to join the conversation.

  • Posts: 126
  • Thank you received: 2
12 years 2 months ago #64439

ups, thank you, i removed a 0 but still can't change the status from "Pending" orders to "Refused" (the "Cancelled order statuses" is set to "Refused")

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 2 months ago #64459

The plugin will "cancel" the orders with the status "created". It won't change the orders with another status.

Please Log in or Create an account to join the conversation.

  • Posts: 126
  • Thank you received: 2
12 years 2 months ago #64656

Nicolas, can you confirm me that this code it's ok? I added this code to line 46 in order_auto_cancel.php but i need to be sure before ruin something :)

if ($order->order_status == 'Pending') {
$update->order_status = 'Refused';
} else {
$update->order_status = $status;
}

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 2 months ago #64766

You should check the status names in the table hikashop_order of the database. There is normally no uppercase to them.

so it should rather be:
if ($order->order_status == 'pending') {
$update->order_status = 'refused';
} else {
$update->order_status = $status;
}

Also, the statuses pending and refused do not exist by default in HikaShop. The default statuses are:
created
confirmed
cancelled
refunded
shipped

Please Log in or Create an account to join the conversation.

  • Posts: 126
  • Thank you received: 2
12 years 2 months ago #64858

thank you, nicolas, solved

ps: 31 days mean 2.678.400 seconds and not 267.840 seconds: 60sec*60min*24hour*31days

Please Log in or Create an account to join the conversation.

Time to create page: 0.076 seconds
Powered by Kunena Forum