The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Ability for re-orders

christinechristine Member
in Bugs & Feature Requests edited February 2013
I was wondering if there is or will be a way to re-order a past order?

I use WordPress and have a page setup for Order History that displays the past orders for a specific user when logged in. It would be great if there was a way to quickly add to cart all the same items that were ordered from a previous order. Is there any way to tap into the receipt to allow this functionality or any suggestions on how to make this happen?

Thanks,
Christine
Comments
  • fc_adamfc_adam FoxyCart Team
    @christine,

    There isn't a way to do that out of the box currently, but it's something that you could certainly set up yourself.

    In your set up for the order history, as you loop through the previous orders, you could also construct an add to cart link for the order, so the customer could click that link to recreate their previous cart. You could also do that server-side using CURL to fetch the transaction using the API and loop through the cart contents there and recreate the customers cart within their current cart session.

    So definitely possible - but it would need a little bit of work on your side to achieve.
  • Thanks for your response. Can you point me to some documentation on looping through the previous orders? I'm using the FoxyShop WordPress plugin. If you are familiar with that plugin, I'm using this function to display the customer orders: foxyshop_customer_order_history($foxycartID);

    This may be something I need to contact FoxyShop about, but let me know if you have any insight. Thanks so much!
  • fc_adamfc_adam FoxyCart Team
    @christine,

    Yeah your best bet would definitely be to reach out to David at FoxyShop, as I'm not sure if it's a feature he's already developed or if he has some helper functionality that you could expand on to achieve it. If not, you'd be hooking into the API to loop over transactions, details on that here: http://wiki.foxycart.com/static/redirect/api
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    @christine thanks for writing! I responded via email, but here's what I wrote for the benefit of others:
    What I’d recommend you do is to grab the code from the foxyshop_customer_order_history() function -- it’s in helperfunctions.php -- and then you can adjust that and make your own function where you expand out the contents of each order. Recreating an add to cart link is, I think, a little problematic because you’d be duplicating exactly what they had, not what was currently in the system. So if they got something on sale or if prices had gone up, they’d still be able to get the same cheap product from that link. You could use the product code to lookup the current product in your local database which would work fine unless they had selected variations (depends on your products). So as you can see, there are a few issues to think through. Hope that helps push you in the right direction.
Sign In or Register to comment.