Cart – WPPizza Documentation https://docs.wp-pizza.com documentation for the wordpress wppizza plugin (version 3.x) Wed, 14 Jun 2017 10:37:45 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 wppizza / markup / cart https://docs.wp-pizza.com/wppizza-markup-cart/ Tue, 13 Jun 2017 14:15:14 +0000 http://v3x.wp-pizza.com/?p=106 Widgets -> Wppizza -> Widget Type='Cart' For shortcode attributes please refer to the shortcode section CSS Targeting Wrapper div element class: wppizza-cart (used by all instances of widget) Wrapper div element ]]> The main cart using shortcode [wppizza type='cart'] or the widget available from Appearance -> Widgets -> Wppizza -> Widget Type='Cart'

For shortcode attributes please refer to the shortcode section

CSS Targeting

  • Wrapper div element class: wppizza-cart (used by all instances of widget)
    Wrapper div element class: wppizza-cart-nocache (used by instances of widget if cart loaded via ajax)

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).
many display options are also available by simply using the relevant shortcode attributes instead of filters

  • filter name: wppizza_filter_cart_outer_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @param: $atts array (attributes)
    @param: $id int (unique id for each instance)
    @return: array

  • Note: the cart itself is made up of modules with opening hours added before (if enabled in widget/shortcode), pickup choice selection after (if pickup enabled) and orderinfo (discounts, charges) at end (if enabled).
    Therefore , the visible structure will be something like this:

     <div> .wppizza-opening-hours </div> # opening times - if enabled
    
     <div> .wppizza-cart # wrapper div - filled with below cart info - dynamically
    
    	 <div> .wppizza-cart-info </div> # cart container div - has it's own filter and uses other template files!
    
     </div> # end wrapper div
    
     <div> .wppizza-orders-pickup-choice </div> # pickup/delivery choice checkbox/radio - if enabled
    
     <div> .wppizza-orders-info </div> # order info - if enabled
    
  • filter examples:

    
    
    add_filter('wppizza_filter_cart_outer_markup', 'prefix_filter_cart_outer_markup', 10, 3);
    function prefix_filter_totals_widget_markup($markup, $atts, $id){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use print_r($atts) to view attributes
    		use print_r($id) to view id of cart instance
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER cart container div element using standard php concatenation */
    	$markup['_div'] .= '<p>more text after div</p>'; 
    
    	/* example: adding a paragraph BEFORE cart container div element  using standard php concatenation */
    	$markup['div_'] = '<p>more text before div</p>' . $markup['div_']; 
    
    	/* example: adding a paragraph AFTER cart container div element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after div</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, '_div' );
    
    	/* example: adding a paragraph BEFORE cart container div element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text buttons div</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'div_' , true);
    
    
    	/* example: using actions of another plugin that by default outputs html to add it after the container wrapper div */
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['_div'] = $markup['_div'] . $buffer; # add buffered output after end of wrapper
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/classes/markup/maincart.php – Not a template/editable file

Modules used in file

  • [basepath]/global/openingtimes.php
  • [basepath]/global/orderinfo.php
  • [basepath]/cart/cart.container.php (has it’s own filter, uses other modules/files)
  • [basepath]/global/pickup_choice.php

Module used by file(s)

  • None
]]>
wppizza / markup / cart / cart.container.php https://docs.wp-pizza.com/wppizza-markup-cart-cart-container-php/ Tue, 13 Jun 2017 15:40:24 +0000 http://v3x.wp-pizza.com/?p=132 Widgets -> Wppizza -> Widget Type='Cart' This is the inner cart element excluding the “opening hours”, “pickup choices” and/or “orders info”(discounts, charges) elements that will be displayed before ]]> Main cart element containing order details using shortcode [wppizza type='cart'] or the widget available from Appearance -> Widgets -> Wppizza -> Widget Type='Cart'

This is the inner cart element excluding the “opening hours”, “pickup choices” and/or “orders info”(discounts, charges) elements that will be displayed before and after
if enabled

For shortcode attributes please refer to the shortcode section.

CSS Targeting

  • Wrapper div element class: .wppizza-cart-info

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Structure

