O'Reilly logo

MooTools 1.3 Cookbook by Jay Larry G. Johnston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Allowing products in a shopping cart to be "put back" on the shelf

Having a firm grasp on the previous three recipes that are building blocks for what is happening in this example keeps us on track.

How to do it...

There is very little to removing the cart items. Our most difficult part is adding a widget with which our users will remove the products. The PNG format image with transparency is supported in all major browsers and adds a flair of professionalism to the cart.

... // change the Inventory level to a count of that product var cloned_html = $(newid).get('html'); cloned_html = cloned_html.replace( /Inventory/m,'Quantity'); $(newid).set('html',cloned_html); // add a return to shelf X at top right of each contaier new Element('a',{ class: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required