A better “Add to Cart” animation for Prestashop (Updated)

Let’s face it: Prestashop’s default “Add to cart” animation sucks a bit. In this tutorial, I’ll show you how to change it to something more appealing and useful.

Introduction

In this short tutorial we will add a fancy popup box that notifies the customer when a product is adedd to the cart. Something similar to the one I have in my Prestashop Addons store.

First of all, the shop must be configured to use ajax animation. This option is activated by default, but in case you disabled it, be sure it’s turned on by going to the back office, Modules -> Cart Block in Front office features, and set Ajax Cart to on.

Step 1 – Introduction to the Add to cart animation

Now that we’re sure ajax is on, let’s go to our root Prestashop folder, then modules/blockcart. The file where the evil code is stored is ajax-cart.js. As always, it’s not good practice to edit core files directly, as any update can destroy our changes, therefore copy ajax-cart.js in your theme’s folder, then js/modules/blockcart/. Create any necessary folder, of course. The structure is pretty much redundant, but needed by the system. We can now start editing our file.

What we’re interested in is the add function of th cart object. It’s located at about line 176. What we really want to mess with, anyway, is the actual animation, not the whole Add to Cart process. Therefore, we will be editing this piece of code only, from line 208 to 232:


	// add the picture to the cart
	var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');
	if (!$element.length)
		$element = $('#bigpic');
	var $picture = $element.clone();
	var pictureOffsetOriginal = $element.offset();

	if ($picture.size())
		$picture.css({'position': 'absolute', 'top': pictureOffsetOriginal.top, 'left': pictureOffsetOriginal.left});

	var pictureOffset = $picture.offset();
	if ($('#cart_block').offset().top && $('#cart_block').offset().left)
		var cartBlockOffset = $('#cart_block').offset();
	else
		var cartBlockOffset = $('#shopping_cart').offset();

	// Check if the block cart is activated for the animation
	if (cartBlockOffset != undefined && $picture.size())
	{
		$picture.appendTo('body');
		$picture.css({ 'position': 'absolute', 'top': $picture.css('top'), 'left': $picture.css('left'), 'z-index': 4242 })
		.animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000)
		.fadeOut(100, function() {
			ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
		});
	}
	else

We don’t want all this junk: get rid of everything, so that the ajax call’s success function looks like this:


success: function(jsonData,textStatus,jqXHR)
	{
		// add appliance to whishlist module
		if (whishlist && !jsonData.errors)
			WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]);
		ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
	},

If you now refresh the page, you’ll notice the product is being added to the cart without animation. Already feels better!

Step 2 – Adding the floating box

Let’s add some valuable information to let our customers know they just added a product to the cart. We will first create the box with javascript, and in a second stage move some styling to the css file. Add the following just before ajaxCart.updateCartInformation(jsonData, addedFromProductPage);:

EDIT: There was a small mistake here, Marius pointed out in the comments: all of the following code MUST be enclosed within

if(!jsonData.errors)
{
}

Otherwise, the box will trigger even if customers add quantities exceeding products’ stocks! Thanks Marius!


				/* Creating the dark overlay */

				var overlay = $('<div></div>')
								.addClass('dark-overlay')
								.css({
									position: 'fixed',
									backgroundColor: 'black',
									'z-index': 99,
									display: 'none',
									opacity: .5,
									width: '100%',
									height: '100%',
									left: 0,
									top: 0
								});

				overlay.appendTo($('body')).fadeIn();

Explanation: basically, every time we now click on add to cart, a dark overlay will fade in the screen, preparing the field to give our popup more prominence. We also need to take it away once we are done though! Let’s add the following code after the previous one:

				$('.dark-overlay').click(function(){
					$(this).fadeOut(function(){
						$(this).remove()
					});
				})



