close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

If in cart

Thread began 1/13/2012 10:01 am by mike292921 | Last modified 3/09/2012 5:11 pm by Jason Byrnes | 978 views | 7 replies |

mike292921

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.

Sign in to reply to this post

Ray BorduinWebAssist

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
}
?>
Sign in to reply to this post

troyd

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

Sign in to reply to this post

Jason ByrnesWebAssist

php:
<?php

if ($cartName->InCart(3)) {
?>
Item id 3 is in the
<?php
}
?>
Sign in to reply to this post

troyd

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

Sign in to reply to this post

Jason ByrnesWebAssist

use the binding for the ID column from the recordset.


php:
<?php 

if ($cartName->InCart($row_recordsetName["ProductID"])) { 
?> 
Item id <?php echo $row_recordsetName["ProductID"]; ?> is in the cart
<?php 

?>
Sign in to reply to this post

troyd

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

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...