Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

simpleCart js thumbnail images undefined

Tags:

javascript

For the benefit if the many people I have found asking the same question. To get the thumbnail images to show.

Item setup:

<div class="simpleCart_shelfItem">
        <img src="images/buttons.png" alt="Sample Product" class="item_thumb" thumb="images/buttonsthumb.png">
          <h2 class="item_name"> Awesome T-shirt </h2>
        <p>  <input type="text" value="1" class="item_Quantity"><br>
          <span class="item_price">$35.99</span><br>
          <a class="item_add" href="javascript:;"> Add to Cart </a></p>
        </div>

Note: The image has the class item_thumb and the attribute thumb where the value is the url to the thumbnail image.

Cart setup:

simpleCart({
cartColumns: [
    { view: "image" , attr: "thumb", label: false },
    { attr: "name" , label: "Name" } ,
    { attr: "price" , label: "Price", view: 'currency' } ,
    { view: "decrement" , label: false , text: "-" } ,
    { attr: "quantity" , label: "Qty" } ,
    { view: "increment" , label: false , text: "+" } ,
    { attr: "total" , label: "SubTotal", view: 'currency' } ,
    { view: "remove" , text: "Remove" , label: false }
]
});
like image 760
Anthony Avatar asked Nov 13 '22 23:11

Anthony


1 Answers

I am no expert but that is how I got it working. Hope that helps someone. If anybody has a better method/explanation please let me know.

like image 107
Anthony Avatar answered Nov 15 '22 12:11

Anthony