PluginProbe
WPPizza – A Restaurant Plugin / 3.20
WPPizza – A Restaurant Plugin v3.20
trunk 2.16.11.28 3.19 3.19.1 3.19.2 3.19.3 3.19.4 3.19.5 3.19.6 3.19.7 3.19.7.1 3.19.7.2 3.19.7.3 3.19.7.4 3.19.8 3.19.8.1 3.19.8.2 3.19.8.3 3.19.9 3.20 3.20.1
wppizza / classes / markup / hiddencart.php

hiddencart.php in WPPizza – A Restaurant Plugin 3.20, at classes/markup/hiddencart.php

67 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WPPIZZA_MARKUP_HIDDENCART Class
4 *
5 * @package WPPIZZA
6 * @subpackage WPPizza Hidden Cart
7 * @copyright Copyright (c) 2015, Oliver Bach
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 3.0
10 *
11 */
12 if ( ! defined( 'ABSPATH' ) ) exit;/*Exit if accessed directly*/
13
14 /* ================================================================================================================================= *
15 *
16 *
17 *
18 * CLASS - WPPIZZA_MARKUP_HIDDENCART
19 *
20 *
21 *
22 * ================================================================================================================================= */
23
24 class WPPIZZA_MARKUP_HIDDENCART{
25
26 /******************************************************************************
27 *
28 *
29 * [construct]
30 *
31 *
32 *******************************************************************************/
33 function __construct() {
34 /* include an invisible cart on orderpage including is open check*/
35 add_action('wp_footer', array( $this, 'hidden_cart'),99);
36 }
37
38 /******************************************************************************
39 *
40 *
41 * [methods]
42 *
43 *
44 *******************************************************************************/
45
46 /*******************************************************
47 * add hidden input/div - when open - to orderpage
48 * to be be able to still add things to cart and reload (for upsells, cart amendments etc)
49 * orderpage only - let's not worry about caching as the orderpage should never be cached anyway
50 * add class if open - used in javascripts for alert when closed - class set to -novis ,
51 * to not write to element when adding to cart (only carts with wppizza-cart will be written to)
52 ******************************************************/
53 function hidden_cart(){
54 if(wppizza_is_orderpage() && wppizza_is_shop_open()){
55 echo'<span class="'.WPPIZZA_PREFIX.'-open '.WPPIZZA_PREFIX.'-cart-novis" style="display:none"></span>';
56 }
57 }
58 }
59 /***************************************************************
60 *
61 * [ini]
62 *
63 ***************************************************************/
64 if(!is_admin()){
65 $WPPIZZA_MARKUP_HIDDENCART = new WPPIZZA_MARKUP_HIDDENCART();
66 }
67 ?>