Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Custom page to list all items purchased
Author « Topic »  

abbyeagle
Starting Member

Australia
47 Posts

Pre-sales questions only
(More Details...)

Posted - 08/09/2021 :  22:13:32  
I want to create a page(outside myshop folder) that list all the items being purchased by current login user.

For me to fetch all items being purchased I need to link tables and here's what I found in myshop database

`customerlogin`.`clEmail` link to `orders`.`ordEmail`

`orders`.`ordID` link to `cart`.`cartOrderID`

Is there another way to achieve this?


Vince
Administrator

42874 Posts

Posted - 08/10/2021 :  01:13:11  
Hi Abbyeagle
I think what you want to do is list the items in the "cart" table that belong to that customer, much as the inccart.php script does. You can find lots of examples of listing the items in the cart table from that script by searching for "FROM cart". But it would be something like this...

$sSQL='SELECT cartID,cartProdName,cartQuantity FROM cart WHERE cartCompleted=0 AND ' . getsessionsql() . ' ORDER BY cartDateAdded';
$result=ect_query($sSQL) or ect_error();
while($rs=ect_fetch_assoc($result)){
print $rs['cartID'] . " : " . $rs['cartProdName'] . " : " . $rs['cartQuantity'] . "<br>";
}

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

abbyeagle
Starting Member

Australia
47 Posts

Pre-sales questions only
(More Details...)

Posted - 08/10/2021 :  16:40:51  
in your query what I understand

cartCompleted=0 means not yet paid?
getsessionsql() means only for the current session and it will not include previous purchased items?

but what I need is to list the "ALL" the items(including previous) in the cart table that belong to the CURRENT LOGIN customer

Example:

I purchase ItemA a month ago and I purchase again ItemB yesterday. So when I login now I will see 2 times in this url /my-items.php

Edited by - abbyeagle on 08/10/2021 16:44:09

Vince
Administrator

42874 Posts

Posted - 08/11/2021 :  02:10:03  
Hi Abbeyeagle
In that case check for the cartClientID from the "cart" table, or ordClientID from the "orders" table.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000