Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Posts
    45
    Plugin Contributions
    0

    Default add to cart from shopping cart page

    Hi,

    My client has asked if customers can re-order previous orders.

    So far I have a button on the customers account page next to each previous order. when you click this it goes to the shopping cart page and passes the order id.

    on the shopping cart page I then have a query to get the product ids and quantities from the order id.

    The problem I am having it getting it to add the products into the cart. I have been trying to use

    if ($_GET['order_id']) { // Disable essential updates

    global $db;

    $order_query = "select * from zen_orders_products where orders_id = '".$_GET['order_id']."'";

    $orderDetails = $db->Execute($order_query);

    while (!$orderDetails->EOF) {

    $order_product_id = $orderDetails->fields['orders_products_id'];

    $qty = $orderDetails->fields['products_quantity '];

    $_SESSION['cart']->add_cart($order_product_id , $qty);

    $orderDetails->MoveNext();
    }

    }

    but this does nothing.

    am I on the right track or am I being a bit thick!

    if someone could tell me how I can add these product IDs to the cart I would be very grateful

    I am using Zen Cart 1.3.8a

    Thanks

    Rachael

  2. #2
    Join Date
    Jan 2008
    Posts
    45
    Plugin Contributions
    0

    Default Re: add to cart from shopping cart page

    ok I have got it to add the products to the shopping cart directly on the account page, I was using the wrong id (orders_product_id instead of product_id doh!)

    However the shopping cart link doesn't apear until you navigate to another page or refresh the page.

    how do I either refresh the page or redirect to the shopping cart page?

    thanks

    rachael

 

 

Similar Threads

  1. Replies: 0
    Last Post: 18 Jun 2012, 01:02 AM
  2. Replies: 7
    Last Post: 22 Jun 2011, 05:01 PM
  3. Remove right sidebox shopping cart from when on shopping cart page
    By alterego55 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 2 Oct 2010, 01:45 AM
  4. Add to cart button from my main domain name to my shopping cart
    By uwinme in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 7 Mar 2010, 01:15 AM
  5. Replies: 1
    Last Post: 10 Sep 2009, 09:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg