Jump to:

2088 Posts in 1008 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Swipestripe questions

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: 1214 Views
  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Swipestripe questions Link to this post

    Hi to all, i am building a site using SS 3.0.3 along Swipestripe. I have two questions. Ive serached to no avail.

    1) HOW TO RETRIEVE THE NUMBER OF ITEMS IN CART

    This line

    <a href="cart" title="Cart | Panier d'chat"/>CART | PANIER D'ACHAT | <span>$WhichVariable????</span> ITEMS</a>

    sits right corner of site. All i want to do is show the number of items in cart. If none, display 0 (zero).

    2) HOW TO HAVE USER SWAP CURRENCY

    Demo shows a pop-up menu where users can swap currency. Any recipie somewhere?

    Thanks!

  • helenclarko
    Avatar
    Community Member
    25 Posts

    Re: Swipestripe questions Link to this post

    Hi Wilsonstaff,

    I'll try and get the ball rolling on this discussion.
    Hopefully I can help to push you in the right direction.

    I'm not sure there is a direct answer for question number 1, as I don't think there is a total items variable available for you to use.
    you may need to write something that takes advantage of the quantity variable, adding them together to give you a total.

    to answer question 2, you will need to open the CMS and use the shop tab.
    here's a few link to help you out:
    http://swipestripe.com/dev/docs/swipestripe/en/Extensions/Currency
    http://en.wikipedia.org/wiki/ISO_4217#Active_codes

    thanks,
    -helenclarko

  • frankmullenger
    Avatar
    Forum Moderator
    51 Posts

    Re: Swipestripe questions Link to this post

    Sorry I missed this question although I think we've sorted it out via email, for anyone else searching..

    1)
    The Cart extension class is applied to Page_Controller so you should be able to access $Cart on all your pages (in this case some pages were directly inheriting from MultiLingualPage iirc which meant $Cart was not accessible on those page types). $Cart returns an object of type Order so $Cart.Items and $Cart.Products can be used in the template.

    <ul class="shop-links">
    <% if CurrentMember %>
    <li><a href="$CartLink(Logout)" class="rev">log out</a></li>
    <li><a href="$CartLink(Account)" class="rev">your account</a></li>
    <% else %>
    <li><a href="$CartLink(Login)" class="rev">log in</a></li>
    <% end_if %>

    <li><a href="$CartLink">
    <i class="icon-shopping-cart icon-white"></i>
    $Cart.Products.Count
    </a></li>
    </ul>

    2)
    Multiple currency support is a seperate module/extension for SwipeStripe: http://swipestripe.com/products/extensions/currency/. There is an extension class that is also applied to Page_Controller so to get the currency select form you just need to add: $CurrencyForm to a template.

    The $CurrencyForm uses a select field that submits the form using javascript when the selected option changes.

  • Tama
    Avatar
    Community Member
    130 Posts

    Re: Swipestripe questions Link to this post

    Hi Frank

    Is there a similar short code we can use to display the total value of the cart contents?

    Cheers
    Tama

    1214 Views
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.