Shoppingcart module

1 Functionality description

Provides an opportunity to place on the page some items that can be ordered by user. Items are placed on page with widget Item. User can see ordered items list with ItemList widget. Then he must pass 4 stages of ordering which displayed with Shoppingcart widget.

  • usermail_template – name of email template to notify a user
  • adminemail_template – name of email template to notify responsible administrator
  • max_lifetime – lifetime of order session which measured in minutes
  • shipping_costs – value of shipping costs which is added to total sum of order (minutes)
  • currency – currency name which user sees near a price

2 Item widget

This widget shows one item which may be ordered:

  • item_id – Id of item
  • title – title of item
  • price – price of item
  • admin_email – email address of responsible admin
  • page_id – Id of page where the item is located
  • class – name of css class of item container

Example of usage:


<?php
    $this->widget('shoppingcart.widgets.ItemWidget',
        array(
            'item_id' => 7,
            'title' => 'CocaCola',
            'price' => 9,
            'admin_email' => 'john_c@gmail.com',
            'page_id' => 70,
            'class'   => 'shoppingcart_item'
        )
    );
    ?>

3 ItemList widget

This widget shows the list of ordered items:

  • title – Title which shows above item list
  • user_id – Id of the customer
  • count – Number of displayed items
  • class – Name of css class of unsorted list
  • shoppingcart_link – Id of the page where item is located
  • link_items_to_page – Flag which determines when item names are references

Example of usage:


<?php
    $this->widget('shoppingcart.widgets.ItemListWidget',
        array('title'=>'MY CART',
            'user_id'=>'55',
            'count'=>5,
            'class'=>'itemlist',
            'shoppingcart_link'=>'shoppingcart/cart/shoppingcart',
            'link_items_to_page' => true
        )
    );
    ?>

4 ShoppingCart widget

This widget shows 4 stages of ordering:

  • items – Title which shows above item list
  • order – Instance of current order model
  • user – Instance of current user model
  • step – Number of current step
  • class – Name of shoppingcart css class
  • shipping_info – Information about the shipping which belongs to current order
  • payment_info – Information about the payment which belongs to current order
  • layout – Name of layout file
  • link_items_to_page – Flag which determines when item names are references

Example of usage:


<?php
    $this->widget('shoppingcart.widgets.ShoppingCartWidget',
        array(
              'class'=>'shoppingcart',
              'shipping_info' => 'some shipping info ...',
              'payment_info'  => 'some payment info ...',
              'layout'        => 'ShoppingCartWidget',
              'link_items_to_page' => true
        )
    );
    ?>