And we can now toggle the dark overlay by clicking on it. Finally, let’s create our floating box:



				/* Creating the floating box */

				var floating_box = $('<div></div>')
									.addClass('add-to-cart-popup')
									.css({
										position: 'fixed',
										left: '50%',
										top: '30%',
										display: 'none',
										width: '450px',
										height: '160px',
										'margin-left': '-225px',
										backgroundColor : 'white',
										'z-index' : 100
									})

				floating_box.appendTo($('body')).fadeIn();

Explanation: We basically do what we did for the overlay, but with one difference: we want this box to have specific dimensions, and to be centered. To achieve this, we’ve got to add half on the width of the box as a negative left margin, while keeping the left positioning at 50%. This way, the box will be perfectly centered.

Step 3 – Populating the box

We have our not-so-informative box; it’s now time to make it useful. We’ve got a problem though! If we write our informative text inside the javascript file itself, it won’t be multilanguage by any mean. This is okay for single-language stores, but for all the others it will cause big troubles. How to deal with it? We will use a trick: we will add the translatable variables inside our template.

In your theme folder, navigate to modules/blockcart/blockcart.tpl and open it. If you can’t find that, because it’s not present, copy in this very same location the original one that you find in the module’s folder. At about line 35, there should be a javascript block with the following content:


<script type="text/javascript">
var customizationIdMessage = '{l s='Customization #' mod='blockcart' js=1}';
var removingLinkText = '{l s='remove this product from my cart' mod='blockcart' js=1}';
var freeShippingTranslation = '{l s='Free shipping!' mod='blockcart' js=1}';
var freeProductTranslation = '{l s='Free!' mod='blockcart' js=1}';
var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
</script>

At the end of this, so right after delete_txt, add the following variables:


var added_txt = '{l s='Product added to the cart' mod='blockcart' js=1}';
var checkout_txt = '{l s='Proceed to checkout' mod='blockcart' js=1}';
var continue_txt = '{l s='Continue shopping' mod='blockcart' js=1}';

Now we can reference these in the javascript file. Basically, we assigned to those variables texts that change when the language changes, thus offering us a nice way to implement multiple languages in our box. Let’s deal with the actual box content. Go back to ajax.cart.js and add the following at the end of our last modifications, but before appending the floating box to the body:

				/* getting the checkout link */

				var checkout_link = $('#button_order_cart').attr('href');

				/* Populating the box */

				floating_box.append('<p>'+ added_txt+'</p>');
				floating_box.append('<a href="'+checkout_link+'" class="exclusive">'+ checkout_txt+'</a>');
				floating_box.append('<a class="close-popup button">'+ continue_txt+'</a>');



Then, after appending it


				$('.close-popup').click(function(){
					$(this).parent().fadeOut(function(){
						$(this).remove()
					});
					$('.dark-overlay').fadeOut(function(){
						$(this).remove()
					});
				})	

Explanation: First of all, we need to know where to direct users once they want to procees to the checkout. Instead of creating a new link, we can make use of the existing one in the cart. Therefore, we first assign that link to a variable (checkout_link).
Then, in this order, we append the text that informs an item has been added to the cart, the checkout link, and the link to continue shopping. This last one needs to close the current dialog, therefore, in the end we register its clicks: we remove both the dialog and the overlay.

As a last step in the javascript file, we need to amend the previous overlay click to be sure we also remove the new dialog:

				$('.dark-overlay').click(function(){
					$(this).fadeOut(function(){
						$(this).remove()
					});
					$('.add-to-cart-popup').fadeOut(function(){
						$(this).remove()
					});					
				})

And we are basically done with javascript. Test it out, you’ll notice it behaves as it should…but it looks ugly. In the next step, we will style it nicely to make it a bit more appealing.

Step 4 – Styling our new Add to cart dialog

First of all, since we added classes to our overlay and floating box, we can get rid of those javascript styling. We will override blockcart.css, therefore go to your module’s folder, blockcart/ and copy blockcart.css. reach your theme’s folder, then create this folder structure, if not present: css/modules/blockcart/. If that blockcart folder is already there, the stylesheet is likely to be found inside, and you can add to that directly. If not, paste in the one we just copied, and open it up in a code editor.

