close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Add to cart pop up

Thread began 6/28/2010 1:13 pm by californiadiva80321412 | Last modified 7/02/2010 5:06 pm by Jimmy Wu | 4662 views | 4 replies |

californiadiva80321412

Add to cart pop up

I have created a cart page and add to cart buttons on my product pages which is all working correctly.

When the customer clicks the add to cart button, I would like a pop up window to display a confirmation that the item has been added, do they want to continue shopping or view cart - you know the type.

So, I have created the CSS and JS pop up, which works fine on it's own, however, when I add it to the button behaviour, it flashes up but disappears. How can I make it stay open? Does anyone have any idea?

Thanks in advance.

Sign in to reply to this post

Jimmy Wu

I'm not sure how your popup is set up and it is actually something that isn't supported since it requires custom coding, however it could have something to do with the add to cart button forwarding to another page that is causing the window to close again. Maybe if you posted a link to the page, someone will have a better idea and can help you out.

Sign in to reply to this post

californiadiva80321412

Originally Said By: Jimmy Wu
  I'm not sure how your popup is set up and it is actually something that isn't supported since it requires custom coding, however it could have something to do with the add to cart button forwarding to another page that is causing the window to close again. Maybe if you posted a link to the page, someone will have a better idea and can help you out.  



Hi Jimmy.

I had the same thought with regards to the page forwarding but even after removing forwarding links, it doesn't seem to work properly. I thought that it maybe a conflict with the mini cart so created a new blank page, but the css window only shows for a second and then closes.

I have a local server set up so can't provide a link to the page, but here is the code for my new blank page which may help...


<?php
//WA eCart Include
require_once("WA_eCart/CRCart_PHP.php");
?>
<?php
$CRCart->GetContent();
?>
<?php
// WA eCart AddToCart
if (isset($_POST["CRCart_1_ATC"]) || isset($_POST["CRCart_1_ATC_x"])) {
$ATC_itemID = $_POST["CRCart_1_ID_Add"];
$ATC_AddIfIn = 0;
$ATC_RedirectAfter = "";
$ATC_RedirectIfIn = "";
$ATC_itemName = "gdsa";// column binding
$ATC_itemDescription = "fda";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = "".$_POST["CRCart_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("2.00");// column binding
$ATC_itemThumb = "";// column binding
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$CRCart->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice, $ATC_itemThumb);
if ($ATC_RedirectAfter != "" && $CRCart->redirStr == "") {
$CRCart->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'];
}
}
}
?>
<?php
// WA eCart Redirect
if ($CRCart->redirStr != "") {
header("Location: ".$CRCart->redirStr);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CSS PopUp Demo</title>
<script type="text/javascript" src="csspopup.js"></script>
<style type="text/css">
<!--
#blanket {
background-color:#111;
opacity: 0.65;
position:absolute;
z-index: 9001; /*ooveeerrrr nine thoussaaaannnd*/
top:0px;
left:0px;
width:100%;
}
#popUpDiv {
position:absolute;
background-color:#eeeeee;
width:300px;
height:300px;
z-index: 9002; /*ooveeerrrr nine thoussaaaannnd*/
}
-->
</style>
<!--[if gte IE 5]> <style type="text/css"> #blanket {filter:alpha(opacity=65);}</style><![endif]-->
</head>
<body>
<div id="blanket" style="display:none;"></div>
<div id="popUpDiv" style="display:none;">
<a href="#" onclick="popup('popUpDiv')">Click Me To Close</a>
</div>
<form name="CRCart_1_ATC_0" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="CRCart_1_ID_Add" value="0" >
<input type="text" name="CRCart_1_Quantity_Add" value="1" size="4" >
<input type="submit" value="Add to Cart" onclick="popup('popUpDiv')" name="CRCart_1_ATC">
</form>
</p>
</body>
</html>

Sign in to reply to this post

californiadiva80321412

Ok, managed to do a bit of a bodge job with it. For anyone who wants to know how I did it, here it is...

I changed the button on the page to just a static button that opens the css window. At this stage, the product isn't actually added to the cart. The window opens and this is where I put in the add to cart button but displayed as the continue shopping or view cart button. When either button is clicked to close the window, the product is added to the cart.

I hope that makes sense.

Sign in to reply to this post

Jimmy Wu

Great to hear you were able to get this working. If you run into any additional issues, feel free to open a new thread.

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...