Note: the whole cart itself is made up of modules with opening hours added before (if enabled in widget/shortcode), pickup choice selection after (if pickup enabled) and orderinfo (discounts, charges) at end (if enabled). See here.
The cart.container.php this document refers to are the element containing the specific order details , summary , buttons etc wrapped in a container excluding the surrounding “pickup choice” etc modules

  •  <div> .wppizza-cart-info # wrapper div
    		
    		/* 
    			if shop closed 
    		*/
    		<p> .wppizza-cart </p> (text if shop closed)
    		
    
    		/* 
    			if shop open 
    		*/
    		<p> .wppizza-cart-empty </p> (text if cart is empty)	 
    
    		<table> .wppizza-order-itemised </table> (itemised order)
    
    		<table> .wppizza-order-summary </table> (summary order)
    
    		<p> .wppizza-pickup-note </p> (text if pickup chosen)		
    
    		<span> .wppizza-min-order </span> (text if minimum order not reached)		
    		
     		<div> .wppizza-cart-buttons  (wrapper div for buttons)
    		
    				<input> .wppizza-checkout-button  (checkout button)
    		
    				<input> .wppizza-empty-cart-button  (empty cart button)		
    		
     		</div> (end wrapper div buttons)
    
     </div> # end wrapper div
    

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).
many display options are also available by simply using the relevant shortcode attributes instead of filters

  • filter name: wppizza_filter_maincart_container_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @return: array

  • filter examples:

    
    
    add_filter('wppizza_filter_maincart_container_markup', 'prefix_filter_maincart_container_markup');
    function prefix_filter_totals_widget_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER cart container div element using standard php concatenation */
    	$markup['_div'] .= '<p>more text after div</p>'; 
    
    	/* example: adding a paragraph BEFORE cart container div element  using standard php concatenation */
    	$markup['div_'] = '<p>more text before div</p>' . $markup['div_']; 
    
    	/* example: adding a paragraph AFTER cart container div element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after div</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, '_div' );
    
    	/* example: adding a paragraph BEFORE cart container div element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text buttons div</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'div_' , true);
    
    
    	/* example: using actions of another plugin that by default outputs html to add it after the container wrapper div */
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['_div'] = $markup['_div'] . $buffer; # add buffered output after end of wrapper
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/cart.container.php

Modules used in file

  • [basepath]/cart/cart.shopclosed.php
  • [basepath]/cart/cart.empty.php
  • [basepath]/order/itemised.php
  • [basepath]/order/summary.php
  • [basepath]/cart/cart.pickup_note.php
  • [basepath]/cart/cart.minimum_order.php
  • [basepath]/cart/cart.checkout_button.php
  • [basepath]/cart/cart.empty_cart_button.php

Module used by other template file(s)

  • None
]]>
wppizza / markup / cart / cart.shopclosed.php https://docs.wp-pizza.com/wppizza-markup-cart-cart-shopclosed-php/ Tue, 13 Jun 2017 15:40:36 +0000 http://v3x.wp-pizza.com/?p=133 Localization. CSS Targeting paragraph element class: .wppizza-closed if you simply want to edit some styles/layout ]]> Text displayed (paragraph element) in main cart widget when shop is closed

If you just want to change the text itself, instead of using filters, set it in Wppizza -> Localization.

CSS Targeting

  • paragraph element class: .wppizza-closed

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).

  • filter name: wppizza_filter_maincart_shopclosed_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @return: array

  • examples:

    
    
    add_filter('wppizza_filter_maincart_shopclosed_markup', 'prefix_filter_cart_shopclosed_markup');
    function prefix_filter_cart_shopclosed_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER  paragraph element using standard php concatenation */
    	$markup['_p'] .= '<p>more text after</p>'; 
    
    	/* example: adding a paragraph BEFORE paragraph element  using standard php concatenation */
    	$markup['p_'] = '<p>more text before</p>' . $markup['p_']; 
    
    	/* example: adding a paragraph AFTER paragraph element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, '_p' );
    
    	/* example: adding a paragraph BEFORE paragraph element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text before</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'p_' , true);
    
    	/* example: changing html from using p element to span */
    	$markup['p_'] = str_replace('<p', '<span', $markup['p_']);
    	$markup['_p'] = str_replace('</p', '</span', $markup['_p']);
    
    	/* example: using actions of another plugin that by default outputs html to add it after the container wrapper div */
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['_p'] = $markup['_p'] . $buffer; # add buffered output after end of paragraph
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/cart.shopclosed.php

Modules used in file

  • none

