Add to cart call jquery function
Hi,
Anyone knows how to call a javascript function, when a item is added to cart?
For example, a model windows appears when a product is added to cart.
Thanks in advance.
Hi,
Anyone knows how to call a javascript function, when a item is added to cart?
For example, a model windows appears when a product is added to cart.
Thanks in advance.
Have a look on this site simplemodal - I was using it earlier today to create a modal log-in form and it worked a treat.
Hi Ian,
Thanks for your reply.
But i think that i made a wrong explanation.
What i need is, after a person click on "add 2 cart" a model window appear saying "your shopping cart has 1 item" and dissapear after 2 seconds.
I have the modal window function, i just dont know where to call it, on button click, or (it would be better) after the page refresh to show one item in shopping cart.
I need this because in some projects i made, the user doesnt see any diference after click "add 2 cart", because the page is so fast. And with a modal window, the user is alerted that he put that item in his shopping cart.
Thanks in advance.
Regards
If your add to cart form redirects to a new page then I would do it on page load of that page
you can put the jquery code inside a php conditional something like this:
<script type="text/javascript">
// <![CDATA[
<?php if(isset($_GET['image-upload']) && ($_GET['image-upload'] == 'true')) { ?>
$.gritter.add({
title: 'image upload successful',
text: 'you have successfully uploaded a new image associated with this <?php echo strtolower($i8_singular); ?>.',
image: '../../../../_img/icn/onebit/onebit_34.png',
sticky: false,
time: ''
});
<?php } ?>
// ]]>
</script>
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.