Example #1
0
 function wppizza_mini_cart_if_cart_invisible()
 {
     static $c = 0;
     $c++;
     /*really only once**/
     if ($c == 1) {
         $options = $this->pluginOptions;
         /*checkout as button*/
         $atts['checkout'] = 'button';
         /*add view cart button*/
         if (!empty($options['layout']['minicart_viewcart'])) {
             $atts['viewcart'] = '1';
         }
         $atts = apply_filters('wppizza_filter_minicart_atts', $atts);
         $markup = wppizza_frontendTotals($options, $atts);
         /**if we have set some class or if**/
         $class = empty($options['layout']['minicart_add_to_element']) ? 'fixed' : 'relative';
         /**always visible**/
         $visibility = empty($options['layout']['minicart_always_shown']) ? '' : 'wppizza-mini-cart-static';
         echo '<div id="wppizza-mini-cart" class="wppizza-mini-cart-' . $class . ' ' . $visibility . '">' . $markup . '</div>';
     }
 }
Example #2
0
    $markup = ob_get_clean();
    return $markup;
}
/**********************************************
	[totals]
	possible attributes:
	type='totals' (required [str])
	value='items' (optional[str]) - if used , only displays value of items as ooposed to totals including delivery etc 
	itemcount='left|right'  (optional [str]) - if used , count of item will be displayed left or right of the total 
	checkout='bool | button' (optional. mixed) - set to 'button' will display a button to go to order page, anything else will wrap the whole thing into a link instead
	example: 		[wppizza type='totals']
	returns div that with current cart totals (loaded via js)
**********************************************/
if ($type == 'totals') {
    $options = $this->pluginOptions;
    $markup = wppizza_frontendTotals($options, $atts);
}
/**********************************************
	[searchbox]
		possible attributes:
		type='search' 		(required [str])
	 	include='wppizza,post,page,attachment,revision,nav_menu_item' (optional[str]: include menu items, posts, pages and/or other cpts respectively)
	 	loggedinonly='1' (optional[bool]: anything. if defined searchform only gets displayed for logged in users)
	example: 		[wppizza type='search'  include='wppizza,post,page' loggedinonly='1']
**********************************************/
if ($type == 'search') {
    ob_start();
    $this->wppizza_include_shortcode_template($type, $atts);
    $markup = ob_get_clean();
    return $markup;
}