small medium large xlarge

Generic-user-small
28 Nov 2007, 01:28
Alberto (1 post)

Hi,

I have finished to implement the action “remove_from_cart” that is one of the task in the Playtime section of page 139.

Everything works well; I highlight the current_item which has been modify, and I even subtract the item from the cart when the quantity is = 0. However the highlight trick give an error when I extract the item, and it make sense because there is note current_item any more.

How can I make this effect happen only when quantity is > 0?

Here I leave what I’m doing but it’s not working.

remove_from_cart.js

page.replace_html(“cart” , :partial => “cart” , :object => @cart)

page[:cart].visual_effect :blind_up if @cart.total_items <= 0

if page[:current_item] page[:current_item].visual_effect :highlight, :startcolor => “#88ff88”, :endcolor => “#114411” end

Thanks in advance

You must be logged in to comment