Module used by file(s)

  • [basepath]/cart/cart.container.php
]]>
wppizza / markup / cart / cart.empty.php https://docs.wp-pizza.com/wppizza-markup-cart-cart-empty-php/ Tue, 13 Jun 2017 15:40:47 +0000 http://v3x.wp-pizza.com/?p=134 Localization. CSS Targeting paragraph element class: .wppizza-cart-empty if you simply want to edit some styles/layout ]]> Text displayed (paragraph element) in main cart widget when cart is empty

If you just want to change the text itself, instead of using filters, set it in Wppizza -> Localization.

CSS Targeting

  • paragraph element class: .wppizza-cart-empty

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).

  • filter name: wppizza_filter_maincart_cartempty_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @return: array

  • examples:

    
    
    add_filter('wppizza_filter_maincart_cartempty_markup', 'prefix_filter_cartempty_markup');
    function prefix_filter_cartempty_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER  paragraph element using standard php concatenation */
    	$markup['_p'] .= '<p>more text after</p>'; 
    
    	/* example: adding a paragraph BEFORE paragraph element  using standard php concatenation */
    	$markup['p_'] = '<p>more text before</p>' . $markup['p_']; 
    
    	/* example: adding a paragraph AFTER paragraph element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, '_p' );
    
    	/* example: adding a paragraph BEFORE paragraph element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text before</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'p_' , true);
    
    	/* example: changing html from using p element to span */
    	$markup['p_'] = str_replace('<p', '<span', $markup['p_']);
    	$markup['_p'] = str_replace('</p', '</span', $markup['_p']);
    
    	/* example: using actions of another plugin that by default outputs html to add it after the container wrapper div */
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['_p'] = $markup['_p'] . $buffer; # add buffered output after end of paragraph
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/cart.empty.php

Modules used in file

  • none

Module used by file(s)

  • [basepath]/cart/cart.container.php
]]>
wppizza / markup / cart / cart.pickup_note.php https://docs.wp-pizza.com/wppizza-markup-cart-cart-pickup_note-php/ Tue, 13 Jun 2017 15:41:00 +0000 http://v3x.wp-pizza.com/?p=135 Localization. CSS Targeting paragraph element class: .wppizza-pickup-note if you simply want to edit some styles/layout ]]> Text displayed (paragraph element) in main cart widget when pickup is selected

If you just want to change the text itself, instead of using filters, set it in Wppizza -> Localization.

CSS Targeting

  • paragraph element class: .wppizza-pickup-note

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).

  • filter name: wppizza_filter_maincart_pickup_note_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @return: array

  • examples:

    
    
    add_filter('wppizza_filter_maincart_pickup_note_markup', 'prefix_filter_cart_pickup_note_markup');
    function prefix_filter_cart_pickup_note_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER  paragraph element using standard php concatenation */
    	$markup['_p'] .= '<p>more text after</p>'; 
    
    	/* example: adding a paragraph BEFORE paragraph element  using standard php concatenation */
    	$markup['p_'] = '<p>more text before</p>' . $markup['p_']; 
    
    	/* example: adding a paragraph AFTER paragraph element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, '_p' );
    
    	/* example: adding a paragraph BEFORE paragraph element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text before</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'p_' , true);
    
    	/* example: changing html from using p element to span */
    	$markup['p_'] = str_replace('<p', '<span', $markup['p_']);
    	$markup['_p'] = str_replace('</p', '</span', $markup['_p']);
    
    	/* example: using actions of another plugin that by default outputs html to add it after the container wrapper div */
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['_p'] = $markup['_p'] . $buffer; # add buffered output after end of paragraph
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/cart.pickup_note.php

Modules used in file

  • none

Module used by file(s)

  • [basepath]/cart/cart.container.php
]]>
wppizza / markup / cart / cart.checkout_button.php https://docs.wp-pizza.com/wppizza-markup-cart-cart-checkout_button-php/ Tue, 13 Jun 2017 15:41:14 +0000 http://v3x.wp-pizza.com/?p=136 Localization. CSS Targeting paragraph element class: .wppizza-checkout-button if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ]]> Checkout button in main cart widget

If you just want to change the text itself, instead of using filters, set it in Wppizza -> Localization.