At the very end of the file, add the following:

/* Floating box modification */

.dark-overlay {
	position: fixed;
	background-color: black;
	z-index: 99;
	display: none;
	opacity: .5;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
}

.add-to-cart-popup {
	position: fixed;
	left: 50%;
	top: 30%;
	display: none;
	width: 450px;
	height: 160px;
	margin-left: -225px;
	background-color : white;
	z-index : 100;
}

It’s just a copy/paste of those rules we previously applied. We can now remove them from the javascript, so that our previous objects now look like this:

/* this the overlay*/
	var overlay = $('<div>').addClass('dark-overlay');
/* And the box */
	var floating_box = $('<div>').addClass('add-to-cart-popup')

Refresh and check that it behaves as before.

Let’s now add a bit of spice to the box, by adding some other lines of css inside the popup’s class:

.add-to-cart-popup {
	position: fixed;
	left: 50%;
	top: 30%;
	display: none;
	width: 450px;
	height: 160px;
	margin-left: -225px;
	background-color : white;
	z-index : 100;
	border: 1px solid #f0f0f0;
	box-shadow:         0px 0px 10px rgba(50, 50, 50, 0.75);
	border-radius: 5px;
}

So, we’ve got some nice shadow and rounded corners, let’s space out those buttons, and give them some difference (we don’t want them to be the same, but rather the checkout one to be more prominent):


.add-to-cart-popup p {
	font-weight: bold;
	font-size: 18px;
	width: 100%;
	padding-top: 30px;
	text-align: center;
}

.add-to-cart-popup .exclusive {
	margin-left: 80px;
	margin-top: 20px;
}

