Results 1 to 6 of 6

Thread: number of article, Total

  1. #1
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default number of article, Total

    Hello,

    Is there a way or a module which would display in a small area the number of article in the cart and the Total ?

    Thanks for your help
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: number of article, Total

    shopping cart does that. use the simple template. And if that is not simple enough create a new one using simple as a starting point;

    1. Use the Contao templates module to copy iso_cart_simple.xxx (name may be off and choose the appropriate extension).[/*:m:nz7czvmg]
    2. Rename the new template to something else like iso_cart_minimal, but only change the name after the last underscore (_).[/*:m:nz7czvmg]
    3. Create a module, choose typoe shopping cart and select the new template.[/*:m:nz7czvmg]
    4. Add the module to a page or layout.[/*:m:nz7czvmg]
    5. Then strip away from the template what you don't need until desired result reached[/*:m:nz7czvmg]

  3. #3
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Re: number of article, Total

    Great it works fine !

    Two more questions ...
    - How could I remove the message when the cart is empty ?
    - Is it possible to access $GLOBAL string within a module (to have the same module for several language)?

    Thanks very much
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  4. #4
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: number of article, Total

    I always remove that message using CSS, I think it is the mod_something template that controls that, or even the source code. Either way you may find it hard to remove, but easy to hide.

    I don't know what you want to do, but you can access GLOBALS from any template or php file.

  5. #5
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Re: number of article, Total

    Good idea to remove with the CSS because removing it within the module affects other part...

    here is what I wanted to do...
    using the resource file to have the same module in several language
    Code:
    <div class="cart_info">
    <div class="productWrapper">
        <div class="product"><span class="label"><?php echo (count($this->products) == 1) ? $GLOBALS['TL_LANG']['ISO']['productSingle'] : sprintf($GLOBALS['TL_LANG']['ISO']['productMultiple'], count($this->products)); ?></span>
        <div class="subtotal"><span class="label"><?php echo $this->subTotalLabel; ?></span> <?php echo $this->subTotalPrice; ?></div>
    </div>
    </div>
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  6. #6
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: number of article, Total

    I assume you tried that, but doesn't that work? You would have to make sure those variables exist in the correct language file, otherwise Contao won't load the file. But other then that I wouldn't know why that wouldn't work.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •