Jump to content

Cannot Edit or Delete Product From Order


eManager

Recommended Posts

On the order view the delete (trash icon) and the edit (pencil) icon and functionality is missing.  I am logged in as SuperAdmin.  This functionality was there yesterday.  I need to edit quantities or be able to delete a product from an order. 

 

Any ideas?

Link to comment
Share on other sites

Did you change the order status? Some statuses cause the order to be non-editable anymore (like shipped, as the order is sent already).

 

Not fully sure if status 'payment accepted' is 'enough' to make it non-editable already...

 

Should probably hack into the database to put some validation values to 0   :-((

 

Maybe easier to create a new order for the customer, and cancel this old one?

 

My 2 cents,

pascal

Link to comment
Share on other sites

Thanks.  This is what we were thinking, but a better Prestashop feature would be to allow order editing to be controllable from an option where statuses are created/edited.  Just like choosing if a Delivery PDF should be shown or an email sent to the customer for the status I would like to choose if an order can be edited.  We have many orders that are submitted by customers who then need to change a size or color or add an item.  Creating a new order should not be necessary.  I would prefer to change the order to "On Hold" status or something and then edit it before move it back to a fully paid status. 

 

Can someone point me to the file where I can fix this?

Link to comment
Share on other sites

Never tried it, but you can probably play with the statuses and the options that are set when selecting them. For example, when you change the status "Payment Accepted" to  not yet validate and not yet set as Paid yet, I expect that you can still edit the order after the client created the order (and maybe even already paid with PayPal or so). When you then add a new status type, like 'order checked' or so where you change the order's status to the old status 'paid' and 'validated', and set this status manually after checking the order, then it might work.

 

Give it a try, and let us know.

pascal.

Link to comment
Share on other sites

This is still not working.  Nothing we do will allow us to edit items on an order.  Prestashop is really coming up short on some very basic functions.  Why is this not possible???

 

I don't understand why such simple features are missing or not working. 

Link to comment
Share on other sites

I had the same issue. After playing around with order statuses Edit Quantity and Delete Product icons on order page disappeared. It turned out that it was a result of enabling delivery slip pdfs for a particular status. Once I disabled delivery slip pdfs for the status icons came back.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 8 months later...

I've struggled today into a similar problem.

 

Our employee was editing a order, where 2 products should be deleted and two new should be added.

Our workflow is to first add the products, then delete the old.

The first product was deleted successfully, but the second isn't deleteable. The link exists but nothing happens after confirming the browser message.

 

Any Ideas?

Link to comment
Share on other sites

  • 1 month later...

I just ran into this problem, here was my solution (note: I am working with PS 1.5.6)--

 

If the order had the "Preparation in Progress" status added in the order history the products would be uneditable. 

 

This was because the "Preparation in Progress" status was considered to be related to delivery and the order should be uneditable in the delivery phase. 

 

To remove a status from the delivery phase (and allow orders to be editable with the status added)

1. go to the order_state table in the DB

2. change the order_state "delivery" field to 0 for the order state you would like (you can find the name corresponding to the id_order_state in the order_state_lang table)

 

After this change was made the products were editable.  

  • Like 3
Link to comment
Share on other sites

shkurkin's solution does indeed work. One needs to uncheck Delivery setting for Preparation in Progress order state in BO->Orders->Order states. It has a drawback though - you will lose ability to print a delivery slip if the order is in Preparation in Progress state. In my case I modified the delivery slip to serve as a picking list and wanted it to be printable before the order is actually shipped.

 

So I slightly changed the view.tpl file in /admin/themes/default/template/controllers/orders/helpers/view. I commented out the following line inside button-command div:

{if (($currentState && $currentState->delivery) || $order->delivery_number)}

and replaced it with

{if (count($invoices_collection))}

Now the delivery slip can be printed and the order can be edited in Preparation in Progress state. Note that the above solution is for PS 1.5 and is not upgrade-proof.

Link to comment
Share on other sites

  • 9 months later...
You know how to adjust views.tpl for pretashop 1.6.0.14? I have the same problem as gkorolkov. I need to edit the order and still generate a delivery slip.

 

The delivery slip is used to prepare the goods from the warehouse.

 

Regards

Link to comment
Share on other sites

  • 6 months later...

We manged to achieve it on 1.6.1.4. You can edit the order and have delivery slip. Not all files can have overrides, because you must edit the admin template files. After this mod you will be able to edit even delivered orders.

 

1. Change the admin orders template (attached).

File location: admindir/themes/default/template/controllers/orders/helpers/view/view.tpl

 

1.1 Adding additional table header.

{if !$order->hasBeenDelivered()}
<th></th>
{/if}

Change to:

<th></th>

1.2 Enabling the add product button.

{if !$order->hasBeenDelivered()}
	<button type="button" id="add_product" class="btn btn-default">
		<i class="icon-plus-sign"></i>
			{l s='Add a product'}
	</button>
{/if}

Change to:

	<button type="button" id="add_product" class="btn btn-default">
		<i class="icon-plus-sign"></i>
			{l s='Add a product'}
	</button>

1.3 Optional. If too many columns mess your table layout. Remove refund and return columns.

{if ($order->hasBeenPaid())}<th class="text-center"><span class="title_box ">{l s='Refunded'}</span></th>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}
	<th class="text-center"><span class="title_box ">{l s='Returned'}</span></th>
{/if}

Change to:

{if $order->hasProductReturned()}
	<th class="text-center"><span class="title_box ">{l s='Returned'}</span></th>
{/if}

2. Change the admin orders product line template (attached).

File location: admindir/themes/default/template/controllers/orders/_product_line.tpl.

 

2.1 Enabling the edit button on right.

{if ($can_edit && !$order->hasBeenDelivered())}

Change to:

{if ($can_edit)}

2.2 Optional. If too many columns mess your table layout. Remove refund and return columns. Delete the following lines:

	{if ($order->hasBeenPaid())}
		<td class="productQuantity text-center">
			{if !empty($product['amount_refund'])}
				{l s='%s (%s refund)' sprintf=[$product['product_quantity_refunded'], $product['amount_refund']]}
			{/if}
			<input type="hidden" value="{$product['quantity_refundable']}" class="partialRefundProductQuantity" />
			<input type="hidden" value="{(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal']))}" class="partialRefundProductAmount" />
			{if count($product['refund_history'])}
				<span class="tooltip">
					<span class="tooltip_label tooltip_button">+</span>
					<span class="tooltip_content">
					<span class="title">{l s='Refund history'}</span>
					{foreach $product['refund_history'] as $refund}
						{l s='%1s - %2s' sprintf=[{dateFormat date=$refund.date_add}, {displayPrice price=$refund.amount_tax_incl}]}<br />
					{/foreach}
					</span>
				</span>
			{/if}
		</td>
	{/if}
	{if $order->hasBeenDelivered() || $order->hasProductReturned()}
		<td class="productQuantity text-center">
			{$product['product_quantity_return']}
			{if count($product['return_history'])}
				<span class="tooltip">
					<span class="tooltip_label tooltip_button">+</span>
					<span class="tooltip_content">
					<span class="title">{l s='Return history'}</span>
					{foreach $product['return_history'] as $return}
						{l s='%1s - %2s - %3s' sprintf=[{dateFormat date=$return.date_add}, $return.product_quantity, $return.state]}<br />
					{/foreach}
					</span>
				</span>
			{/if}
		</td>
	{/if}

3. Lastly change the validation controller. Better practice to use override (attached).

File location: controllers/admin/AdminOrdersController.php

 

Remove the following lines:

        // We can't edit a delivered order
        if ($order->hasBeenDelivered()) {
            die(Tools::jsonEncode(array(
                'result' => false,
                'error' => Tools::displayError('You cannot edit a delivered order.')
            )));
        }
        // We can't edit a delivered order
        if ($order->hasBeenDelivered()) {
            die(Tools::jsonEncode(array(
                'result' => false,
                'error' => Tools::displayError('You cannot edit a delivered order.')
            )));
        }

edit_mod_reviver.zip

Edited by ernexus (see edit history)
  • Like 4
Link to comment
Share on other sites

  • 2 months later...
  • 2 years later...
  • 5 months later...
  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...