Post by thegreencabbage » Tue Dec 16, 2014 12:23 pm

I am interested in implementing an "order again" function for OpenCart, with a button located in the order history list under `account/order`. This button would take all this particular order's products (and its associated options) and add them all back to the cart.

The following code I have allows me to loop through my product as well as its respective product options depending on the order ID.

Code: Select all

    $products = $this->model_account_order->getOrderProducts(
    	$this->request->get['order_id']
    );
    
    foreach ($products as $product) {
        $options = $this->model_account_order->getOrderOptions(
    	    $this->request->get['order_id'], 
    	    $product['order_product_id']
        );
    
    	foreach ($product['option'] as $option) {
        	// Implement custom logic
    	}
    }
I have no issues at the moment to get the products that I have already ordered. What I do not understand what to do and need help on is - how do I use this [if this is the way to add items to cart] to add the items back to the cart?


Posts

Joined
Fri Sep 26, 2014 11:23 am

Post by imdevlper18 » Tue Dec 16, 2014 1:51 pm

Sir when you click the re - order button, the products will be added to cart with options.

So what is the issue?

Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com


User avatar
Active Member

Posts

Joined
Sun May 11, 2014 2:04 pm

Post by thegreencabbage » Tue Dec 16, 2014 3:59 pm

Where is the re-order button?


Posts

Joined
Fri Sep 26, 2014 11:23 am

Post by imdevlper18 » Tue Dec 16, 2014 4:02 pm

Go to account - orders

There is refresh kind of button besides every order.

Click on that. It is re order button.

Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com


User avatar
Active Member

Posts

Joined
Sun May 11, 2014 2:04 pm

Post by thegreencabbage » Tue Dec 16, 2014 4:16 pm

Wow, I feel so silly. Thanks! Looked like we removed it. I added it back in - thanks.

The only issue is, the reorder button doesn't include product options.


Posts

Joined
Fri Sep 26, 2014 11:23 am

Post by PlugGuy » Thu Aug 08, 2019 9:37 pm

Revisiting this - we're seeing a few customers hitting the reorder to get the same item they got on the last order, yet the cart provides a different product each time, and they apparently don't check it before we ship. We confirm before shipping but they still miss it.

We might want to disable this feature until we move up from 1.5.5.1. Is there a simple way to defeat it? Thanks.

Chief Plug Guy
BumperPlugs.com


User avatar
Active Member

Posts

Joined
Fri Jan 25, 2013 11:11 pm


Post by imdevlper18 » Thu Aug 08, 2019 11:07 pm

Hi,

Does not look normal. You can drop us email at support@cartbinder.com

With steps to reproduce. We will check it for you.

Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com


User avatar
Active Member

Posts

Joined
Sun May 11, 2014 2:04 pm

Post by IP_CAM » Thu Aug 08, 2019 11:17 pm

It's a line in the THEME
catalog/view/theme/*/template/account/order_list.tpl
Default Theme 1.5.5.x

Code: Select all

<img src="catalog/view/theme/default/image/reorder.png" alt="<?php echo $button_reorder; ?>" title="<?php echo $button_reorder; ?>" /></a></div> 
And in a Responsive Theme, that line would look somehow similar to this:

Code: Select all

<a class="btn btn-default hidden-xs" href="<?php echo $order['reorder']; ?>"><i class="fa fa-repeat"></i> <?php echo $button_reorder; ?></a>
to be removed.

Just in case, I could share a highly enhanced v.1.5.6.5 Version, if you ever plan to move up to a fully responsive Front Side Layout, but still keep the familiar 1.5.x Admin Handling. Check the BigMax.ch link below, to see more ...
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 197 guests