CSS Targeting

  • paragraph element class: .wppizza-checkout-button

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).

  • filter name: wppizza_filter_maincart_checkout_button_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @return: array

  • examples:

    
    
    add_filter('wppizza_filter_maincart_checkout_button_markup', 'prefix_filter_cart_checkout_button_markup');
    function prefix_filter_cart_checkout_button_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER input element using standard php concatenation */
    	$markup['checkout_button'] .= '<p>more text after</p>'; 
    
    	/* example: adding a paragraph BEFORE input element  using standard php concatenation */
    	$markup['checkout_button'] = '<p>more text before</p>' . $markup['empty_cart_button']; 
    
    	/* example: adding a paragraph AFTER input element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, 'checkout_button' );
    
    	/* example: adding a paragraph BEFORE input element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text before</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'checkout_button' , true);
    
    
    	/* example: using actions of another plugin that by default outputs html to add it after the input element*/
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['checkout_button'] = $markup['checkout_button'] . $buffer; # add buffered output after end of span
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/cart.checkout_button.php

Modules used in file

  • none

Module used by file(s)

  • [basepath]/cart/cart.container.php
]]>
wppizza / markup / cart / cart.empty_cart_button.php https://docs.wp-pizza.com/wppizza-markup-cart-cart-empty_cart_button-php/ Tue, 13 Jun 2017 15:41:25 +0000 http://v3x.wp-pizza.com/?p=137 Localization. CSS Targeting paragraph element class: .wppizza-empty-cart-button if you simply want to edit some styles/layout (text-sizes, color, margins, ]]> Empty cart button in main cart widget (if enabled)

If you just want to change the text itself, instead of using filters, set it in Wppizza -> Localization.

CSS Targeting

  • paragraph element class: .wppizza-empty-cart-button

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).

  • filter name: wppizza_filter_maincart_empty_cart_button_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @return: array

  • examples:

    
    
    add_filter('wppizza_filter_maincart_empty_cart_button_markup', 'prefix_filter_cart_empty_cart_button_markup');
    function prefix_filter_cart_empty_cart_button_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER  input element using standard php concatenation */
    	$markup['empty_cart_button'] .= '<p>more text after</p>'; 
    
    	/* example: adding a paragraph BEFORE input element  using standard php concatenation */
    	$markup['empty_cart_button'] = '<p>more text before</p>' . $markup['empty_cart_button']; 
    
    	/* example: adding a paragraph AFTER input element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, 'empty_cart_button' );
    
    	/* example: adding a paragraph BEFORE input element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text before</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'empty_cart_button' , true);
    
    
    	/* example: using actions of another plugin that by default outputs html to add it after the input element*/
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['empty_cart_button'] = $markup['empty_cart_button'] . $buffer; # add buffered output after end of span
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/cart.empty_cart_button.php

Modules used in file

  • none

Module used by file(s)

  • [basepath]/cart/cart.container.php
]]>
wppizza / markup / cart / cart.minimum_order.php https://docs.wp-pizza.com/wppizza-markup-cart-cart-minimum_order-php/ Tue, 13 Jun 2017 15:41:39 +0000 http://v3x.wp-pizza.com/?p=138 Localization. CSS Targeting paragraph element class: .wppizza-min-order if you simply want to ]]> Text displayed (span element) in main cart widget when minimum order has not been reached

If you just want to change the text itself, instead of using filters, set it in Wppizza -> Localization.

CSS Targeting

  • paragraph element class: .wppizza-min-order

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).

  • filter name: wppizza_filter_maincart_minimum_order_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @return: array

  • examples:

    
    
    add_filter('wppizza_filter_maincart_minimum_order_markup', 'prefix_filter_cart_minimum_order_markup');
    function prefix_filter_cart_minimum_order_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER  paragraph element using standard php concatenation */
    	$markup['_span'] .= '<p>more text after</p>'; 
    
    	/* example: adding a paragraph BEFORE paragraph element  using standard php concatenation */
    	$markup['span_'] = '<p>more text before</p>' . $markup['span_']; 
    
    	/* example: adding a paragraph AFTER paragraph element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, '_span' );
    
    	/* example: adding a paragraph BEFORE paragraph element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text before</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'span_' , true);
    
    	/* example: changing html from using span  element to p*/
    	$markup['span_'] = str_replace('<span', '<p', $markup['span_']);
    	$markup['_span'] = str_replace('</span', '</p', $markup['_span']);
    
    	/* example: using actions of another plugin that by default outputs html to add it after the container wrapper span*/
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['_span'] = $markup['_span'] . $buffer; # add buffered output after end of span
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/cart.minimum_order.php

