javascript - Adding a thumb to simplecart js image source undefined -
i'm using simplecart js. i'm having trouble getting image source of product image appear product info in cart.
the image source undefined, see demo http://jsfiddle.net/z7xw4/15/
i use following code create columns
<div class="simplecart_shelfitem"> <img alt="image" src="http://placehold.it/100x100" class="item-image"/> <a href="javascript:;" class="item_add">add cart</a>
cart
simplecart({ checkout: { type: "paypal", email: "you@yours.com" }, cartcolumns: [ {view:'image' , attr:'thumb', label: false}, { attr: "price" , label: "price", view: 'currency' } , { attr: "quantity" , label: "qty" } , { attr: "total" , label: "subtotal", view: 'currency' } , { view: "remove" , text: "remove" , label: false } ], cartstyle: "table" });
solved using code
{ view: function(item, column){ return"<img src='"+item.get('image')+"'>"; }, attr: 'image' },
see demo http://jsfiddle.net/z7xw4/23/
Comments
Post a Comment