close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Add to cart call jquery function

Thread began 7/07/2011 1:04 pm by RRod55141879 | Last modified 7/08/2011 9:59 am by RRod55141879 | 3265 views | 4 replies |

RRod55141879

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.

Sign in to reply to this post

YellowCircleWeb

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.

Sign in to reply to this post

RRod55141879

Originally Said By: Ian H
  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

Sign in to reply to this post

Dave BuchholzBeta Tester

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:

php:
<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>
Sign in to reply to this post

RRod55141879

Thanks Dave.

I will give a try.

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