Modules used in file

  • none

Module used by file(s)

  • [basepath]/cart/cart.container.php
]]>
wppizza / markup / cart / minicart.php https://docs.wp-pizza.com/wppizza-markup-cart-minicart-php/ Tue, 13 Jun 2017 15:41:50 +0000 http://v3x.wp-pizza.com/?p=139 Widgets -> Wppizza -> Widget Type='Cart' For shortcode attributes please refer to the shortcode section. For layout options refer to WPPizza ]]> Minicart element at top of page containing order details if using shortcode [wppizza type='cart' minicart='1'] or enabled in the widget available from Appearance -> Widgets -> Wppizza -> Widget Type='Cart'

For shortcode attributes please refer to the shortcode section.

For layout options refer to WPPizza -> Layout -> Minicart.

Please note: the minicart contains various empty html elements that are filled dynamically depending on current order status. Only ever one instance of the minicart will be displayed.

CSS Targeting

  • Wrapper div element ID: #wppizza-minicart

if you simply want to edit some styles/layout (text-sizes, color, margins, paddings etc etc ) it is strongly recommended to use css instead of filters/actions. Please refer to Modify Styles/Layout

Structure

Note: the minicart is made up of empty html elements that are filled dynamically via ajax depending on current order status.

 <div> #wppizza-minicart # wrapper div
		
	
	<div> .wppizza-totals-opacity </div> (an absolute positioned div without child elements to handle opacity)	 

	<span> .wppizza-totals-itemcount </span> (item in cart count - left)

	<span> .wppizza-totals-order </span> (value of order)

	<span> .wppizza-totals-itemcount </span> (item in cart count - right)

	<span> .wppizza-totals-viewcart-button </span> (view cart button)

	<span> .wppizza-totals-checkout-button </span> (go to checkout button)

	<span> .wppizza-totals-cart </span> (will be ajax filled with order details. empty if view cart disabled)

 </div> # end wrapper div

Filters available

apply filters by adding them to your child-theme’s functions.php (notes regarding functions.php).
many display options are also available by simply using the relevant shortcode attributes instead of filters

  • filter name: wppizza_filter_minicart_widget_markup
    purpose: modify the html markup of the html as required

    @param: $markup array (array of markup elements)
    @param: $atts array (array of attributes)
    @return: array

  • filter examples:

    
    
    add_filter('wppizza_filter_minicart_widget_markup', 'prefix_filter_minicart_container_markup');
    function prefix_filter_minicart_container_markup($markup){
    
    	/* 
    		notes: 
    		use print_r($markup) to view array keys with their respective markup
    		use print_r($atts) to view attributes set
    		use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin 
    	*/
    
    	/* example: adding a paragraph AFTER cart container div element using standard php concatenation */
    	$markup['_div'] .= '<p>more text after div</p>'; 
    
    	/* example: adding a paragraph BEFORE cart container div element  using standard php concatenation */
    	$markup['div_'] = '<p>more text before div</p>' . $markup['div_']; 
    
    	/* example: adding a paragraph AFTER cart container div element using wppizza array_splice helper function */
    	$splice_after['myprefix_paragraph'] = '<p>more text after div</p>'; 
    	$markup = wppizza_array_splice($markup, $splice_after, '_div' );
    
    	/* example: adding a paragraph BEFORE cart container div element  using wppizza array_splice helper function */
    	$splice_before['myprefix_paragraph'] = '<p>more text buttons div</p>'; 	
    	$markup = wppizza_array_splice($markup, $splice_before, 'div_' , true);
    
    
    	/* example: using actions of another plugin that by default outputs html to add it after the container wrapper div */
    	ob_start(); # start buffering
    	do_action('other_plugin_output'); # run action of other plugin that outputs things
    	$buffer= ob_get_contents(); # capture buffer in variable
    	ob_end_clean(); # clean buffer			
    	$markup['_div'] = $markup['_div'] . $buffer; # add buffered output after end of wrapper
    
    return $markup;
    }
    		

Actions available

  • none

Editing files directly

ensure you have also read the Modify/Edit Templates

basepath: [plugin-path]/wppizza/templates/markup

filepath: [plugin-path]/wppizza/templates/markup/cart/minicart.php

Modules used in file

  • none (elements are filled dynamically via ajax)

Module used by other template file(s)

  • None
]]>
Powered by atecplugins.com