If this is your first visit, check our documentation. To post, register or login.
Forums / Managing Customers and Orders / deleting order doesn't (really) restock the way I want

deleting order doesn't (really) restock the way I want

Locked

Started by mzimmers on 28 Mar 2010, 6:34 PM · Views: 1,718

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
28 Mar 2010, 6:34 PM
#1
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

deleting order doesn't (really) restock the way I want

Hi -

I'm playing around with order stuff right now. I notice that when I cancel an order, even if I check the "Restock product quantity" box, the product isn't returned to visibility in the shop.

This might be because I only have quantity 1 of anything in the shop, but...the preferred behavior would be to make a product visible to customers as soon as I delete an order that contained that product. Can this be done?

Thanks.

28 Mar 2010, 10:38 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: deleting order doesn't (really) restock the way I want

Actually, it does properly increase the product quantity.
But it can't know for sure that you want the product re-enabled once it's been disabled. Visibility is disabled when you set the product's status to disabled, and apparently you've got your store's stock settings set to disable products when their available quantity hits zero. But there's no way to distinguish whether the product was auto-disabled for that reason or whether you manually disabled the product yourself for another completely different reason. Thus, you'll have to enable those products manually.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Mar 2010, 10:45 PM
#3
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

Yeah, I can see the reasoning behind that. As a suggestion for an upgrade, it wouldn't hurt to have another box along with the "return to stock" box for "re-enable item" or something like that.

Thanks for the reply.

30 Mar 2010, 12:40 PM
#4
primus avatar

primus

New Zenner

Join Date:
Mar 2010
Posts:
6
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

Hi guys, I am new here, installed few add-ons as Edit Order, but now I don't know how to delete an order. Can you help me here?

Thanks

30 Mar 2010, 2:34 PM
#5
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

Primus:

Hi guys, I am new here, installed few add-ons as Edit Order, but now I don't know how to delete an order. Can you help me here?

Thanks

Admin --> Customers --> Orders

Select and delete.

30 Mar 2010, 7:02 PM
#6
primus avatar

primus

New Zenner

Join Date:
Mar 2010
Posts:
6
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

If i follow the instructions of the "Admin Simple Create Order" add-on, I have to make some modifications on admin/orders.php, as below. With this mods, the DELETE BUTON IS DISAPEAR. If i put the original file, the add-on will work only for creating orders and customers, but not for editing an order.

Any advice will be much appreciated

Find:
<td class="dataTableContent" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders->fields['orders_id'] . '&action=edit', 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?><?php if (isset($oInfo) && is_object($oInfo) && ($orders->fields['orders_id'] == $oInfo->orders_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID')) . 'oID=' . $orders->fields['orders_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

   Replace With:
	<td class="dataTableContent" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_ORDER_EDIT, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders->fields['orders_id'] . '&action=edit', 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?><?php if (isset($oInfo) && is_object($oInfo) && ($orders->fields['orders_id'] == $oInfo->orders_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID')) . 'oID=' . $orders->fields['orders_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>


Find:
	 $contents = array('form' => zen_draw_form('orders', FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm', 'post', '', true));

   Replace With:
	$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDER_EDIT, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a> <a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm', 'NONSSL') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');


   Find:
	$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDER_EDIT, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete', 'NONSSL') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');

   Replace With:
	 $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDER_EDIT, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete', 'NONSSL') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');


   Find:
	$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');

    Replace With:
	$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDER_EDIT, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');*
30 Mar 2010, 7:11 PM
#7
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

I just downloaded the add-on you mention and read the readme.txt. From the very last line in the file:

In ADMIN->CUSTOMERS->ORDERS->EDIT make necessary changes to customers' order (i.e. to delete a product, change quantity to 0) and then click UPDATE.
Did you try this?

30 Mar 2010, 7:36 PM
#8
primus avatar

primus

New Zenner

Join Date:
Mar 2010
Posts:
6
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

Yes, thanks for answering so quick.
It will delete the product from the order, but not the order itself.

30 Mar 2010, 7:39 PM
#9
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

OK, well, I see this is a version 1.0 of this add-on. You may well have discovered a bug. Consider reporting it to the developers. Good luck.

30 Mar 2010, 7:42 PM
#10
primus avatar

primus

New Zenner

Join Date:
Mar 2010
Posts:
6
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

Thanks for the answer, how do I report?

30 Mar 2010, 7:45 PM
#11
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

Again, from the readme.txt:

  1. That's all, if you found any bugs or any suggestions please email me ivan.kristianto###################### or visit ivankristianto.com
    If you find the solution, come back and post it here for other people's benefit.
1 Apr 2010, 5:02 AM
#12
primus avatar

primus

New Zenner

Join Date:
Mar 2010
Posts:
6
Plugin Contributions:
0

Re: deleting order doesn't (really) restock the way I want

From developer's blog here is the answer:

Please use a file compare software, and compare original admin/orders.php and my modification/orders.php
i forgot to update the instruction file.