Wednesday, 18 September 2013

Show cart contents or total items on Woocommerce (Wordpress)

Show cart contents or total items on Woocommerce (Wordpress)
// To display the cart contents and total in your template use something like:
// To ajaxify your cart viewer so it updates when an item is added (via ajax) use:
global $woocommerce; 

echo '< a class="cart-contents" href="'.$woocommerce-%3Ecart-%3Eget_cart_url().'" 
title="'. _e('View your shopping cart', 'woothemes').'" >'. sprintf(_n('%d item', '%d items',
$woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count)
.' - '. $woocommerce->cart->get_cart_total().'< /a>
- How to use WooCommerce without a Products Page
- Express Lane Shopping: Improving the WooCommerce add to cart button

Tuesday, 10 September 2013

CSS classes selecter [class*=“span”] [class^="classname"][class$="classname"]

CSS classes selecter [class*=“span”] [class^="classname"][class$="classname"] examples below;
.show-grid [class*="span"] {
    background-color: #eee;
    text-align: center;
    border-radius: 3px;
    min-height: 30px;
    line-height: 30px;
It's an attribute wildcard selector. In the sample you've given, it looks for any child element that has a class that CONTAINS span.
So would select the  element in this example:
< div class="show-grid">
     class="span6">Blah blah
< /div>
You can also do searches for 'begins with...'
div[class^="something"] { }
which would work on something like this:-
< div class="something-else-class">< /div>
and 'ends with...'
div[class$="something"] { }
which would work on
< div class="you-are-something">< /div>