[Skip to main content](#vessel-content)

#   Little help with Orders Automatic Cancel Plugin

##

- **[mett](/forum/user/1080-mett "View mett's Profile")**
- [![mett's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1080-mett "View mett's Profile") Topic Author
- [ Offline](/forum/user/1080-mett)

Less More

- Posts: 126
- Thank you received: 2
-
-

14 years 1 month ago [\#64103](#64103) by [mett](/forum/user/1080-mett "View mett's Profile")  *[Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")* was created by *[mett](/forum/user/1080-mett "View mett's Profile")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 1 month ago [\#64225](#64225) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64225 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

Hi,

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mett](/forum/user/1080-mett "View mett's Profile")**
- [![mett's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1080-mett "View mett's Profile") Topic Author
- [ Offline](/forum/user/1080-mett)

Less More

- Posts: 126
- Thank you received: 2
-
-

14 years 1 month ago [\#64272](#64272) by [mett](/forum/user/1080-mett "View mett's Profile")  Replied by *[mett](/forum/user/1080-mett "View mett's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64272 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

This options?

[ ![Clipboard01&#95;2012-09-07.jpg](/forum/attachment/5615) ](/forum/attachment/5615 "...2012-09-07.jpg")

- [ ![Clipboard01&#95;2012-09-07.jpg](/forum/attachment/5615) ](/forum/attachment/5615 "...2012-09-07.jpg") [ ](/forum/attachment/5615?download=1 "...2012-09-07.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 1 month ago [\#64397](#64397) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64397 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mett](/forum/user/1080-mett "View mett's Profile")**
- [![mett's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1080-mett "View mett's Profile") Topic Author
- [ Offline](/forum/user/1080-mett)

Less More

- Posts: 126
- Thank you received: 2
-
-

14 years 1 month ago [\#64439](#64439) by [mett](/forum/user/1080-mett "View mett's Profile")  Replied by *[mett](/forum/user/1080-mett "View mett's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64439 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 1 month ago [\#64459](#64459) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64459 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mett](/forum/user/1080-mett "View mett's Profile")**
- [![mett's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1080-mett "View mett's Profile") Topic Author
- [ Offline](/forum/user/1080-mett)

Less More

- Posts: 126
- Thank you received: 2
-
-

14 years 1 month ago [\#64656](#64656) by [mett](/forum/user/1080-mett "View mett's Profile")  Replied by *[mett](/forum/user/1080-mett "View mett's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64656 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

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 ![:)](/media/kunena/emoticons/3.png ":)")

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

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 1 month ago [\#64766](#64766) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64766 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

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-&gt;order_status == 'pending') {
$update-&gt;order_status = 'refused';
} else {
$update-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mett](/forum/user/1080-mett "View mett's Profile")**
- [![mett's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1080-mett "View mett's Profile") Topic Author
- [ Offline](/forum/user/1080-mett)

Less More

- Posts: 126
- Thank you received: 2
-
-

14 years 1 month ago [\#64858](#64858) by [mett](/forum/user/1080-mett "View mett's Profile")  Replied by *[mett](/forum/user/1080-mett "View mett's Profile")* on topic *[Re: Little help with Orders Automatic Cancel Plugin](/forum/4-how-to/64103-little-help-with-orders-automatic-cancel-plugin#64858 "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:  But i can't &quot;close&quot; the orders older than 31 days. Should i have to do anyting else?  Thank you")*

thank you, nicolas, solved

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzY0MTAzLWxpdHRsZS1oZWxwLXdpdGgtb3JkZXJzLWF1dG9tYXRpYy1jYW5jZWwtcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.176 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
