Looping through Ecart
Hi here me again,
As well as saving the order details into the order details table, I also want to generate an order summary, as a text string, and have that stored in my summary table in a column called orderDesc.
(I only want this so on my order admin pages i can display the items ordered without having to go to a detail page)
I have a script on my check-out page which i want to generate a string that i can add to a hidden filed in my checkout form (the one where you add the shipping info etc.),
I want to call this and have it inserted with the store summary to database behaviour on my confirm page i have the script as below.
but it does not seem to be creating a the string, i put an echo statement within the loop and that does not output, so i think theres a problem with my loop structure...
<?php // create cart summary data for order summary table
$myCartSummary = "";
//WA eCart Show If Start
if (!$eCart1->IsEmpty()){
$eCart1->MoveFirst();
while (!$eCart1->EOF()){
$myCartSummary . $eCart1->DisplayInfo("Quantity") . " " . $eCart1->DisplayInfo("Name"). " - " . $eCart1->DisplayInfo("Price") . "<br>";
if( $eCart1->DisplayInfo("slugDrinkCat") == 'gift-boxes'){
if( $eCart1->DisplayInfo("GiftLabel") != ''){
$myCartSummary . "Gift Label: " . $eCart1->DisplayInfo("GiftLabel") . "<br>";
}else{
$myCartSummary . "Gift Label: Blank Gift Label<br>";
}
}
$eCart1->MoveNext();
}
}
$eCart1->MoveFirst();
?>