.add-to-cart-popup .button {
	margin-left: 40px;
	color: #ccc;
	border: 1px solid black;
	background-image: -ms-linear-gradient(top, #404040 0%, #272727 100%);
	background-image: -moz-linear-gradient(top, #404040 0%, #272727 100%);
	background-image: -o-linear-gradient(top, #404040 0%, #272727 100%);
	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #404040), color-stop(1, #272727));
	background-image: -webkit-linear-gradient(top, #404040 0%, #272727 100%);
	background-image: linear-gradient(to bottom, #404040 0%, #272727 100%);	

}

.add-to-cart-popup .button:hover {
	background:#272727;
}

And there it is! Of course, it can be even prettier, but this gives it a nice neutral style that can be further enhanced, and adapted to your needs. here is the final result:

Our new "add to cart" animation for Prestashop

Our new “add to cart” animation for Prestashop

You like the tuts and want to say "thank you"? Well, you can always feel free to donate:

  • Niyi

    Dear Nemo,

    I am ashamed I have to ask for help at this point. I use Prestashop 1.5.4.1.
    I have done everything you stated but I could only get the dark overlay to show and not the floating box and the content.
    The error throw up is this:

    ReferenceError: added_txt is not defined
    floating_box.append(”+ added_txt+”);

    I did everything as stated in the step 3 of the tutorial by editing blockcart.tpl file inside the theme folder like this:

    var customizationIdMessage = '{l s='Customization #' mod='blockcart' js=1}';
    var removingLinkText = '{l s='Please remove this product from my cart.' mod='blockcart' js=1}';
    var freeShippingTranslation = '{l s='Free shipping!' mod='blockcart' js=1}';
    var freeProductTranslation = '{l s='Free!' mod='blockcart' js=1}';
    var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
    var added_txt = '{l s='Product added to the cart' mod='blockcart' js=1}';
    var checkout_txt = '{l s='Proceed to checkout' mod='blockcart' js=1}';
    var continue_txt = '{l s='Continue shopping' mod='blockcart' js=1}';

    In the ajaxcart.js, I have made the following changes:


    success: function(jsonData,textStatus,jqXHR)
    {
    // add appliance to whishlist module
    if (whishlist && !jsonData.errors)
    WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]);
    if(!jsonData.errors)
    {
    /* Creating the dark overlay */
    var overlay = $('').addClass('dark-overlay');

    overlay.appendTo($('body')).fadeIn();
    $('.dark-overlay').click(function(){
    $(this).fadeOut(function(){
    $(this).remove()
    });
    })

    /* Creating the floating box */
    var floating_box = $('').addClass('add-to-cart-popup')

    /* getting the checkout link */
    var checkout_link = $('#button_order_cart').attr('href');

    /* Populating the box */
    floating_box.append(''+ added_txt+'');
    floating_box.append(''+ checkout_txt+'');
    floating_box.append(''+ continue_txt+'');

    floating_box.appendTo($('body')).fadeIn();

    $('.close-popup').click(function(){
    $(this).parent().fadeOut(function(){
    $(this).remove()
    });
    $('.dark-overlay').fadeOut(function(){
    $(this).remove()
    });
    })

    $('.dark-overlay').click(function(){
    $(this).fadeOut(function(){
    $(this).remove()
    });
    $('.add-to-cart-popup').fadeOut(function(){
    $(this).remove()
    });
    })

    }
    ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
    },

    Can you please give me any direction on what to check? Been running through these codes over and over since yesterday.

    Thank you for your help.

  • http://www.filateliaitalia.it Alex

    Thanks very very much, perfectly working! I was looking exactly for this!

  • http://www.religiousproductsinc.com/ Ryan Clark

    I think you should just upload the files that you used on your website and you would not keep having to respond and fix peoples that is not working because they don’t copy and paste the code correctly

  • Maxence

    thanks !!!

  • Gianni

    Hello,
    Thanks a lot for this code.
    It works perfectly.
    I have a request :
    Would it be possible to add the name and a small image to the popup box ?

    Thanks.

    • http://www.filateliaitalia.it Alex

      To add image and name of the product you can do as follow:

      Get the title and image variables from the caller element:

      /* Getting the picture and title */
      var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');
      if (!$element.length)
      $element = $('#bigpic');
      var picture_path = $element.attr("src");
      var title = $element.attr("alt");

      Then you can append as you didi before with the other elements.

      Unfortunately I use a different code than this tutorial because I have used the Bootstrap framework, so my modal box code is different and look as follows, but to have an idea you can take a look:

      // add appliance to whishlist module
      if (whishlist && !jsonData.errors)
      WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]);
      if(!jsonData.errors)
      {
      // Creating the modal - NEXUS
      /* Getting the picture and title */
      var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');
      if (!$element.length)
      $element = $('#bigpic');
      var picture_path = $element.attr("src");
      var title = $element.attr("alt");
      /* getting the checkout link */
      var checkout_link = $('#button_order_cart').attr('href');
      /* Creating and populating modal box */
      var cartModal = $('&times'+added_txt+''+title+' '+continue_txt+''+checkout_txt+' ');
      // Showing the modal - NEXUS
      cartModal.appendTo($('body')).modal('show');
      }
      ajaxCart.updateCartInformation(jsonData, addedFromProductPage);

      • American Patriot

        First of all thank you Nemo for another great tutorial! I’m not even close to being a coder but I can follow directions and you give step-by-step directions and make it very easy for people like me.

        Alex – I tried to put the following code in the ajax-cart.js file just above where the code starts appending everything (I hope I said that right..lol) but it didn’t change anything:

        /* Getting the picture and title */
        var $element = $(callerElement).parent().parent().find(‘a.product_image img,a.product_img_link img’);
        if (!$element.length)
        $element = $(‘#bigpic’);
        var picture_path = $element.attr(“src”);
        var title = $element.attr(“alt”);

        I put it in just above this:

        floating_box.append(”+ added_txt+”);
        floating_box.append(‘‘+ checkout_txt+’‘);
        floating_box.append(‘‘+ continue_txt+’‘);
        floating_box.appendTo($(‘body’)).fadeIn();

        Am I putting it in the wrong place? I would really like to have the product image and description show in the pop-up box if possible.

        Thank you!

  • Dave

    Thank you for you time in putting together this tut.

    Unfortunately, I can not follow you. Initially, you say that the code that will be edited is line 208 to 232. Then, you say “delete all that stuff”.

    Do you mean delete line 208 – 232, or some other “stuff”.

    I would like to be able to make this change, but I guess I need the tut with a little more direction. For example, maybe show the line of code before and after the changed code for reference with the changed area before and after the change. That way I would have more idea what “stuff” I am trying to edit.

    This comment is meant with respect. You have the skills, and I don’t. I can follow directions when they are concise. Others have been able to follow, so maybe it is just me.

    Thanks anyway,

  • Javier

    Hi all, thanks for the tutorial Nemo.

    I followed the tutorial step by step several times, but something I do well.

    I get to create the overlay, which is deactivated with a click … but no buttons appear in the box.

    Screen capture: http://i.imgur.com/qg6wsXh.png

    Disabling the overlay fixed box floats on the screen.

    Screen capture: http://i.imgur.com/4Q7Zdku.png

    I’m not a programmer, just a curious person. :-)

    Can anyone help?

    Thank you!

    • Reinere

      I’m having the same exact issue.

      I’ll plug away at it for the next few hours.

      Hopefully I can find an answer.

    • Reinere

      Ok found your solution, Make sure you are adding the tpl, css file to the THEME directiory of modules

  • http://www.no-match.co.uk Ray

    Many thanks for this.

    The original animation sucked and made the sites look gimmicky.

    I do have a request….

    Would it be possible to add the name and a small image to the popup box ?

    So instead of “Product Added to Cart”, It would be

    eg, 1 x Battery Added to Cart (With a small image of the battery)

    This would just polish this excellent modification off nicely :)

    Thanks

    Ray

  • Kent

    Hi,

    Thanks for this tutorial. It was really well-written and useful – I didn’t like the standard animation either.

    I have the same issue as others, however – the “Continue Shopping” button doesn’t do anything. I can add an href “location” to it, but then the “continue shopping” button works as a link that refreshes the page, as opposed to triggering the animation.

    I have tried a hundred ways to fix this, with no luck. Has anyone succeeded in getting the “Continue Shopping” link to work as it should?

    Thanks,
    Kent

    • Kent

      I spoke to soon. Funny how things sometimes work as soon as you ask for help.

      Make sure that

      $('.close-popup').click(function(){
      $(this).parent().fadeOut(function(){
      $(this).remove()
      });
      $('.dark-overlay').fadeOut(function(){
      $(this).remove()
      });
      })

      is placed AFTER

      floating_box.appendTo($('body')).fadeIn();

      When placed before, the “continue shopping” button is inactive. When placed after, everything works!

  • http://www.chapinplus.com/tienda/ Gepser Hoil

    Would we have the link to your shop as an example?

  • Ha!*!*y

    Thanks Nemo, Just what I was looking for.

    MG: You’re taking up my valuable time with your comment, plz don’t do that just follow the steps and breathe just breathe.

  • http://www.punto-bebe.com.ar Javier

    Hi Nemo,

    I added your add to cart animation to my shop and it works great!

    Now for some reason when I click “continue shopping” using Internet Explorer 9, instead of taking me back to the same product page it takes me to the my home page.

    Do you know why this may be?

    Thanks for sharing this great material!

  • http://www.pescuitlafeeder.ro Marius

    Hi Nemo,

    I didn’t tried your code but I have the feeling that the confirmation pop-up would appear even if for example there are not enough products in stock.
    This is because “success: function(jsonData,textStatus,jqXHR)” is triggered even if the products fails to go to cart.
    In order to fix this “borantula” prestashop user suggested the use of “if (whishlist && !jsonData.errors)” before putting our pop-up code.
    Link: http://www.prestashop.com/forums/topic/169456-displaying-added-to-cart-text/

    PS. I have PS 1.4.7.3 and if there are not enough products in stock and I try to add to cart then I will get the animation which means that “success: function(jsonData,textStatus,jqXHR)” is in action, but when it finishes I get an pop-up message saying “there were not enough products in stock”.

    • http://nemops.com Nemo

      Hi,
      yes, it’s true, I will correct it as soon as I have some free time :) thanks for noticing!

  • springgrass

    Hi, This is out of topic, but I just install a version of Prestashop 1.53, and the ajax cart is not working at all. It doesn’t appear on hover. This is the default theme coming with the install. Any ideas would be helpful. Thanks.

  • charlie

    There is also one more issue:

    When you have product with available QTY let’s say 3, and someone will try to add 5 products, by default the customer will notice OUT OF STOCK popup message. However, after you close the out of stock popup, our customer will also see the faded in “Product has been added to basket” message.

    Is there any way to display the “Better add to cart animation” only when we have available QTYs in stock?

    Just to summary everything:

    1. I have product with 5 items in stock
    2. I am trying to add 6 items
    3. The out of stock information will popup – scr.hu/0gkm/lemm5
    4. … and straignt after, our new cart animation by Nemo will appear :) scr.hu/0gkm/9bnme

    So how I can prevent this cart box to be displayed if there is limited QTY of each product?

    • http://nemops.com Nemo

      This is something I actually haven’t thought about! It’s true…uhm I will examine the code as soon as i can and update the tutorial accordingly.

      Thanks for noticing! Damn prestashop, why is it so damn uselessly stubborn? It should return “okay” as the ajax request result if it was not possible to add products!

  • http://nemops.com Nemo

    @Charlie and #Docc: you probably forgot to add the class names to the continue shopping link, please check this line

    floating_box.append(‘<a class=”close-popup button”&rt;’+ continue_txt+'</a&rt;’);

    • charlie

      Thank you for your message,
      In my case, the class name was added in my code. I did everything carefully step by step and everything is working fine apart that Continue Shopping link. Can you have a look at this part of my code please:

      /* Populating the box */

      floating_box.append(”+ added_txt+”);
      floating_box.append(‘‘+ checkout_txt+’‘);
      floating_box.append(‘‘+ continue_txt+’‘);

      $(‘.close-popup’).click(function(){
      $(this).parent().fadeOut(function(){
      $(this).remove()
      });
      $(‘.dark-overlay’).fadeOut(function(){
      $(this).remove()
      });
      })

      floating_box.appendTo($(‘body’)).fadeIn();

      $(‘.dark-overlay’).click(function(){
      $(this).fadeOut(function(){
      $(this).remove()
      });
      $(‘.add-to-cart-popup’).fadeOut(function(){
      $(this).remove()
      });
      })

    • Doccc

      On my side everything is looking good


      floating_box.append(''+ added_txt+'');
      floating_box.append(''+ checkout_txt+'');
      floating_box.append(''+ continue_txt+'');

      • Doccc

        I try this and i have the same result :

        floating_box.append(''+ added_txt+'');
        floating_box.append(''+ checkout_txt+'');
        floating_box.append(''+ continue_txt+'');

        Thanks for your help

        • charlie

          Same here, but the problem is that Nemo can’t see our full code as his website treats it as a hyperlink. I’ve reported it to Nemo

        • charlie

          FOUND IT!

          This code has fixed the issue for me (provided as a picture because it would have been hyperlinked here):

          scr.hu/0gkm/c2ss1

          basically, you need to add a href=”” and that’s it :)

        • http://nemops.com Nemo

          That’s weird though, it should work without that href, or at least it does for me! On which browsers have you tested it?

  • charlie

    Very good modification, thank you!

    Working almost fine for me, the only issue is Continue Shopping button which doesn’t work. It doesn’t do anything like it doesn’t contain any link. I would like to REFRESH the current page as soon as Continue Shopping is clicked. How I can achieve this please? Thanks!

  • Doccc

    Hello,
    Thank you for sharing your knowledge with us. It working fine on 1.5.3.

    I just have a problem with “Continue shopping” , button doesn’t work.

    Do you see a mistake in my code :

    floating_box.append(''+ added_txt+'');
    floating_box.append(''+ checkout_txt+'');
    floating_box.append(''+ continue_txt+'');

    $('.close-popup').click(function(){
    $(this).parent().fadeOut(function(){
    $(this).remove()
    });
    $('.dark-overlay').fadeOut(function(){
    $(this).remove()
    });
    })

    $('.dark-overlay').click(function(){
    $(this).fadeOut(function(){
    $(this).remove()
    });
    $('.add-to-cart-popup').fadeOut(function(){
    $(this).remove()
    });
    })

    floating_box.appendTo($('body')).fadeIn();

    Thanks

  • MG

    Not working for me…no floating box is appearing …It just displays overlay…I am on prestashop 1.5.2

    • http://nemops.com Nemo

      Weird, It works even on 1.4 (see my Addons Store) with only slight changes. Check your code again, and see if you get javascript errors with Chrome dev tools :)

      • MG

        Uncaught ReferenceError: added_txt is not defined 96540dd667adb089d510514c943e7f69.js:1035
        $.ajax.success 96540dd667adb089d510514c943e7f69.js:1035
        o 96540dd667adb089d510514c943e7f69.js:2
        p.fireWith 96540dd667adb089d510514c943e7f69.js:2
        w 96540dd667adb089d510514c943e7f69.js:2
        d

        This is shown in the console of dev tools…?

        Kindly help…

        • http://nemops.com Nemo

          You missed the second block of code in step 3

        • MG

          i have not missed that….first i created a folder in themes/$name/modules/blockcart

          and then i copied blockcart.tpl from modules folder…
          and added the variables as stated in second block of step3… iwanted to confirm that i only need to copy .tpl files and not all the files ?
          If yes then i did it right as per your instructions…

  • radus

    ++ 1

    • MG

      done with this !!! nothing works… pls see to it and if its not correct pls dont publish it…prevent wastage of others time….

      • http://nemops.com Nemo

        Wasting time? Somebody forced you in doing it? I believe not.
        Stop going around insulting other people’s work, provided to you FOR FREE, just because you’re stupid and obviously don’t understand a line of javascript.

        If you’re looking to do brainless tutorials where you can simply go ahead and copy/paste, look somewhere else. This is for people with brain and will to learn. And polite people too.

        • Niyi

          Thanks Nemo for the tutorial.

          MG probably got frustrated after missing some few things like I am currently doing but he should not have made the statement he made.
          Some of us are just novice trying to learn the rope and making silly mistakes here and there. Don’t give up on us please.

          I already successfully worked through another of your tutorials on product rating stars but I am still trying to know where I went wrong on this one but I don’t want to ask yet. Kind of foolish sometimes seeing the mistake after you ask for help.

          Maybe the copy and paste idea might not be bad at the end of the tutorial for those of us that always struggle to follow the tutorial 100 percent. ☺

      • Otto

        You must be wrong in some step. Keep calm & start again.
        I tried first time and some errors there. I tried again, deleting all inserted code and adding it again, reading carefully the tutop, and it works great!
        I have to say that I’m on 1.49, not 1.5, but for sure it is easy to adapt it.
        Good luck and do not despair!

        “prevent wastage of others time….” is not a sentence to write on a free tut’s comments. ;)

Store Top Sales

You like the tuts and want to say "thank you"? Well, you can always feel free to donate: