Jump to:

2088 Posts in 1008 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Thumbnails in shopping cart (0.81)

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 753 Views
  • MCK
    Community Member
    9 Posts

    Thumbnails in shopping cart (0.81) Link to this post

    I am using ecommerce 0.81 and I would like to use thumbnails of the products to be purchased in the shopping cart. I have tried many ideas but can't seem to be able to reference the product thumbnail in Cart.ss. For example:

          <% if Image.ContentImage %>
             <img class="productImage" src="$Image.ContentImage.URL" alt="<% sprintf(_t("IMAGE","%s image"),$Title) %>" />
          <% else %>
             <div class="noimage">$CartID.$Image.Thumbnail </div>
          <% end_if %>

    is false and gives me "Cart_ProductVariation_OrderItem_DB_69"

    Also, is it possible to have an unordered list for Variations of a Product. In the CMS if I enter three Variations, "Small" "Medium" and "Large", it gets sorted in the CMS in alphabetical order (Large --> Small) whereas I would like it to remain in the order I entered (Small --> Large). I know I can put numbers before the text as a kludge but is there a variable setting I can use to make it more elegant?

  • eceers
    Community Member
    24 Posts

    Re: Thumbnails in shopping cart (0.81) Link to this post

    Not sure about your variations question, this is how I got thumbnails to work in 0.6.1

    I added the following function to the Product_OrderItem class in Products.php

    class Product_OrderItem extends OrderItem {
       function Image() {
          return $this->Product()->Image();

    Its highly likely not the correct implementation of the code as it wont stand up to having the ecommerce files updated by future releases.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.