eCart Display Order
I'd like to show the most recently added product at the top of the cart list instead of the bottom.
How can I do this?
Thanks
I'd like to show the most recently added product at the top of the cart list instead of the bottom.
How can I do this?
Thanks
this will take some hand editing to the addToCart function in the eCart object file.
send a copy of the eCart object file for your site and can let you know what needs to be changed.
Here it is...
<?php
// WA eCart AddToCart
if (isset($_POST["wholesaleCart_1_ATC"]) || isset($_POST["wholesaleCart_1_ATC_x"])) {
$ATC_itemID = $_POST["wholesaleCart_1_ID_Add"];
$ATC_AddIfIn = 4;
$ATC_RedirectAfter = "checkout/cart.php";
$ATC_RedirectIfIn = "";
$ATC_itemName = "".((isset($_POST["prodname"]))?$_POST["prodname"]:"") ."";// column binding
$ATC_itemDescription = "Test Description";// column binding
$ATC_itemThumbnail = "".((isset($_POST["thumbnailimg"]))?$_POST["thumbnailimg"]:"") ."";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = "".$_POST["wholesaleCart_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".((isset($_POST["grandTotal"]))?$_POST["grandTotal"]:"") ."");// column binding
$ATC_itemS = floatval("".((isset($_POST["qty_item_Small"]))?$_POST["qty_item_Small"]:"") ."");// column binding
$ATC_itemM = floatval("".((isset($_POST["qty_item_Medium"]))?$_POST["qty_item_Medium"]:"") ."");// column binding
$ATC_itemL = floatval("".((isset($_POST["qty_item_Large"]))?$_POST["qty_item_Large"]:"") ."");// column binding
$ATC_itemXL = floatval("".((isset($_POST["qty_item_XLarge"]))?$_POST["qty_item_XLarge"]:"") ."");// column binding
$ATC_itemXXL = floatval("".((isset($_POST["qty_item_XXLarge"]))?$_POST["qty_item_XXLarge"]:"") ."");// column binding
$ATC_itemXXXL = floatval("".((isset($_POST["qty_item_XXXLarge"]))?$_POST["qty_item_XXXLarge"]:"") ."");// column binding
$ATC_itemSinglePrice = floatval("".((isset($_POST["single_price"]))?$_POST["single_price"]:"") ."");// column binding
$ATC_itemOS = floatval("".((isset($_POST["qty_item_N/A"]))?$_POST["qty_item_N/A"]:"") ."");// column binding
$ATC_itemSM = floatval("".((isset($_POST["qty_item_S/M"]))?$_POST["qty_item_S/M"]:"") ."");// column binding
$ATC_itemML = floatval("".((isset($_POST["qty_item_M/L"]))?$_POST["qty_item_M/L"]:"") ."");// column binding
$ATC_itemp24 = floatval("".((isset($_POST["qty_item_24"]))?$_POST["qty_item_24"]:"") ."");// column binding
$ATC_itemp26 = floatval("".((isset($_POST["qty_item_26"]))?$_POST["qty_item_26"]:"") ."");// column binding
$ATC_itemp28 = floatval("".((isset($_POST["qty_item_28"]))?$_POST["qty_item_28"]:"") ."");// column binding
$ATC_itemp30 = floatval("".((isset($_POST["qty_item_30"]))?$_POST["qty_item_30"]:"") ."");// column binding
$ATC_itemp32 = floatval("".((isset($_POST["qty_item_32"]))?$_POST["qty_item_32"]:"") ."");// column binding
$ATC_itemstyleNo = "".((isset($_POST["skuno"]))?$_POST["skuno"]:"") ."";// column binding
$ATC_itemcolors = "".((isset($_POST["color"]))?$_POST["color"]:"") ."";// column binding
$ATC_itemXL2 = floatval("".((isset($_POST["qty_item_XL"]))?$_POST["qty_item_XL"]:"") ."");// column binding
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$wholesaleCart->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemThumbnail, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice, $ATC_itemS, $ATC_itemM, $ATC_itemL, $ATC_itemXL, $ATC_itemXXL, $ATC_itemXXXL, $ATC_itemSinglePrice, $ATC_itemOS, $ATC_itemSM, $ATC_itemML, $ATC_itemp24, $ATC_itemp26, $ATC_itemp28, $ATC_itemp30, $ATC_itemp32, $ATC_itemstyleNo, $ATC_itemcolors, $ATC_itemXL2);
if ($ATC_RedirectAfter != "" && $wholesaleCart->redirStr == "") {
$wholesaleCart->redirStr = $ATC_RedirectAfter;
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
}
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
}
}
}
?>
i need the cart object php file from the WA_eCart folder. WA_eCart/wholesaleCart_PHP.php in a zip archive please.
find this line:
if ($itemQuantity > 0) {
$this->Items[] = new wholesaleCart_ItemDefinition($itemID, $itemName, $itemDescription, $itemThumbnail, $itemWeight, $itemQuantity, $itemPrice, $itemS, $itemM, $itemL, $itemXL, $itemXXL, $itemXXXL, $itemSinglePrice, $itemOS, $itemSM, $itemML, $itemp24, $itemp26, $itemp28, $itemp30, $itemp32, $itemstyleNo, $itemcolors, $itemXL2);
}
and change it to:
if ($itemQuantity > 0) {
array_unshift($this->Items, new wholesaleCart_ItemDefinition($itemID, $itemName, $itemDescription, $itemThumbnail, $itemWeight, $itemQuantity, $itemPrice, $itemS, $itemM, $itemL, $itemXL, $itemXXL, $itemXXXL, $itemSinglePrice, $itemOS, $itemSM, $itemML, $itemp24, $itemp26, $itemp28, $itemp30, $itemp32, $itemstyleNo, $itemcolors, $itemXL2));
}
NOTE: if you make any changes to the eCart object, this code change will be undone and will need to be reapplied.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.