If in cart
Was wondering through session values if it this is possible.
If a presence of an item in the cart has a name value of and the total price = $50.00 to trigger show a hidden region.
Was wondering through session values if it this is possible.
If a presence of an item in the cart has a name value of and the total price = $50.00 to trigger show a hidden region.
Yes that is possible. To check the name value you would have to loop through the cart, but if you did it by item ID you could use the $cartName->InCart(ID) method that would return true or false depending on if that item id was in the cart or not.
Total price you could get by using $cartName->TotalColumn("TotalPrice")
So putting it together it might look like:
<?php
if ($cartName->InCart(3) && $cartName->TotalColumn("TotalPrice") == 50)
?>
Item id 3 is in the cart and the total is $50
<?php
}
?>
I can't seem to get this to work after customizing it a bit to match my cart name and needs.
How would you do this if all you needed was a message next to the item that says "This Item Is Already In Your Cart"?
Thanks
TroyD
<?php
if ($cartName->InCart(3)) {
?>
Item id 3 is in the
<?php
}
?>
Sorry, I should have mentioned that the list of items is dynamic. So, I would need to compare it to the item in a repeat region.
What would I bind to then?
Thanks
TroyD
use the binding for the ID column from the recordset.
<?php
if ($cartName->InCart($row_recordsetName["ProductID"])) {
?>
Item id <?php echo $row_recordsetName["ProductID"]; ?> is in the cart
<?php
}
?>
Thanks again Jason,
That did it. I was over thinking it and trying to bind something from the eCart session in there somewhere. It's all good now.
Thanks
TroyD
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.