Plugin Directory

Changeset 2343218


Ignore:
Timestamp:
07/20/2020 06:09:13 AM (6 years ago)
Author:
themewinter
Message:

Adding Version 1.0.5

Location:
wp-cafe
Files:
3 deleted
12 edited
45 copied

Legend:

Unmodified
Added
Removed
  • wp-cafe/tags/1.0.5/assets/css/wpc-public.css

    r2335589 r2343218  
    45744574.wpc-food-menu-item .wpc-menu-tag {
    45754575  padding: 0;
     4576  margin: 0;
    45764577}
    45774578.wpc-food-menu-item .wpc-menu-tag li {
    … …  
    45904591  -ms-border-radius: 36px;
    45914592}
     4593.wpc-food-menu-item .wpc-menu-tag-wrap .wpc-menu-tag {
     4594  display: inline-block;
     4595}
    45924596.wpc-food-menu-item .wpc-food-inner-content {
    45934597  position: relative;
    … …  
    46604664  text-align: center;
    46614665  color: #fff;
     4666  padding: 0;
    46624667}
    46634668.wpc-food-menu-item .wpc-add-to-cart a i {
    … …  
    50785083  -ms-transition: all 0.4s ease;
    50795084  transform: translateY(-50%);
     5085  padding-left: 40px;
    50805086}
    50815087.wpc_cart_block.cart_icon_active {
  • wp-cafe/tags/1.0.5/assets/js/wpc-public.js

    r2335589 r2343218  
    678678                    },
    679679                    success: function (results) {
     680                        $( document.body ).trigger( 'wc_fragment_refresh' );
    680681                        $('#wpc-mini-cart-count').html("");
    681682                        $('#wpc-mini-cart-count').html(results.data.wpc_count);
  • wp-cafe/tags/1.0.5/assets/scss/wpc-public.scss

    r2335589 r2343218  
    3838    .wpc-menu-tag {
    3939        padding: 0;
    40 
     40        margin: 0;
    4141        li {
    4242            font-size     : 11px;
    … …  
    5353        }
    5454    }
     55    .wpc-menu-tag-wrap{
     56        .wpc-menu-tag{
     57            display: inline-block;
     58        }
     59    }
    5560
    5661    .wpc-food-inner-content {
    … …  
    130135            text-align      : center;
    131136            color           : #fff;
     137            padding: 0;
    132138
    133139            i {
    … …  
    659665    @include transition();
    660666    @include transform(translateY(-50%));
    661 
     667    padding-left: 40px;
    662668    &.cart_icon_active {
    663669        right: 0;
  • wp-cafe/tags/1.0.5/core/action/wpc-ajax-action.php

    r2335589 r2343218  
    225225            $response = [ 'status_code' => 500 , 'message' => ['somthing is wrong'] , 'data' => [] ];
    226226            wp_send_json_error( $response );
    227             wp_die();
    228         }
    229 
     227        }
    230228        if ( "wpc_add_car_single_page" == sanitize_text_field( $_POST['wpc_action'] ) ) {
    231229            $post_arr     = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING );
    … …  
    246244
    247245            }
    248 
     246           
     247            // mini cart content
    249248            $wpc_cart_content = '';
    250249            $items            = WC()->cart->get_cart();
    … …  
    265264
    266265                $currency     = get_woocommerce_currency_symbol();
    267                 $price        = get_post_meta( $product_id, '_regular_price', true );
    268                 $sale         = get_post_meta( $product_id, '_sale_price', true );
     266
    269267                $_woo_product = wc_get_product( $product_id );
     268
    270269                $price_div    = '';
    271                 if ( $sale ) {
    272                     $price_div .= '× ' . $currency . ' ' . $sale;
    273                 } elseif ( $price ) {
    274                     $price_div .= ' × ' . $currency . ' ' . $price;
     270                if ( wc_get_price_including_tax( $_woo_product ) ) {
     271                    $price_div .= '× ' . $currency . ' ' . wc_get_price_including_tax( $_woo_product );
     272                }
     273                else {
     274                    $price_div .= ' × ' . $currency . ' ' . wc_get_price_excluding_tax( $_woo_product );
    275275                }
    276276
    … …  
    314314                'wpc_count' => $item_count, 'wpc_cart_content' => $wpc_cart_content] );
    315315        }
    316 
    317316        die();
    318317    }
    319 
    320318}
  • wp-cafe/tags/1.0.5/core/widgets/hook.php

    r2335589 r2343218  
    11<?php
     2
    23namespace WpCafe\Core\Widgets;
    34
    4 defined( "ABSPATH" ) || exit;
     5defined("ABSPATH") || exit;
    56
    67use WpCafe\Utils\Wpc_Utilities as Utils;
    … …  
    1112 * create post type class
    1213 */
    13 class Hook {
     14class Hook
     15{
    1416
    1517    use Wpc_Singleton;
    16    
     18
    1719    private $settings_obj = null;
    1820    public $wpc_message   = '';
    … …  
    2123     * call hooks
    2224     */
    23     public function init() {
    24         $settings = $this->settings_obj=  \WpCafe\Core\Base\Wpc_Settings_Field::instance()->get_settings_option();
     25    public function init()
     26    {
     27        $settings = $this->settings_obj =  \WpCafe\Core\Base\Wpc_Settings_Field::instance()->get_settings_option();
    2528
    2629        // add shortcode
    27         add_shortcode( 'wpc_food_menu_tab',[$this, 'wpc_food_menu_tab'] );
    28         add_shortcode( 'wpc_food_menu_list',[$this, 'wpc_food_menu_list'] );
    29         add_shortcode( 'wpc_reservation_form',[$this, 'wpc_booking_form_shortcode'] );
     30        add_shortcode('wpc_food_menu_tab', [$this, 'wpc_food_menu_tab']);
     31        add_shortcode('wpc_food_menu_list', [$this, 'wpc_food_menu_list']);
     32        add_shortcode('wpc_reservation_form', [$this, 'wpc_booking_form_shortcode']);
    3033        // add minicart to header
    31         add_action( 'wp_head',[$this, 'wpc_custom_mini_cart'] );
     34        add_action('wp_head', [$this, 'wpc_custom_mini_cart']);
    3235
    3336        // add new field in checkout page
    34         if ( isset( $settings['wpcafe_food_location'] ) && $settings['wpcafe_food_location'] == 'on' && class_exists( 'WooCommerce' ) ) {
    35             add_action( 'woocommerce_checkout_before_customer_details', [$this, 'wpc_location_checkout_form'] );
    36             add_action( 'woocommerce_checkout_process', [$this, 'wpc_validate_location'] );
    37             add_action( 'woocommerce_checkout_create_order', [$this, 'wpc_location_update_meta'], 10, 2 );
     37        if (isset($settings['wpcafe_food_location']) && $settings['wpcafe_food_location'] == 'on' && class_exists('WooCommerce')) {
     38            add_action('woocommerce_checkout_before_customer_details', [$this, 'wpc_location_checkout_form']);
     39            add_action('woocommerce_checkout_process', [$this, 'wpc_validate_location']);
     40            add_action('woocommerce_checkout_create_order', [$this, 'wpc_location_update_meta'], 10, 2);
    3841        }
    3942        // menu order action
    40         add_action( 'product_cat_add_form_fields', [$this, 'wpc_product_cat_taxonomy_add_new_meta_field'], 10, 1 );
    41         add_action( 'product_cat_edit_form_fields', [$this, 'wpc_product_cat_taxonomy_edit_meta_field'], 10, 1 );
    42         add_action( 'edited_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1 );
    43         add_action( 'create_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1 );
     43        add_action('product_cat_add_form_fields', [$this, 'wpc_product_cat_taxonomy_add_new_meta_field'], 10, 1);
     44        add_action('product_cat_edit_form_fields', [$this, 'wpc_product_cat_taxonomy_edit_meta_field'], 10, 1);
     45        add_action('edited_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1);
     46        add_action('create_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1);
    4447        //Displaying Additional Columns
    45         add_filter( 'manage_edit-product_cat_columns', [$this, 'wpc_custom_fields_list_title' ] );
    46         add_action( 'manage_product_cat_custom_column', [$this, 'wpc_custom_fields_list_diplay' ], 10, 3 );
     48        add_filter('manage_edit-product_cat_columns', [$this, 'wpc_custom_fields_list_title']);
     49        add_action('manage_product_cat_custom_column', [$this, 'wpc_custom_fields_list_diplay'], 10, 3);
    4750        // update cart counter
    48         add_filter( 'woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_count_fragment_refresh'], 30, 1 );
    49         add_filter( 'woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_content_fragment_refresh']);
    50 
     51        add_filter('woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_count_fragment_refresh'], 30, 1);
     52        add_filter('woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_content_fragment_refresh']);
    5153    }
    5254
    … …  
    5557     * Print the reservation form's HTML code.
    5658     */
    57     public function wpc_booking_form_shortcode($atts) {
     59    public function wpc_booking_form_shortcode($atts)
     60    {
    5861        ob_start();
    5962        $settings = $this->settings_obj;
    6063        include_once 'reservation-form-template.php';
    61         if ( isset( $settings['wpc_allow_cancellation'] ) ) {
     64        if (isset($settings['wpc_allow_cancellation'])) {
    6265            include_once 'cancellation-form-template.php';
    6366        }
    … …  
    7174     * @param [type] $id
    7275     */
    73     public function wpc_tag($id) {
    74         ?>
    75         <div class="wpc-menu-tag-wrap">
     76    public function wpc_tag($id)
     77    {
     78?>
    7679        <?php
    7780        $current_tags = get_the_terms($id, 'product_tag');
    … …  
    8083        if ($current_tags && !is_wp_error($current_tags)) {
    8184            //create a list to hold our tags
    82             ?>
     85        ?>
    8386            <ul class="wpc-menu-tag">
    84             <?php
    85 
    86             //for each tag we create a list item
    87             foreach ($current_tags as $tag) {
    88                 $tag_title = $tag->name;
     87                <?php
     88
     89                //for each tag we create a list item
     90                foreach ($current_tags as $tag) {
     91                    $tag_title = $tag->name;
    8992                ?>
    90                 <li><?php echo esc_html( $tag_title ); ?></li>
     93                    <li><?php echo esc_html($tag_title); ?></li>
    9194                <?php
    92             }
    93             ?>
     95                }
     96                ?>
    9497            </ul>
    95         <?php } ?>
    96         </div>
    97         <?php
     98        <?php }
    9899    }
    99100
    … …  
    102103     *
    103104     */
    104     public function wpc_location() {
     105    public function wpc_location()
     106    {
    105107        // show location
    106108        $settings = $this->settings_obj;
    107109        if (isset($settings['wpcafe_food_location']) && $settings['wpcafe_food_location'] == 'on') {
    108             ?>
     110        ?>
    109111            <div id="wpc_location_modal" class="wpc_modal">
    110112                <!-- Modal content -->
    111113                <div class="modal-content">
    112114                    <select name="wpc-location" class="wpc-location">
    113                         <option value=""><?php echo esc_html('Select a location', 'wpcafe')?></option>
    114                     <?php
    115                     // get wpcafe locations
    116                     $wpc_loctaion = get_terms('wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0]);
    117                     if (count($wpc_loctaion) > 0) {
    118                         foreach ($wpc_loctaion as $value) {
     115                        <option value=""><?php echo esc_html('Select a location', 'wpcafe') ?></option>
     116                        <?php
     117                        // get wpcafe locations
     118                        $wpc_loctaion = get_terms('wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0]);
     119                        if (count($wpc_loctaion) > 0) {
     120                            foreach ($wpc_loctaion as $value) {
    119121                        ?>
    120                             <option value="<?php echo esc_html( $value->slug ); ?>"><?php echo esc_html__( $value->name , 'wpcafe')?></option>
     122                                <option value="<?php echo esc_html($value->slug); ?>"><?php echo esc_html__($value->name, 'wpcafe') ?></option>
     123                            <?php
     124                            }
     125                        } else {
     126                            ?>
     127                            <option value=""><?php echo esc_html__('No location set', 'wpcafe') ?></option>
    121128                        <?php
    122129                        }
    123                     }
    124                     else {
    125130                        ?>
    126                         <option value=""><?php echo esc_html__('No location set', 'wpcafe')?></option>
    127                         <?php
    128                     }
    129                     ?>
    130131                    </select>
    131                     <button class="wpc-select-location wpc-btn wpc-btn-primary" >Ok</button>
    132                     <button class="wpc-close wpc-btn" > <i class="dashicons dashicons-no-alt"></i> </button>
     132                    <button class="wpc-select-location wpc-btn wpc-btn-primary">Ok</button>
     133                    <button class="wpc-close wpc-btn"> <i class="dashicons dashicons-no-alt"></i> </button>
    133134                </div>
    134135            </div>
    135             <?php
     136        <?php
    136137        }
    137138    }
    … …  
    143144     * @param $content
    144145     */
    145     public function wpc_food_menu_tab( $atts, $content ) {
    146         if ( ! class_exists( 'Woocommerce' )) {
    147             return ;
     146    public function wpc_food_menu_tab($atts, $content)
     147    {
     148        if (!class_exists('Woocommerce')) {
     149            return;
    148150        }
    149151        ob_start();
    … …  
    152154            $this->wpc_location();
    153155        }
    154         $atts = extract( shortcode_atts(
    155             ['wpc_food_catgeries' => '21', 'no_of_product' => 5, 'product_thumnail' => "on"
    156             ,'wpc_cart_button' => 'on' ]
    157             , $atts ) );
    158        
    159         $wpc_cat_arr      = explode( ',', $wpc_food_catgeries );
     156        $atts = extract(shortcode_atts(
     157            [
     158                'wpc_food_catgeries' => '21', 'no_of_product' => 5, 'product_thumnail' => "on", 'wpc_cart_button' => 'on'
     159            ],
     160            $atts
     161        ));
     162
     163        $wpc_cat_arr      = explode(',', $wpc_food_catgeries);
    160164        $wpc_cat_sort_arr = [];
    161165        $i                = 0;
    162166
    163         foreach ( $wpc_cat_arr as $value ) {
     167        foreach ($wpc_cat_arr as $value) {
    164168            $i++;
    165169
    166             if ( $wpc_cat = get_term_by( 'id', $value, 'product_cat' ) ) {
    167                 $wpc_get_menu_order = get_term_meta( $wpc_cat->term_id, 'wpc_menu_order_priority', true );
    168                 if ( $wpc_get_menu_order == '' ) {
     170            if ($wpc_cat = get_term_by('id', $value, 'product_cat')) {
     171                $wpc_get_menu_order = get_term_meta($wpc_cat->term_id, 'wpc_menu_order_priority', true);
     172                if ($wpc_get_menu_order == '') {
    169173                    $wpc_cat_sort_arr[$i] = $value;
    170174                } else {
    … …  
    172176                }
    173177            }
    174 
    175         }
    176         ksort( $wpc_cat_sort_arr );
     178        }
     179        ksort($wpc_cat_sort_arr);
    177180        $current = '';
    178181        ?>
    … …  
    180183            <ul class="wpc-nav">
    181184                <?php
    182                     foreach ( $wpc_cat_sort_arr as $key => $value ) {
    183                         if ( $wpc_cat = get_term_by( 'id', $value, 'product_cat' ) ) {
    184                             $current      = $wpc_cat->name;
    185                             $active_class = (  ( $key == array_keys($wpc_cat_sort_arr)[0] ) ? 'wpc-active' : ' ' );
    186                             ?>
    187                             <li>
    188                                 <a href="#"
    189                                     data-id="tab_<?php echo Utils::wpc_render( Utils::wpc_cat_name_lower( $current ) ); ?>"
    190                                     class="wpc-tab-a <?php echo esc_attr($active_class); ?>"
    191                                     data-toggle="tab" aria-expanded="true">
    192                                     <span><?php echo esc_attr_e( $wpc_cat->name, 'wpcafe' ); ?></span>
    193                                 </a>
    194                             </li>
    195                             <?php
    196                         }
     185                foreach ($wpc_cat_sort_arr as $key => $value) {
     186                    if ($wpc_cat = get_term_by('id', $value, 'product_cat')) {
     187                        $current      = $wpc_cat->name;
     188                        $active_class = (($key == array_keys($wpc_cat_sort_arr)[0]) ? 'wpc-active' : ' ');
     189                ?>
     190                        <li>
     191                            <a href="#" data-id="tab_<?php echo Utils::wpc_render(Utils::wpc_cat_name_lower($current)); ?>" class="wpc-tab-a <?php echo esc_attr($active_class); ?>" data-toggle="tab" aria-expanded="true">
     192                                <span><?php echo esc_attr_e($wpc_cat->name, 'wpcafe'); ?></span>
     193                            </a>
     194                        </li>
     195                <?php
    197196                    }
     197                }
    198198                ?>
    199199            </ul>
    200200            <div class='wpc-tab-content'>
    201201                <?php
    202                     foreach ( $wpc_cat_sort_arr as $current_key => $value ) {
    203                         $wpc_cat = get_term_by( 'id', $value, 'product_cat' );
    204                         $args    = [
    205                             'post_type'      => 'product',
    206                             'posts_per_page' => $no_of_product,
    207                             'product_cat'    => $wpc_cat->name,
    208                         ];
    209                         $active_class = (  ( $current_key == array_keys($wpc_cat_sort_arr)[0] ) ? 'tab-active' : ' ' );
    210                         $wpc_cat_id   = Utils::wpc_cat_name_lower( $wpc_cat->name );
    211                         $products = wc_get_products($args);
    212                         ?>
    213                         <div class='wpc-tab <?php echo esc_attr($active_class); ?>' data-id='tab_<?php echo esc_attr( $wpc_cat_id ); ?>'>
    214                             <div class='wpc-row'>
    215                                 <?php foreach ($products as $product) { ?>
    216                                     <div class='wpc-col-lg-6'>
    217                                         <div class='wpc-food-menu-item wpc-row'>
    218                                             <?php
    219                                             // show tag
    220                                             if ( $product_thumnail == "on" ) {
     202                foreach ($wpc_cat_sort_arr as $current_key => $value) {
     203                    $wpc_cat = get_term_by('id', $value, 'product_cat');
     204                    $args    = [
     205                        'post_type'      => 'product',
     206                        'posts_per_page' => $no_of_product,
     207                        'product_cat'    => $wpc_cat->name,
     208                    ];
     209                    $active_class = (($current_key == array_keys($wpc_cat_sort_arr)[0]) ? 'tab-active' : ' ');
     210                    $wpc_cat_id   = Utils::wpc_cat_name_lower($wpc_cat->name);
     211                    $products = wc_get_products($args);
     212                ?>
     213                    <div class='wpc-tab <?php echo esc_attr($active_class); ?>' data-id='tab_<?php echo esc_attr($wpc_cat_id); ?>'>
     214                        <div class='wpc-row'>
     215                            <?php foreach ($products as $product) { ?>
     216                                <div class='wpc-col-lg-6'>
     217                                    <div class='wpc-food-menu-item wpc-row'>
     218                                        <?php
     219                                        // show tag
     220                                        if ($product_thumnail == "on") {
     221                                        ?>
     222                                            <div class="wpc-col-md-3">
     223                                                <div class="wpc-food-menu-thumb">
     224                                                    <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>">
     225                                                        <?php echo Wpc_Utilities::wpc_kses($product->get_image()); ?>
     226                                                    </a>
     227                                                </div>
     228                                            </div>
     229                                        <?php } ?>
     230                                        <div class="wpc-col-md-9">
     231                                            <div class="wpc-food-inner-content">
     232                                                <div class="wpc-menu-tag-wrap">
     233                                                    <?php
     234                                                    $this->wpc_tag($product->get_id());
     235                                                    $price = '';
     236                                                    if (wc_get_price_including_tax($product)) {
     237                                                        $price      = wc_get_price_including_tax($product);
     238                                                    } else {
     239                                                        $price = wc_get_price_excluding_tax($product);
     240                                                    }
     241                                                    ?>
     242                                                    <?php if ($product->get_price_suffix() != '') { ?>
     243                                                        <ul class="wpc-menu-tag">
     244                                                            <li>
     245                                                                <?php if (wc_get_price_including_tax($product)) {
     246                                                                    // get percentage tax
     247                                                                    echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     248                                                                } ?>
     249                                                            </li>
     250                                                        </ul>
     251                                                    <?php } ?>
     252                                                </div>
     253                                                <h3 class="wpc-post-title">
     254                                                    <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>"><?php echo esc_html($product->get_name());  ?> </a>
     255                                                    <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?>
     256                                                        <span class="wpc-menu-price"><?php echo esc_html($price); ?></span></span>
     257                                                </h3>
     258                                                <?php echo Wpc_Utilities::wpc_kses(esc_html__(get_the_excerpt($product->get_id(), 'wpcafe')));
     259                                                // show cart button
     260                                                if ($wpc_cart_button == 'on') {
    221261                                                ?>
    222                                                     <div class="wpc-col-md-3">
    223                                                         <div class="wpc-food-menu-thumb">
    224                                                             <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>">
    225                                                             <?php echo Wpc_Utilities::wpc_kses( $product->get_image() ); ?>
    226                                                             </a>
    227                                                         </div>
     262                                                    <div class="wpc-add-to-cart">
     263                                                        <a href="?add-to-cart<?php echo Wpc_Utilities::wpc_numeric($product->get_id()); ?>" data-product_id="<?php echo Wpc_Utilities::wpc_numeric($product->get_id()); ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
     264                                                            <i class="wpcafe-cart_icon"></i>
     265                                                        </a>
    228266                                                    </div>
    229                                             <?php } ?>
    230                                             <div class="wpc-col-md-9">
    231                                                 <div class="wpc-food-inner-content">
    232                                                     <!-- display tag -->
    233                                                     <?php $this->wpc_tag( $product->get_id() ); ?>     
    234                                                     <h3 class="wpc-post-title">
    235                                                         <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>"><?php echo esc_html( $product->get_name() );  ?> </a>
    236                                                         <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?>
    237                                                         <span class="wpc-menu-price"><?php echo esc_html( $product->get_price() ); ?></span></span>
    238                                                     </h3>
    239                                                     <?php echo esc_html__(get_the_excerpt( $product->get_id() ) , 'wpcafe'); ?>
    240                                                     <?php
    241                                                         // show cart button
    242                                                         if ($wpc_cart_button == 'on') {
    243                                                             ?>
    244                                                             <div class="wpc-add-to-cart">
    245                                                                 <a href="?add-to-cart<?php echo Wpc_Utilities::wpc_numeric( $product->get_id() ); ?>" data-product_id="<?php echo Wpc_Utilities::wpc_numeric( $product->get_id() ); ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
    246                                                                     <i class="wpcafe-cart_icon"></i>
    247                                                                 </a>
    248                                                             </div>
    249                                                             <?php
    250                                                         }
    251                                                     ?>
    252                                                     </div>
     267                                                <?php
     268                                                }
     269                                                ?>
    253270                                            </div>
    254271                                        </div>
    255272                                    </div>
    256                                 <?php } ?>
    257                             </div>
     273                                </div>
     274                            <?php } ?>
    258275                        </div>
    259                         <?php
    260                     }
     276                    </div>
     277                <?php
     278                }
    261279                ?>
    262280            </div>
    263281        </div>
    264         <?php
     282    <?php
    265283        $contents = ob_get_clean();
    266284        return $contents;
    … …  
    272290     * @param Type $var
    273291     */
    274     public function wpc_food_menu_list($atts,$content) {
    275         if ( ! class_exists( 'Woocommerce' )) {
    276             return ;
     292    public function wpc_food_menu_list($atts, $content)
     293    {
     294        if (!class_exists('Woocommerce')) {
     295            return;
    277296        }
    278297        ob_start();
    … …  
    282301        }
    283302
    284         $atts = extract( shortcode_atts(
    285             ['wpc_food_catgeries' => '21', 'no_of_product' => 5, 'wpc_cart_button'=> 'on']
    286             , $atts ) );
     303        $atts = extract(shortcode_atts(
     304            ['wpc_food_catgeries' => '21', 'no_of_product' => 5, 'wpc_cart_button' => 'on'],
     305            $atts
     306        ));
    287307
    288308        // category sorting from backend
    289         $wpc_cat_arr      = explode( ',', $wpc_food_catgeries );
     309        $wpc_cat_arr      = explode(',', $wpc_food_catgeries);
    290310
    291311        $args = array(
    … …  
    296316            'post_status'      => 'publish',
    297317            'suppress_filters' => false,
    298        
     318
    299319        );
    300         if (is_array( $wpc_cat_arr ) && count( $wpc_cat_arr )>0) {
     320        if (is_array($wpc_cat_arr) && count($wpc_cat_arr) > 0) {
    301321            $args['tax_query'] = array(
    302322                array(
    … …  
    310330        };
    311331        $products = wc_get_products($args);
    312         ?>
     332    ?>
    313333        <div class='wpc-food-wrapper'>
    314334            <?php foreach ($products as $product) { ?>
    315             <div class="wpc-food-menu-item wpc-row">
    316                 <!-- thumbnail -->
    317                 <?php if ( $product->get_image() ) { ?>
    318                     <div class="wpc-col-md-3">
    319                         <div class="wpc-food-menu-thumb">
    320                             <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>">
    321                                 <?php echo Wpc_Utilities::wpc_kses( $product->get_image() ); ?>
    322                             </a>
     335                <div class="wpc-food-menu-item wpc-row">
     336                    <!-- thumbnail -->
     337                    <?php if ($product->get_image()) { ?>
     338                        <div class="wpc-col-md-3">
     339                            <div class="wpc-food-menu-thumb">
     340                                <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>">
     341                                    <?php echo Wpc_Utilities::wpc_kses($product->get_image()); ?>
     342                                </a>
     343                            </div>
     344                        </div>
     345                    <?php } ?>
     346                    <div class="wpc-col-md-9">
     347                        <div class="wpc-food-inner-content">
     348                            <!-- display tag -->
     349                            <div class="wpc-menu-tag-wrap">
     350                                <?php
     351                                $this->wpc_tag($product->get_id());
     352                                $price = '';
     353                                if (wc_get_price_including_tax($product)) {
     354                                    $price      = wc_get_price_including_tax($product);
     355                                } else {
     356                                    $price = wc_get_price_excluding_tax($product);
     357                                }
     358                                ?>
     359                                <?php if ($product->get_price_suffix() != '') { ?>
     360                                    <ul class="wpc-menu-tag">
     361                                        <li>
     362                                            <?php if (wc_get_price_including_tax($product)) {
     363                                                // get percentage tax
     364                                                echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     365                                            } ?>
     366                                        </li>
     367                                    </ul>
     368                                <?php } ?>
     369                            </div>
     370                            <h3 class="wpc-post-title">
     371                                <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>"><?php echo esc_html($product->get_name());  ?> </a>
     372                                <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?> <span class="wpc-menu-price"><?php echo esc_html($price); ?></span></span>
     373                            </h3>
     374                            <?php
     375                            echo esc_html__(get_the_excerpt($product->get_id()), 'wpcafe');
     376                            // show cart button
     377                            if ($wpc_cart_button == 'on') {
     378                            ?>
     379                                <div class="wpc-add-to-cart">
     380                                    <a href="?add-to-cart<?php echo esc_html($product->get_id()); ?>" data-product_id="<?php echo esc_html($product->get_id()); ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
     381                                        <i class="wpcafe-cart_icon"></i>
     382                                    </a>
     383                                </div>
     384                            <?php
     385                            }
     386                            ?>
    323387                        </div>
    324388                    </div>
    325                 <?php } ?>
    326                 <div class="wpc-col-md-9">
    327                     <div class="wpc-food-inner-content">
    328                         <!-- display tag -->
    329                         <?php $this->wpc_tag( $product->get_id() ); ?>
    330                         <h3 class="wpc-post-title">
    331                             <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>"><?php echo esc_html( $product->get_name() );  ?> </a>
    332                             <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?> <span class="wpc-menu-price"><?php echo esc_html( $product->get_price() ); ?></span></span>
    333                         </h3>
    334                         <?php
    335                         echo esc_html__(get_the_excerpt( $product->get_id() ) , 'wpcafe');
    336                         // show cart button
    337                         if ($wpc_cart_button == 'on') {
    338                         ?>
    339                             <div class="wpc-add-to-cart">
    340                                 <a href="?add-to-cart<?php echo esc_html( $product->get_id() ) ; ?>" data-product_id="<?php echo esc_html( $product->get_id() ) ; ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
    341                                     <i class="wpcafe-cart_icon"></i>
    342                                 </a>
    343                             </div>
    344                         <?php
    345                         }
    346                         ?>
    347                     </div>
    348389                </div>
    349             </div>
    350390            <?php } ?>
    351391        </div>
    … …  
    360400     *
    361401     */
    362     public function wpc_custom_mini_cart() {
    363         if ( ! class_exists('WooCommerce') ) {
     402    public function wpc_custom_mini_cart()
     403    {
     404        if (!class_exists('WooCommerce')) {
    364405            return;
    365406        }
    366407        $settings       = $this->settings_obj;
    367         if ( isset( $settings['wpcafe_allow_cart'] ) && $settings['wpcafe_allow_cart'] != ''
    368              && $settings['wpcafe_allow_cart'] == 'on' ) {
    369            
     408        if (
     409            isset($settings['wpcafe_allow_cart']) && $settings['wpcafe_allow_cart'] != ''
     410            && $settings['wpcafe_allow_cart'] == 'on'
     411        ) {
     412
    370413            $wpc_cart_icon  = '';
    371414            $wpc_custom_css = '';
    372415
    373416            // icon
    374             if ( isset( $settings['wpc_mini_cart_icon'] ) ) {
     417            if (isset($settings['wpc_mini_cart_icon'])) {
    375418                $wpc_cart_icon = $settings['wpc_mini_cart_icon'] != '' ? $settings['wpc_mini_cart_icon'] : 'wpcafe-cart_icon';
    376419            } else {
    … …  
    379422
    380423            // cart bg color
    381             if ( isset( $settings['wpc_primary_color'] ) ) {
     424            if (isset($settings['wpc_primary_color'])) {
    382425                $bg_color = $settings['wpc_primary_color'] ? $settings['wpc_primary_color'] : "#5D78FF ";
    383                 $wpc_custom_css .= '.wpc_background_color { background-color : ' . esc_attr( $bg_color ) . '}';
     426                $wpc_custom_css .= '.wpc_background_color { background-color : ' . esc_attr($bg_color) . '}';
    384427                //button
    385428                $wpc_custom_css .= '
    … …  
    390433                .wpc-food-menu-item .wpc-add-to-cart a,
    391434                .wpc-btn, .attr-btn-primary, .reservation_form_submit.wpc-btn, .cancell_form_submit.wpc-btn, .wpc-settings-dashboard .button-primary {
    392                      background-color : ' . esc_attr( $bg_color ) . '
     435                     background-color : ' . esc_attr($bg_color) . '
    393436                    }
    394437
    … …  
    398441   
    399442                .wpc-food-tab-wrapper .wpc-nav li a.wpc-active{
    400                     color : ' . esc_attr( $bg_color ) . '
     443                    color : ' . esc_attr($bg_color) . '
    401444                }
    402445                .wpc-food-tab-wrapper .wpc-nav li a.wpc-active{
    403                     border-bottom-color : ' . esc_attr( $bg_color ) . '
     446                    border-bottom-color : ' . esc_attr($bg_color) . '
    404447                }
    405448                .wpc-food-tab-wrapper .wpc-nav li a:after{
    406                     border-color:' . esc_attr( $bg_color ) . ' transparent transparent transparent;
     449                    border-color:' . esc_attr($bg_color) . ' transparent transparent transparent;
    407450                }
    408451                   
    409452                ';
    410453                // icon cross
    411                 $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr( $bg_color ) . '}';
    412                
     454                $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr($bg_color) . '}';
    413455            } else {
    414456                $wpc_custom_css .= '.wpc_background_color { background-color : #d5d5d5 }';
    415457                //button
    416                 $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward { background-color : ' . esc_attr( '#5D78FF' ) . '}';
     458                $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward { background-color : ' . esc_attr('#5D78FF') . '}';
    417459            }
    418460
    419461            // cart icon color
    420             if ( isset( $settings['wpc_secondary_color'] ) ) {
     462            if (isset($settings['wpc_secondary_color'])) {
    421463                $color = $settings['wpc_secondary_color'] ? $settings['wpc_secondary_color'] : "#d5d5d5 ";
    422                
     464
    423465                //button hover
    424466                $wpc_custom_css .= '
    … …  
    430472                 .wpc-settings-dashboard .button-primary:focus,
    431473                #wpc_location_modal .wpc-close {
    432                      background-color : ' . esc_attr( $color ) . '
     474                     background-color : ' . esc_attr($color) . '
    433475                    }
    434476                ';
    435477                // icon cross hover
    436                 $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr( $color ) . '}';
     478                $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr($color) . '}';
    437479                // count
    438                 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( $color ) . '}';
    439 
     480                $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr($color) . '}';
    440481            } else {
    441482                $wpc_custom_css .= 'a.wpc_cart_icon i { color : #000}';
    442483                //button hover
    443                 $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward:hover { background-color : ' . esc_attr( '#5D78FF' ) . '}';
     484                $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward:hover { background-color : ' . esc_attr('#5D78FF') . '}';
    444485                // icon cross hover
    445                 $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button:hover { background-color : ' . esc_attr( $color ) . '}';
     486                $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button:hover { background-color : ' . esc_attr($color) . '}';
    446487                // count
    447                 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( '#fff' ) . '}';
     488                $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr('#fff') . '}';
    448489            }
    449490            // add inline css
    450             wp_register_style( 'wpc-cart-css', false );
    451             wp_enqueue_style( 'wpc-cart-css' );
    452             wp_add_inline_style( 'wpc-cart-css', $wpc_custom_css );
    453             ?>
     491            wp_register_style('wpc-cart-css', false);
     492            wp_enqueue_style('wpc-cart-css');
     493            wp_add_inline_style('wpc-cart-css', $wpc_custom_css);
     494        ?>
    454495            <ul class="wpc_cart_block"><a href="#" class="wpc_cart_icon">
    455             <i class="<?php echo esc_attr( $wpc_cart_icon ); ?>"></i>
    456                 <sup class="basket-item-count" style="display: inline;">
    457                     <span class="cart-items-count count" id="wpc-mini-cart-count">
    458                     </span>
    459                 </sup>
    460             </a>
     496                    <i class="<?php echo esc_attr($wpc_cart_icon); ?>"></i>
     497                    <sup class="basket-item-count" style="display: inline;">
     498                        <span class="cart-items-count count" id="wpc-mini-cart-count">
     499                        </span>
     500                    </sup>
     501                </a>
    461502                <li class="wpc-menu-mini-cart wpc_background_color">
    462                 <div class="widget_shopping_cart_content">
    463                     <?php is_object( WC()->cart ) ? woocommerce_mini_cart() : ''; ?>
    464                 </div>
     503                    <div class="widget_shopping_cart_content">
     504                        <?php is_object(WC()->cart) ? woocommerce_mini_cart() : ''; ?>
     505                    </div>
    465506                </li>
    466507            </ul>
    467             <?php
     508        <?php
    468509        }
    469510    }
    … …  
    474515     * @param [type] $fragments
    475516     */
    476     public function wpc_add_to_cart_count_fragment_refresh( $fragments ) {
     517    public function wpc_add_to_cart_count_fragment_refresh($fragments)
     518    {
    477519        ob_start();
    478520        ?>
    … …  
    480522            <?php echo WC()->cart->get_cart_contents_count(); ?>
    481523        </div>
    482         <?php
     524    <?php
    483525        $fragments['#wpc-mini-cart-count'] = ob_get_clean();
    484526        return $fragments;
    … …  
    490532     * @param [type] $fragments
    491533     */
    492     public function wpc_add_to_cart_content_fragment_refresh( $fragments ) {
     534    public function wpc_add_to_cart_content_fragment_refresh($fragments)
     535    {
    493536        ob_start();
    494         ?>
     537    ?>
    495538        <div class="widget_shopping_cart_content">
    496             <?php is_object( WC()->cart ) ? woocommerce_mini_cart() : 'test'; ?>
     539            <?php is_object(WC()->cart) ? woocommerce_mini_cart() : 'test'; ?>
    497540        </div>
    498         <?php
     541    <?php
    499542        $fragments['div.widget_shopping_cart_content'] = ob_get_clean();
    500543        return $fragments;
    … …  
    505548     *
    506549     */
    507     public function wpc_location_checkout_form() {
     550    public function wpc_location_checkout_form()
     551    {
    508552        $domain   = 'woocommerce';
    509553        $checkout = WC()->checkout;
    510         ?>
     554    ?>
    511555        <div id="wpc_location_field">
    512         <?php
     556            <?php
    513557            // get loctaion
    514             $wpc_loctaion     = get_terms( 'wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0] );
     558            $wpc_loctaion     = get_terms('wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0]);
    515559            $wpc_loctaion_arr = ['' => 'Select a loctaion'];
    516560
    517             foreach ( $wpc_loctaion as $value ) {
     561            foreach ($wpc_loctaion as $value) {
    518562                $wpc_loctaion_arr["$value->slug"] = $value->name;
    519563            }
    520             woocommerce_form_field( 'wpc_location_name', [
     564            woocommerce_form_field('wpc_location_name', [
    521565                'type'        => 'select',
    522566                'class'       => ['wpc-location form-row-wide'],
    523                 'label'       => __( 'Order location', $domain ),
    524                 'placeholder' => __( 'Enter location', $domain ),
     567                'label'       => __('Order location', $domain),
     568                'placeholder' => __('Enter location', $domain),
    525569                'required'      => true,
    526570                'options'     => $wpc_loctaion_arr,
    527             ], $checkout->get_value( 'wpc_location_name' ) );
    528         ?>
     571            ], $checkout->get_value('wpc_location_name'));
     572            ?>
    529573        </div>
    530         <?php
     574    <?php
    531575    }
    532576
    … …  
    535579     *
    536580     */
    537     public function wpc_validate_location() {
    538         if ( sanitize_text_field( isset( $_POST['wpc_location_name'] ) ) && empty( sanitize_text_field( $_POST['wpc_location_name'] ) ) ) {
    539             wc_add_notice( __( 'Please select a location' ), 'error' );
     581    public function wpc_validate_location()
     582    {
     583        if (sanitize_text_field(isset($_POST['wpc_location_name'])) && empty(sanitize_text_field($_POST['wpc_location_name']))) {
     584            wc_add_notice(__('Please select a location'), 'error');
    540585        }
    541586    }
    … …  
    546591     * @param [type] $order
    547592     */
    548     public function wpc_location_update_meta( $order ) {
    549 
    550         if ( sanitize_text_field( isset( $_POST['wpc_location_name'] ) ) && !empty( sanitize_text_field( $_POST['wpc_location_name'] ) ) ) {
    551             $order->update_meta_data( 'wpc_location_name', sanitize_text_field( $_POST['wpc_location_name'] ) );
     593    public function wpc_location_update_meta($order)
     594    {
     595
     596        if (sanitize_text_field(isset($_POST['wpc_location_name'])) && !empty(sanitize_text_field($_POST['wpc_location_name']))) {
     597            $order->update_meta_data('wpc_location_name', sanitize_text_field($_POST['wpc_location_name']));
    552598        }
    553599    }
    … …  
    557603     *
    558604     */
    559     public function wpc_product_cat_taxonomy_add_new_meta_field() {
    560         ?>
     605    public function wpc_product_cat_taxonomy_add_new_meta_field()
     606    {
     607    ?>
    561608        <div class="form-field">
    562             <label for="wpc_menu_order_priority"><?php _e( 'Order menu', 'wpcafe' );?></label>
     609            <label for="wpc_menu_order_priority"><?php _e('Order menu', 'wpcafe'); ?></label>
    563610            <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority">
    564611        </div>
    565         <?php
     612    <?php
    566613    }
    567614
    … …  
    571618     * @param [type] $term
    572619     */
    573     public function wpc_product_cat_taxonomy_edit_meta_field( $term ) {
     620    public function wpc_product_cat_taxonomy_edit_meta_field($term)
     621    {
    574622
    575623        //getting term ID
    576624        $term_id                 = $term->term_id;
    577         $wpc_menu_order_priority = get_term_meta( $term_id, 'wpc_menu_order_priority', true );
    578         ?>
     625        $wpc_menu_order_priority = get_term_meta($term_id, 'wpc_menu_order_priority', true);
     626    ?>
    579627        <tr class="form-field">
    580             <th scope="row" valign="top"><label for="wpc_menu_order_priority"><?php _e( 'Order menu', 'wpcafe' );?></label></th>
     628            <th scope="row" valign="top"><label for="wpc_menu_order_priority"><?php _e('Order menu', 'wpcafe'); ?></label></th>
    581629            <td>
    582                 <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority"
    583                     value="<?php echo esc_attr( $wpc_menu_order_priority ) ? esc_attr( $wpc_menu_order_priority ) : ''; ?>">
     630                <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority" value="<?php echo esc_attr($wpc_menu_order_priority) ? esc_attr($wpc_menu_order_priority) : ''; ?>">
    584631            </td>
    585632        </tr>
    586     <?php
     633<?php
    587634    }
    588635
    … …  
    592639     * @param [type] $term
    593640     */
    594     public function wpc_product_cat_taxonomy_save_meta_field( $term_id ) {
    595         $wpc_menu_order_priority = filter_input( INPUT_POST, 'wpc_menu_order_priority' );
    596         update_term_meta( $term_id, 'wpc_menu_order_priority', $wpc_menu_order_priority );
     641    public function wpc_product_cat_taxonomy_save_meta_field($term_id)
     642    {
     643        $wpc_menu_order_priority = filter_input(INPUT_POST, 'wpc_menu_order_priority');
     644        update_term_meta($term_id, 'wpc_menu_order_priority', $wpc_menu_order_priority);
    597645    }
    598646
    … …  
    602650     * @param mixed $columns
    603651     */
    604     public function wpc_custom_fields_list_title( $columns ) {
    605         $columns['wpc_menu_order_priority'] = __( 'Order menu', 'woocommerce' );
    606         $columns['cat_id']                  = __( 'ID', 'woocommerce' );
     652    public function wpc_custom_fields_list_title($columns)
     653    {
     654        $columns['wpc_menu_order_priority'] = __('Order menu', 'woocommerce');
     655        $columns['cat_id']                  = __('ID', 'woocommerce');
    607656        return $columns;
    608657    }
    … …  
    615664     * @param int $id term ID
    616665     */
    617     public function wpc_custom_fields_list_diplay( $columns, $column, $id ) {
    618 
    619         if ( 'wpc_menu_order_priority' == $column ) {
    620             $columns = esc_html( get_term_meta( $id, 'wpc_menu_order_priority', true ) );
    621         } elseif ( 'cat_id' == $column ) {
    622             $columns = esc_html( $id );
     666    public function wpc_custom_fields_list_diplay($columns, $column, $id)
     667    {
     668
     669        if ('wpc_menu_order_priority' == $column) {
     670            $columns = esc_html(get_term_meta($id, 'wpc_menu_order_priority', true));
     671        } elseif ('cat_id' == $column) {
     672            $columns = esc_html($id);
    623673        }
    624674
  • wp-cafe/tags/1.0.5/plugin.php

    r2341364 r2343218  
    1414final class Plugin{
    1515   
    16     const version = '1.0.4';
     16    const version = '1.0.5';
    1717
    1818    private static $instance;
  • wp-cafe/tags/1.0.5/readme.txt

    r2341364 r2343218  
    11=== WP Cafe ===
    2 Contributors: ataurr, themewinter, rezakhan995, abrasel600, nitu456410
     2Contributors: ataurr, themewinter, abrasel600, rezakhan995, nitu456410
    33Tags: reservation, restaurant menu, food menu, restaurant, food delivery
    44Requires at least: 5.2
    55Tested up to: 5.4
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.5
    77Requires PHP: 5.6
    88License: GPLv2 or later
    … …  
    5050
    5151== Changelog ==
     52
     53= 1.0.5 =
     54
     55* Fix   : Price showing both from including and excluding tax in shortcode and widget
     56* Fix   : Mini cart price showing including and excluding tax
     57* Fix   : Storefront theme header mini cart count update bug
     58* Fix   : Mini-cart opening and closing bug
     59* Tweak : header mini-cart and menu tag css update
    5260
    5361= 1.0.4 =
  • wp-cafe/tags/1.0.5/widgets/wpc-food-menu-tab/style/style-1.php

    r2335589 r2343218  
    8181                                        <div class="<?php echo esc_attr($col); ?>">
    8282                                            <div class="wpc-food-inner-content">
    83                                                 <?php
    84                                                 //only start if we have some tags
    85                                                 if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
    86                                                     //create a list to hold our tags
    87                                                     ?>
     83                                                <!-- product tag and tax -->
     84                                                <?php if ($current_tags || $product->get_price_suffix()) { ?>
    8885                                                    <ul class="wpc-menu-tag">
    89                                                     <?php
    90                                                     //for each tag we create a list item
    91                                                     foreach ($current_tags as $tag) {
    92                                                         $tag_title = $tag->name;
     86                                                        <?php
     87                                                        if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
     88                                                            //for each tag we create a list item
     89                                                            foreach ($current_tags as $tag) {
     90                                                                $tag_title = $tag->name;
    9391                                                        ?>
    94                                                         <li><?php echo esc_html( $tag_title ); ?></li>
    95                                                     <?php } ?>
     92                                                                <li><?php echo esc_html($tag_title); ?></li>
     93                                                        <?php }
     94                                                        } ?>
     95                                                        <!-- product tax -->
     96                                                        <?php if ($product->get_price_suffix() != '') { ?>
     97                                                            <li>
     98                                                                <?php
     99                                                                if (wc_get_price_including_tax($product)) {
     100                                                                    $price      = wc_get_price_including_tax($product);
     101                                                                    // get percentage tax
     102                                                                    echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     103                                                                } else {
     104                                                                    $price = wc_get_price_excluding_tax($product);
     105                                                                }
     106                                                                ?>
     107                                                            </li>
     108                                                        <?php } ?>
    96109                                                    </ul>
    97110                                                <?php } ?>
     111
    98112                                                <h3 class="wpc-post-title wpc-title-with-border">
    99113                                                    <a href="<?php echo esc_url($permalink); ?>" class="<?php echo esc_attr($class); ?>"><?php echo esc_html(get_the_title());  ?> </a>
  • wp-cafe/tags/1.0.5/widgets/wpc-menus-list/style/style-1.php

    r2335589 r2343218  
    6262                <div class="<?php echo esc_attr($col); ?>">
    6363                    <div class="wpc-food-inner-content">
    64                         <?php
    65                         //only start if we have some tags
    66                         if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
    67                             //create a list to hold our tags
    68                             ?>
     64                        <!-- product tag and tax -->
     65                        <?php if ($current_tags || $product->get_price_suffix()) { ?>
     66
    6967                            <ul class="wpc-menu-tag">
    70                             <?php
    71                             //for each tag we create a list item
    72                             foreach ($current_tags as $tag) {
    73                                 $tag_title = $tag->name;
     68                                <?php
     69                                //only start if we have some tags
     70                                if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
     71                                    //for each tag we create a list item
     72                                    foreach ($current_tags as $tag) {
     73                                        $tag_title = $tag->name;
    7474                                ?>
    75                                 <li><?php echo esc_html( $tag_title ); ?></li>
    76                             <?php } ?>
     75                                        <li><?php echo esc_html($tag_title); ?></li>
     76                                <?php }
     77                                } ?>
     78                                <!-- product tax -->
     79                                <?php if ($product->get_price_suffix() != '') {  ?>
     80                                    <li>
     81                                        <?php
     82                                        if (wc_get_price_including_tax($product)) {
     83                                            $price      = wc_get_price_including_tax($product);
     84                                            // get percentage tax
     85                                            echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     86                                        } else {
     87                                            $price = wc_get_price_excluding_tax($product);
     88                                        }
     89                                        ?>
     90                                    </li>
     91                                <?php } ?>
    7792                            </ul>
    7893                        <?php } ?>
     94
    7995                        <h3 class="wpc-post-title wpc-title-with-border">
    8096                            <a href="<?php echo esc_url($permalink); ?>" class="<?php echo esc_attr($class); ?>"><?php echo esc_html(get_the_title());  ?> </a>
  • wp-cafe/tags/1.0.5/wpcafe.php

    r2341581 r2343218  
    88 * Plugin Name:        WP Cafe
    99 * Plugin URI:         https://product.themewinter.com/wpcafe
    10  * Description:        All in One WordPress Restaurant solution plugin
    11  * Version:            1.0.4
     10 * Description:        WordPress Restaurant solution plugin to launch Restaurant Websites.
     11 * Version:            1.0.5
    1212 * Author:             Themewinter
    1313 * Author URI:         http://themewinter.com/
  • wp-cafe/trunk/assets/css/wpc-public.css

    r2335589 r2343218  
    45744574.wpc-food-menu-item .wpc-menu-tag {
    45754575  padding: 0;
     4576  margin: 0;
    45764577}
    45774578.wpc-food-menu-item .wpc-menu-tag li {
    … …  
    45904591  -ms-border-radius: 36px;
    45914592}
     4593.wpc-food-menu-item .wpc-menu-tag-wrap .wpc-menu-tag {
     4594  display: inline-block;
     4595}
    45924596.wpc-food-menu-item .wpc-food-inner-content {
    45934597  position: relative;
    … …  
    46604664  text-align: center;
    46614665  color: #fff;
     4666  padding: 0;
    46624667}
    46634668.wpc-food-menu-item .wpc-add-to-cart a i {
    … …  
    50785083  -ms-transition: all 0.4s ease;
    50795084  transform: translateY(-50%);
     5085  padding-left: 40px;
    50805086}
    50815087.wpc_cart_block.cart_icon_active {
  • wp-cafe/trunk/assets/js/wpc-public.js

    r2335589 r2343218  
    678678                    },
    679679                    success: function (results) {
     680                        $( document.body ).trigger( 'wc_fragment_refresh' );
    680681                        $('#wpc-mini-cart-count').html("");
    681682                        $('#wpc-mini-cart-count').html(results.data.wpc_count);
  • wp-cafe/trunk/assets/scss/wpc-public.scss

    r2335589 r2343218  
    3838    .wpc-menu-tag {
    3939        padding: 0;
    40 
     40        margin: 0;
    4141        li {
    4242            font-size     : 11px;
    … …  
    5353        }
    5454    }
     55    .wpc-menu-tag-wrap{
     56        .wpc-menu-tag{
     57            display: inline-block;
     58        }
     59    }
    5560
    5661    .wpc-food-inner-content {
    … …  
    130135            text-align      : center;
    131136            color           : #fff;
     137            padding: 0;
    132138
    133139            i {
    … …  
    659665    @include transition();
    660666    @include transform(translateY(-50%));
    661 
     667    padding-left: 40px;
    662668    &.cart_icon_active {
    663669        right: 0;
  • wp-cafe/trunk/core/action/wpc-ajax-action.php

    r2335589 r2343218  
    225225            $response = [ 'status_code' => 500 , 'message' => ['somthing is wrong'] , 'data' => [] ];
    226226            wp_send_json_error( $response );
    227             wp_die();
    228         }
    229 
     227        }
    230228        if ( "wpc_add_car_single_page" == sanitize_text_field( $_POST['wpc_action'] ) ) {
    231229            $post_arr     = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING );
    … …  
    246244
    247245            }
    248 
     246           
     247            // mini cart content
    249248            $wpc_cart_content = '';
    250249            $items            = WC()->cart->get_cart();
    … …  
    265264
    266265                $currency     = get_woocommerce_currency_symbol();
    267                 $price        = get_post_meta( $product_id, '_regular_price', true );
    268                 $sale         = get_post_meta( $product_id, '_sale_price', true );
     266
    269267                $_woo_product = wc_get_product( $product_id );
     268
    270269                $price_div    = '';
    271                 if ( $sale ) {
    272                     $price_div .= '× ' . $currency . ' ' . $sale;
    273                 } elseif ( $price ) {
    274                     $price_div .= ' × ' . $currency . ' ' . $price;
     270                if ( wc_get_price_including_tax( $_woo_product ) ) {
     271                    $price_div .= '× ' . $currency . ' ' . wc_get_price_including_tax( $_woo_product );
     272                }
     273                else {
     274                    $price_div .= ' × ' . $currency . ' ' . wc_get_price_excluding_tax( $_woo_product );
    275275                }
    276276
    … …  
    314314                'wpc_count' => $item_count, 'wpc_cart_content' => $wpc_cart_content] );
    315315        }
    316 
    317316        die();
    318317    }
    319 
    320318}
  • wp-cafe/trunk/core/widgets/hook.php

    r2335589 r2343218  
    11<?php
     2
    23namespace WpCafe\Core\Widgets;
    34
    4 defined( "ABSPATH" ) || exit;
     5defined("ABSPATH") || exit;
    56
    67use WpCafe\Utils\Wpc_Utilities as Utils;
    … …  
    1112 * create post type class
    1213 */
    13 class Hook {
     14class Hook
     15{
    1416
    1517    use Wpc_Singleton;
    16    
     18
    1719    private $settings_obj = null;
    1820    public $wpc_message   = '';
    … …  
    2123     * call hooks
    2224     */
    23     public function init() {
    24         $settings = $this->settings_obj=  \WpCafe\Core\Base\Wpc_Settings_Field::instance()->get_settings_option();
     25    public function init()
     26    {
     27        $settings = $this->settings_obj =  \WpCafe\Core\Base\Wpc_Settings_Field::instance()->get_settings_option();
    2528
    2629        // add shortcode
    27         add_shortcode( 'wpc_food_menu_tab',[$this, 'wpc_food_menu_tab'] );
    28         add_shortcode( 'wpc_food_menu_list',[$this, 'wpc_food_menu_list'] );
    29         add_shortcode( 'wpc_reservation_form',[$this, 'wpc_booking_form_shortcode'] );
     30        add_shortcode('wpc_food_menu_tab', [$this, 'wpc_food_menu_tab']);
     31        add_shortcode('wpc_food_menu_list', [$this, 'wpc_food_menu_list']);
     32        add_shortcode('wpc_reservation_form', [$this, 'wpc_booking_form_shortcode']);
    3033        // add minicart to header
    31         add_action( 'wp_head',[$this, 'wpc_custom_mini_cart'] );
     34        add_action('wp_head', [$this, 'wpc_custom_mini_cart']);
    3235
    3336        // add new field in checkout page
    34         if ( isset( $settings['wpcafe_food_location'] ) && $settings['wpcafe_food_location'] == 'on' && class_exists( 'WooCommerce' ) ) {
    35             add_action( 'woocommerce_checkout_before_customer_details', [$this, 'wpc_location_checkout_form'] );
    36             add_action( 'woocommerce_checkout_process', [$this, 'wpc_validate_location'] );
    37             add_action( 'woocommerce_checkout_create_order', [$this, 'wpc_location_update_meta'], 10, 2 );
     37        if (isset($settings['wpcafe_food_location']) && $settings['wpcafe_food_location'] == 'on' && class_exists('WooCommerce')) {
     38            add_action('woocommerce_checkout_before_customer_details', [$this, 'wpc_location_checkout_form']);
     39            add_action('woocommerce_checkout_process', [$this, 'wpc_validate_location']);
     40            add_action('woocommerce_checkout_create_order', [$this, 'wpc_location_update_meta'], 10, 2);
    3841        }
    3942        // menu order action
    40         add_action( 'product_cat_add_form_fields', [$this, 'wpc_product_cat_taxonomy_add_new_meta_field'], 10, 1 );
    41         add_action( 'product_cat_edit_form_fields', [$this, 'wpc_product_cat_taxonomy_edit_meta_field'], 10, 1 );
    42         add_action( 'edited_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1 );
    43         add_action( 'create_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1 );
     43        add_action('product_cat_add_form_fields', [$this, 'wpc_product_cat_taxonomy_add_new_meta_field'], 10, 1);
     44        add_action('product_cat_edit_form_fields', [$this, 'wpc_product_cat_taxonomy_edit_meta_field'], 10, 1);
     45        add_action('edited_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1);
     46        add_action('create_product_cat', [$this, 'wpc_product_cat_taxonomy_save_meta_field'], 10, 1);
    4447        //Displaying Additional Columns
    45         add_filter( 'manage_edit-product_cat_columns', [$this, 'wpc_custom_fields_list_title' ] );
    46         add_action( 'manage_product_cat_custom_column', [$this, 'wpc_custom_fields_list_diplay' ], 10, 3 );
     48        add_filter('manage_edit-product_cat_columns', [$this, 'wpc_custom_fields_list_title']);
     49        add_action('manage_product_cat_custom_column', [$this, 'wpc_custom_fields_list_diplay'], 10, 3);
    4750        // update cart counter
    48         add_filter( 'woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_count_fragment_refresh'], 30, 1 );
    49         add_filter( 'woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_content_fragment_refresh']);
    50 
     51        add_filter('woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_count_fragment_refresh'], 30, 1);
     52        add_filter('woocommerce_add_to_cart_fragments', [$this, 'wpc_add_to_cart_content_fragment_refresh']);
    5153    }
    5254
    … …  
    5557     * Print the reservation form's HTML code.
    5658     */
    57     public function wpc_booking_form_shortcode($atts) {
     59    public function wpc_booking_form_shortcode($atts)
     60    {
    5861        ob_start();
    5962        $settings = $this->settings_obj;
    6063        include_once 'reservation-form-template.php';
    61         if ( isset( $settings['wpc_allow_cancellation'] ) ) {
     64        if (isset($settings['wpc_allow_cancellation'])) {
    6265            include_once 'cancellation-form-template.php';
    6366        }
    … …  
    7174     * @param [type] $id
    7275     */
    73     public function wpc_tag($id) {
    74         ?>
    75         <div class="wpc-menu-tag-wrap">
     76    public function wpc_tag($id)
     77    {
     78?>
    7679        <?php
    7780        $current_tags = get_the_terms($id, 'product_tag');
    … …  
    8083        if ($current_tags && !is_wp_error($current_tags)) {
    8184            //create a list to hold our tags
    82             ?>
     85        ?>
    8386            <ul class="wpc-menu-tag">
    84             <?php
    85 
    86             //for each tag we create a list item
    87             foreach ($current_tags as $tag) {
    88                 $tag_title = $tag->name;
     87                <?php
     88
     89                //for each tag we create a list item
     90                foreach ($current_tags as $tag) {
     91                    $tag_title = $tag->name;
    8992                ?>
    90                 <li><?php echo esc_html( $tag_title ); ?></li>
     93                    <li><?php echo esc_html($tag_title); ?></li>
    9194                <?php
    92             }
    93             ?>
     95                }
     96                ?>
    9497            </ul>
    95         <?php } ?>
    96         </div>
    97         <?php
     98        <?php }
    9899    }
    99100
    … …  
    102103     *
    103104     */
    104     public function wpc_location() {
     105    public function wpc_location()
     106    {
    105107        // show location
    106108        $settings = $this->settings_obj;
    107109        if (isset($settings['wpcafe_food_location']) && $settings['wpcafe_food_location'] == 'on') {
    108             ?>
     110        ?>
    109111            <div id="wpc_location_modal" class="wpc_modal">
    110112                <!-- Modal content -->
    111113                <div class="modal-content">
    112114                    <select name="wpc-location" class="wpc-location">
    113                         <option value=""><?php echo esc_html('Select a location', 'wpcafe')?></option>
    114                     <?php
    115                     // get wpcafe locations
    116                     $wpc_loctaion = get_terms('wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0]);
    117                     if (count($wpc_loctaion) > 0) {
    118                         foreach ($wpc_loctaion as $value) {
     115                        <option value=""><?php echo esc_html('Select a location', 'wpcafe') ?></option>
     116                        <?php
     117                        // get wpcafe locations
     118                        $wpc_loctaion = get_terms('wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0]);
     119                        if (count($wpc_loctaion) > 0) {
     120                            foreach ($wpc_loctaion as $value) {
    119121                        ?>
    120                             <option value="<?php echo esc_html( $value->slug ); ?>"><?php echo esc_html__( $value->name , 'wpcafe')?></option>
     122                                <option value="<?php echo esc_html($value->slug); ?>"><?php echo esc_html__($value->name, 'wpcafe') ?></option>
     123                            <?php
     124                            }
     125                        } else {
     126                            ?>
     127                            <option value=""><?php echo esc_html__('No location set', 'wpcafe') ?></option>
    121128                        <?php
    122129                        }
    123                     }
    124                     else {
    125130                        ?>
    126                         <option value=""><?php echo esc_html__('No location set', 'wpcafe')?></option>
    127                         <?php
    128                     }
    129                     ?>
    130131                    </select>
    131                     <button class="wpc-select-location wpc-btn wpc-btn-primary" >Ok</button>
    132                     <button class="wpc-close wpc-btn" > <i class="dashicons dashicons-no-alt"></i> </button>
     132                    <button class="wpc-select-location wpc-btn wpc-btn-primary">Ok</button>
     133                    <button class="wpc-close wpc-btn"> <i class="dashicons dashicons-no-alt"></i> </button>
    133134                </div>
    134135            </div>
    135             <?php
     136        <?php
    136137        }
    137138    }
    … …  
    143144     * @param $content
    144145     */
    145     public function wpc_food_menu_tab( $atts, $content ) {
    146         if ( ! class_exists( 'Woocommerce' )) {
    147             return ;
     146    public function wpc_food_menu_tab($atts, $content)
     147    {
     148        if (!class_exists('Woocommerce')) {
     149            return;
    148150        }
    149151        ob_start();
    … …  
    152154            $this->wpc_location();
    153155        }
    154         $atts = extract( shortcode_atts(
    155             ['wpc_food_catgeries' => '21', 'no_of_product' => 5, 'product_thumnail' => "on"
    156             ,'wpc_cart_button' => 'on' ]
    157             , $atts ) );
    158        
    159         $wpc_cat_arr      = explode( ',', $wpc_food_catgeries );
     156        $atts = extract(shortcode_atts(
     157            [
     158                'wpc_food_catgeries' => '21', 'no_of_product' => 5, 'product_thumnail' => "on", 'wpc_cart_button' => 'on'
     159            ],
     160            $atts
     161        ));
     162
     163        $wpc_cat_arr      = explode(',', $wpc_food_catgeries);
    160164        $wpc_cat_sort_arr = [];
    161165        $i                = 0;
    162166
    163         foreach ( $wpc_cat_arr as $value ) {
     167        foreach ($wpc_cat_arr as $value) {
    164168            $i++;
    165169
    166             if ( $wpc_cat = get_term_by( 'id', $value, 'product_cat' ) ) {
    167                 $wpc_get_menu_order = get_term_meta( $wpc_cat->term_id, 'wpc_menu_order_priority', true );
    168                 if ( $wpc_get_menu_order == '' ) {
     170            if ($wpc_cat = get_term_by('id', $value, 'product_cat')) {
     171                $wpc_get_menu_order = get_term_meta($wpc_cat->term_id, 'wpc_menu_order_priority', true);
     172                if ($wpc_get_menu_order == '') {
    169173                    $wpc_cat_sort_arr[$i] = $value;
    170174                } else {
    … …  
    172176                }
    173177            }
    174 
    175         }
    176         ksort( $wpc_cat_sort_arr );
     178        }
     179        ksort($wpc_cat_sort_arr);
    177180        $current = '';
    178181        ?>
    … …  
    180183            <ul class="wpc-nav">
    181184                <?php
    182                     foreach ( $wpc_cat_sort_arr as $key => $value ) {
    183                         if ( $wpc_cat = get_term_by( 'id', $value, 'product_cat' ) ) {
    184                             $current      = $wpc_cat->name;
    185                             $active_class = (  ( $key == array_keys($wpc_cat_sort_arr)[0] ) ? 'wpc-active' : ' ' );
    186                             ?>
    187                             <li>
    188                                 <a href="#"
    189                                     data-id="tab_<?php echo Utils::wpc_render( Utils::wpc_cat_name_lower( $current ) ); ?>"
    190                                     class="wpc-tab-a <?php echo esc_attr($active_class); ?>"
    191                                     data-toggle="tab" aria-expanded="true">
    192                                     <span><?php echo esc_attr_e( $wpc_cat->name, 'wpcafe' ); ?></span>
    193                                 </a>
    194                             </li>
    195                             <?php
    196                         }
     185                foreach ($wpc_cat_sort_arr as $key => $value) {
     186                    if ($wpc_cat = get_term_by('id', $value, 'product_cat')) {
     187                        $current      = $wpc_cat->name;
     188                        $active_class = (($key == array_keys($wpc_cat_sort_arr)[0]) ? 'wpc-active' : ' ');
     189                ?>
     190                        <li>
     191                            <a href="#" data-id="tab_<?php echo Utils::wpc_render(Utils::wpc_cat_name_lower($current)); ?>" class="wpc-tab-a <?php echo esc_attr($active_class); ?>" data-toggle="tab" aria-expanded="true">
     192                                <span><?php echo esc_attr_e($wpc_cat->name, 'wpcafe'); ?></span>
     193                            </a>
     194                        </li>
     195                <?php
    197196                    }
     197                }
    198198                ?>
    199199            </ul>
    200200            <div class='wpc-tab-content'>
    201201                <?php
    202                     foreach ( $wpc_cat_sort_arr as $current_key => $value ) {
    203                         $wpc_cat = get_term_by( 'id', $value, 'product_cat' );
    204                         $args    = [
    205                             'post_type'      => 'product',
    206                             'posts_per_page' => $no_of_product,
    207                             'product_cat'    => $wpc_cat->name,
    208                         ];
    209                         $active_class = (  ( $current_key == array_keys($wpc_cat_sort_arr)[0] ) ? 'tab-active' : ' ' );
    210                         $wpc_cat_id   = Utils::wpc_cat_name_lower( $wpc_cat->name );
    211                         $products = wc_get_products($args);
    212                         ?>
    213                         <div class='wpc-tab <?php echo esc_attr($active_class); ?>' data-id='tab_<?php echo esc_attr( $wpc_cat_id ); ?>'>
    214                             <div class='wpc-row'>
    215                                 <?php foreach ($products as $product) { ?>
    216                                     <div class='wpc-col-lg-6'>
    217                                         <div class='wpc-food-menu-item wpc-row'>
    218                                             <?php
    219                                             // show tag
    220                                             if ( $product_thumnail == "on" ) {
     202                foreach ($wpc_cat_sort_arr as $current_key => $value) {
     203                    $wpc_cat = get_term_by('id', $value, 'product_cat');
     204                    $args    = [
     205                        'post_type'      => 'product',
     206                        'posts_per_page' => $no_of_product,
     207                        'product_cat'    => $wpc_cat->name,
     208                    ];
     209                    $active_class = (($current_key == array_keys($wpc_cat_sort_arr)[0]) ? 'tab-active' : ' ');
     210                    $wpc_cat_id   = Utils::wpc_cat_name_lower($wpc_cat->name);
     211                    $products = wc_get_products($args);
     212                ?>
     213                    <div class='wpc-tab <?php echo esc_attr($active_class); ?>' data-id='tab_<?php echo esc_attr($wpc_cat_id); ?>'>
     214                        <div class='wpc-row'>
     215                            <?php foreach ($products as $product) { ?>
     216                                <div class='wpc-col-lg-6'>
     217                                    <div class='wpc-food-menu-item wpc-row'>
     218                                        <?php
     219                                        // show tag
     220                                        if ($product_thumnail == "on") {
     221                                        ?>
     222                                            <div class="wpc-col-md-3">
     223                                                <div class="wpc-food-menu-thumb">
     224                                                    <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>">
     225                                                        <?php echo Wpc_Utilities::wpc_kses($product->get_image()); ?>
     226                                                    </a>
     227                                                </div>
     228                                            </div>
     229                                        <?php } ?>
     230                                        <div class="wpc-col-md-9">
     231                                            <div class="wpc-food-inner-content">
     232                                                <div class="wpc-menu-tag-wrap">
     233                                                    <?php
     234                                                    $this->wpc_tag($product->get_id());
     235                                                    $price = '';
     236                                                    if (wc_get_price_including_tax($product)) {
     237                                                        $price      = wc_get_price_including_tax($product);
     238                                                    } else {
     239                                                        $price = wc_get_price_excluding_tax($product);
     240                                                    }
     241                                                    ?>
     242                                                    <?php if ($product->get_price_suffix() != '') { ?>
     243                                                        <ul class="wpc-menu-tag">
     244                                                            <li>
     245                                                                <?php if (wc_get_price_including_tax($product)) {
     246                                                                    // get percentage tax
     247                                                                    echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     248                                                                } ?>
     249                                                            </li>
     250                                                        </ul>
     251                                                    <?php } ?>
     252                                                </div>
     253                                                <h3 class="wpc-post-title">
     254                                                    <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>"><?php echo esc_html($product->get_name());  ?> </a>
     255                                                    <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?>
     256                                                        <span class="wpc-menu-price"><?php echo esc_html($price); ?></span></span>
     257                                                </h3>
     258                                                <?php echo Wpc_Utilities::wpc_kses(esc_html__(get_the_excerpt($product->get_id(), 'wpcafe')));
     259                                                // show cart button
     260                                                if ($wpc_cart_button == 'on') {
    221261                                                ?>
    222                                                     <div class="wpc-col-md-3">
    223                                                         <div class="wpc-food-menu-thumb">
    224                                                             <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>">
    225                                                             <?php echo Wpc_Utilities::wpc_kses( $product->get_image() ); ?>
    226                                                             </a>
    227                                                         </div>
     262                                                    <div class="wpc-add-to-cart">
     263                                                        <a href="?add-to-cart<?php echo Wpc_Utilities::wpc_numeric($product->get_id()); ?>" data-product_id="<?php echo Wpc_Utilities::wpc_numeric($product->get_id()); ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
     264                                                            <i class="wpcafe-cart_icon"></i>
     265                                                        </a>
    228266                                                    </div>
    229                                             <?php } ?>
    230                                             <div class="wpc-col-md-9">
    231                                                 <div class="wpc-food-inner-content">
    232                                                     <!-- display tag -->
    233                                                     <?php $this->wpc_tag( $product->get_id() ); ?>     
    234                                                     <h3 class="wpc-post-title">
    235                                                         <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>"><?php echo esc_html( $product->get_name() );  ?> </a>
    236                                                         <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?>
    237                                                         <span class="wpc-menu-price"><?php echo esc_html( $product->get_price() ); ?></span></span>
    238                                                     </h3>
    239                                                     <?php echo esc_html__(get_the_excerpt( $product->get_id() ) , 'wpcafe'); ?>
    240                                                     <?php
    241                                                         // show cart button
    242                                                         if ($wpc_cart_button == 'on') {
    243                                                             ?>
    244                                                             <div class="wpc-add-to-cart">
    245                                                                 <a href="?add-to-cart<?php echo Wpc_Utilities::wpc_numeric( $product->get_id() ); ?>" data-product_id="<?php echo Wpc_Utilities::wpc_numeric( $product->get_id() ); ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
    246                                                                     <i class="wpcafe-cart_icon"></i>
    247                                                                 </a>
    248                                                             </div>
    249                                                             <?php
    250                                                         }
    251                                                     ?>
    252                                                     </div>
     267                                                <?php
     268                                                }
     269                                                ?>
    253270                                            </div>
    254271                                        </div>
    255272                                    </div>
    256                                 <?php } ?>
    257                             </div>
     273                                </div>
     274                            <?php } ?>
    258275                        </div>
    259                         <?php
    260                     }
     276                    </div>
     277                <?php
     278                }
    261279                ?>
    262280            </div>
    263281        </div>
    264         <?php
     282    <?php
    265283        $contents = ob_get_clean();
    266284        return $contents;
    … …  
    272290     * @param Type $var
    273291     */
    274     public function wpc_food_menu_list($atts,$content) {
    275         if ( ! class_exists( 'Woocommerce' )) {
    276             return ;
     292    public function wpc_food_menu_list($atts, $content)
     293    {
     294        if (!class_exists('Woocommerce')) {
     295            return;
    277296        }
    278297        ob_start();
    … …  
    282301        }
    283302
    284         $atts = extract( shortcode_atts(
    285             ['wpc_food_catgeries' => '21', 'no_of_product' => 5, 'wpc_cart_button'=> 'on']
    286             , $atts ) );
     303        $atts = extract(shortcode_atts(
     304            ['wpc_food_catgeries' => '21', 'no_of_product' => 5, 'wpc_cart_button' => 'on'],
     305            $atts
     306        ));
    287307
    288308        // category sorting from backend
    289         $wpc_cat_arr      = explode( ',', $wpc_food_catgeries );
     309        $wpc_cat_arr      = explode(',', $wpc_food_catgeries);
    290310
    291311        $args = array(
    … …  
    296316            'post_status'      => 'publish',
    297317            'suppress_filters' => false,
    298        
     318
    299319        );
    300         if (is_array( $wpc_cat_arr ) && count( $wpc_cat_arr )>0) {
     320        if (is_array($wpc_cat_arr) && count($wpc_cat_arr) > 0) {
    301321            $args['tax_query'] = array(
    302322                array(
    … …  
    310330        };
    311331        $products = wc_get_products($args);
    312         ?>
     332    ?>
    313333        <div class='wpc-food-wrapper'>
    314334            <?php foreach ($products as $product) { ?>
    315             <div class="wpc-food-menu-item wpc-row">
    316                 <!-- thumbnail -->
    317                 <?php if ( $product->get_image() ) { ?>
    318                     <div class="wpc-col-md-3">
    319                         <div class="wpc-food-menu-thumb">
    320                             <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>">
    321                                 <?php echo Wpc_Utilities::wpc_kses( $product->get_image() ); ?>
    322                             </a>
     335                <div class="wpc-food-menu-item wpc-row">
     336                    <!-- thumbnail -->
     337                    <?php if ($product->get_image()) { ?>
     338                        <div class="wpc-col-md-3">
     339                            <div class="wpc-food-menu-thumb">
     340                                <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>">
     341                                    <?php echo Wpc_Utilities::wpc_kses($product->get_image()); ?>
     342                                </a>
     343                            </div>
     344                        </div>
     345                    <?php } ?>
     346                    <div class="wpc-col-md-9">
     347                        <div class="wpc-food-inner-content">
     348                            <!-- display tag -->
     349                            <div class="wpc-menu-tag-wrap">
     350                                <?php
     351                                $this->wpc_tag($product->get_id());
     352                                $price = '';
     353                                if (wc_get_price_including_tax($product)) {
     354                                    $price      = wc_get_price_including_tax($product);
     355                                } else {
     356                                    $price = wc_get_price_excluding_tax($product);
     357                                }
     358                                ?>
     359                                <?php if ($product->get_price_suffix() != '') { ?>
     360                                    <ul class="wpc-menu-tag">
     361                                        <li>
     362                                            <?php if (wc_get_price_including_tax($product)) {
     363                                                // get percentage tax
     364                                                echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     365                                            } ?>
     366                                        </li>
     367                                    </ul>
     368                                <?php } ?>
     369                            </div>
     370                            <h3 class="wpc-post-title">
     371                                <a href="<?php echo esc_url(get_permalink($product->get_id())); ?>"><?php echo esc_html($product->get_name());  ?> </a>
     372                                <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?> <span class="wpc-menu-price"><?php echo esc_html($price); ?></span></span>
     373                            </h3>
     374                            <?php
     375                            echo esc_html__(get_the_excerpt($product->get_id()), 'wpcafe');
     376                            // show cart button
     377                            if ($wpc_cart_button == 'on') {
     378                            ?>
     379                                <div class="wpc-add-to-cart">
     380                                    <a href="?add-to-cart<?php echo esc_html($product->get_id()); ?>" data-product_id="<?php echo esc_html($product->get_id()); ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
     381                                        <i class="wpcafe-cart_icon"></i>
     382                                    </a>
     383                                </div>
     384                            <?php
     385                            }
     386                            ?>
    323387                        </div>
    324388                    </div>
    325                 <?php } ?>
    326                 <div class="wpc-col-md-9">
    327                     <div class="wpc-food-inner-content">
    328                         <!-- display tag -->
    329                         <?php $this->wpc_tag( $product->get_id() ); ?>
    330                         <h3 class="wpc-post-title">
    331                             <a href="<?php echo esc_url( get_permalink( $product->get_id() ) ); ?>"><?php echo esc_html( $product->get_name() );  ?> </a>
    332                             <span class="wpc-menu-currency"><?php echo get_woocommerce_currency_symbol(); ?> <span class="wpc-menu-price"><?php echo esc_html( $product->get_price() ); ?></span></span>
    333                         </h3>
    334                         <?php
    335                         echo esc_html__(get_the_excerpt( $product->get_id() ) , 'wpcafe');
    336                         // show cart button
    337                         if ($wpc_cart_button == 'on') {
    338                         ?>
    339                             <div class="wpc-add-to-cart">
    340                                 <a href="?add-to-cart<?php echo esc_html( $product->get_id() ) ; ?>" data-product_id="<?php echo esc_html( $product->get_id() ) ; ?>" rel="nofollow" class="button product_type_simple add_to_cart_button ajax_add_to_cart">
    341                                     <i class="wpcafe-cart_icon"></i>
    342                                 </a>
    343                             </div>
    344                         <?php
    345                         }
    346                         ?>
    347                     </div>
    348389                </div>
    349             </div>
    350390            <?php } ?>
    351391        </div>
    … …  
    360400     *
    361401     */
    362     public function wpc_custom_mini_cart() {
    363         if ( ! class_exists('WooCommerce') ) {
     402    public function wpc_custom_mini_cart()
     403    {
     404        if (!class_exists('WooCommerce')) {
    364405            return;
    365406        }
    366407        $settings       = $this->settings_obj;
    367         if ( isset( $settings['wpcafe_allow_cart'] ) && $settings['wpcafe_allow_cart'] != ''
    368              && $settings['wpcafe_allow_cart'] == 'on' ) {
    369            
     408        if (
     409            isset($settings['wpcafe_allow_cart']) && $settings['wpcafe_allow_cart'] != ''
     410            && $settings['wpcafe_allow_cart'] == 'on'
     411        ) {
     412
    370413            $wpc_cart_icon  = '';
    371414            $wpc_custom_css = '';
    372415
    373416            // icon
    374             if ( isset( $settings['wpc_mini_cart_icon'] ) ) {
     417            if (isset($settings['wpc_mini_cart_icon'])) {
    375418                $wpc_cart_icon = $settings['wpc_mini_cart_icon'] != '' ? $settings['wpc_mini_cart_icon'] : 'wpcafe-cart_icon';
    376419            } else {
    … …  
    379422
    380423            // cart bg color
    381             if ( isset( $settings['wpc_primary_color'] ) ) {
     424            if (isset($settings['wpc_primary_color'])) {
    382425                $bg_color = $settings['wpc_primary_color'] ? $settings['wpc_primary_color'] : "#5D78FF ";
    383                 $wpc_custom_css .= '.wpc_background_color { background-color : ' . esc_attr( $bg_color ) . '}';
     426                $wpc_custom_css .= '.wpc_background_color { background-color : ' . esc_attr($bg_color) . '}';
    384427                //button
    385428                $wpc_custom_css .= '
    … …  
    390433                .wpc-food-menu-item .wpc-add-to-cart a,
    391434                .wpc-btn, .attr-btn-primary, .reservation_form_submit.wpc-btn, .cancell_form_submit.wpc-btn, .wpc-settings-dashboard .button-primary {
    392                      background-color : ' . esc_attr( $bg_color ) . '
     435                     background-color : ' . esc_attr($bg_color) . '
    393436                    }
    394437
    … …  
    398441   
    399442                .wpc-food-tab-wrapper .wpc-nav li a.wpc-active{
    400                     color : ' . esc_attr( $bg_color ) . '
     443                    color : ' . esc_attr($bg_color) . '
    401444                }
    402445                .wpc-food-tab-wrapper .wpc-nav li a.wpc-active{
    403                     border-bottom-color : ' . esc_attr( $bg_color ) . '
     446                    border-bottom-color : ' . esc_attr($bg_color) . '
    404447                }
    405448                .wpc-food-tab-wrapper .wpc-nav li a:after{
    406                     border-color:' . esc_attr( $bg_color ) . ' transparent transparent transparent;
     449                    border-color:' . esc_attr($bg_color) . ' transparent transparent transparent;
    407450                }
    408451                   
    409452                ';
    410453                // icon cross
    411                 $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr( $bg_color ) . '}';
    412                
     454                $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr($bg_color) . '}';
    413455            } else {
    414456                $wpc_custom_css .= '.wpc_background_color { background-color : #d5d5d5 }';
    415457                //button
    416                 $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward { background-color : ' . esc_attr( '#5D78FF' ) . '}';
     458                $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward { background-color : ' . esc_attr('#5D78FF') . '}';
    417459            }
    418460
    419461            // cart icon color
    420             if ( isset( $settings['wpc_secondary_color'] ) ) {
     462            if (isset($settings['wpc_secondary_color'])) {
    421463                $color = $settings['wpc_secondary_color'] ? $settings['wpc_secondary_color'] : "#d5d5d5 ";
    422                
     464
    423465                //button hover
    424466                $wpc_custom_css .= '
    … …  
    430472                 .wpc-settings-dashboard .button-primary:focus,
    431473                #wpc_location_modal .wpc-close {
    432                      background-color : ' . esc_attr( $color ) . '
     474                     background-color : ' . esc_attr($color) . '
    433475                    }
    434476                ';
    435477                // icon cross hover
    436                 $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr( $color ) . '}';
     478                $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button { background-color : ' . esc_attr($color) . '}';
    437479                // count
    438                 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( $color ) . '}';
    439 
     480                $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr($color) . '}';
    440481            } else {
    441482                $wpc_custom_css .= 'a.wpc_cart_icon i { color : #000}';
    442483                //button hover
    443                 $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward:hover { background-color : ' . esc_attr( '#5D78FF' ) . '}';
     484                $wpc_custom_css .= '.wpc_cart_block .wpc_background_color a.button.wc-forward:hover { background-color : ' . esc_attr('#5D78FF') . '}';
    444485                // icon cross hover
    445                 $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button:hover { background-color : ' . esc_attr( $color ) . '}';
     486                $wpc_custom_css .= '.wpc_cart_block .woocommerce-mini-cart li .remove.remove_from_cart_button:hover { background-color : ' . esc_attr($color) . '}';
    446487                // count
    447                 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( '#fff' ) . '}';
     488                $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr('#fff') . '}';
    448489            }
    449490            // add inline css
    450             wp_register_style( 'wpc-cart-css', false );
    451             wp_enqueue_style( 'wpc-cart-css' );
    452             wp_add_inline_style( 'wpc-cart-css', $wpc_custom_css );
    453             ?>
     491            wp_register_style('wpc-cart-css', false);
     492            wp_enqueue_style('wpc-cart-css');
     493            wp_add_inline_style('wpc-cart-css', $wpc_custom_css);
     494        ?>
    454495            <ul class="wpc_cart_block"><a href="#" class="wpc_cart_icon">
    455             <i class="<?php echo esc_attr( $wpc_cart_icon ); ?>"></i>
    456                 <sup class="basket-item-count" style="display: inline;">
    457                     <span class="cart-items-count count" id="wpc-mini-cart-count">
    458                     </span>
    459                 </sup>
    460             </a>
     496                    <i class="<?php echo esc_attr($wpc_cart_icon); ?>"></i>
     497                    <sup class="basket-item-count" style="display: inline;">
     498                        <span class="cart-items-count count" id="wpc-mini-cart-count">
     499                        </span>
     500                    </sup>
     501                </a>
    461502                <li class="wpc-menu-mini-cart wpc_background_color">
    462                 <div class="widget_shopping_cart_content">
    463                     <?php is_object( WC()->cart ) ? woocommerce_mini_cart() : ''; ?>
    464                 </div>
     503                    <div class="widget_shopping_cart_content">
     504                        <?php is_object(WC()->cart) ? woocommerce_mini_cart() : ''; ?>
     505                    </div>
    465506                </li>
    466507            </ul>
    467             <?php
     508        <?php
    468509        }
    469510    }
    … …  
    474515     * @param [type] $fragments
    475516     */
    476     public function wpc_add_to_cart_count_fragment_refresh( $fragments ) {
     517    public function wpc_add_to_cart_count_fragment_refresh($fragments)
     518    {
    477519        ob_start();
    478520        ?>
    … …  
    480522            <?php echo WC()->cart->get_cart_contents_count(); ?>
    481523        </div>
    482         <?php
     524    <?php
    483525        $fragments['#wpc-mini-cart-count'] = ob_get_clean();
    484526        return $fragments;
    … …  
    490532     * @param [type] $fragments
    491533     */
    492     public function wpc_add_to_cart_content_fragment_refresh( $fragments ) {
     534    public function wpc_add_to_cart_content_fragment_refresh($fragments)
     535    {
    493536        ob_start();
    494         ?>
     537    ?>
    495538        <div class="widget_shopping_cart_content">
    496             <?php is_object( WC()->cart ) ? woocommerce_mini_cart() : 'test'; ?>
     539            <?php is_object(WC()->cart) ? woocommerce_mini_cart() : 'test'; ?>
    497540        </div>
    498         <?php
     541    <?php
    499542        $fragments['div.widget_shopping_cart_content'] = ob_get_clean();
    500543        return $fragments;
    … …  
    505548     *
    506549     */
    507     public function wpc_location_checkout_form() {
     550    public function wpc_location_checkout_form()
     551    {
    508552        $domain   = 'woocommerce';
    509553        $checkout = WC()->checkout;
    510         ?>
     554    ?>
    511555        <div id="wpc_location_field">
    512         <?php
     556            <?php
    513557            // get loctaion
    514             $wpc_loctaion     = get_terms( 'wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0] );
     558            $wpc_loctaion     = get_terms('wpcafe_location', ['taxonomy' => 'wpcafe_location', 'hide_empty' => 0, 'orderby' => 'DESC', 'parent' => 0]);
    515559            $wpc_loctaion_arr = ['' => 'Select a loctaion'];
    516560
    517             foreach ( $wpc_loctaion as $value ) {
     561            foreach ($wpc_loctaion as $value) {
    518562                $wpc_loctaion_arr["$value->slug"] = $value->name;
    519563            }
    520             woocommerce_form_field( 'wpc_location_name', [
     564            woocommerce_form_field('wpc_location_name', [
    521565                'type'        => 'select',
    522566                'class'       => ['wpc-location form-row-wide'],
    523                 'label'       => __( 'Order location', $domain ),
    524                 'placeholder' => __( 'Enter location', $domain ),
     567                'label'       => __('Order location', $domain),
     568                'placeholder' => __('Enter location', $domain),
    525569                'required'      => true,
    526570                'options'     => $wpc_loctaion_arr,
    527             ], $checkout->get_value( 'wpc_location_name' ) );
    528         ?>
     571            ], $checkout->get_value('wpc_location_name'));
     572            ?>
    529573        </div>
    530         <?php
     574    <?php
    531575    }
    532576
    … …  
    535579     *
    536580     */
    537     public function wpc_validate_location() {
    538         if ( sanitize_text_field( isset( $_POST['wpc_location_name'] ) ) && empty( sanitize_text_field( $_POST['wpc_location_name'] ) ) ) {
    539             wc_add_notice( __( 'Please select a location' ), 'error' );
     581    public function wpc_validate_location()
     582    {
     583        if (sanitize_text_field(isset($_POST['wpc_location_name'])) && empty(sanitize_text_field($_POST['wpc_location_name']))) {
     584            wc_add_notice(__('Please select a location'), 'error');
    540585        }
    541586    }
    … …  
    546591     * @param [type] $order
    547592     */
    548     public function wpc_location_update_meta( $order ) {
    549 
    550         if ( sanitize_text_field( isset( $_POST['wpc_location_name'] ) ) && !empty( sanitize_text_field( $_POST['wpc_location_name'] ) ) ) {
    551             $order->update_meta_data( 'wpc_location_name', sanitize_text_field( $_POST['wpc_location_name'] ) );
     593    public function wpc_location_update_meta($order)
     594    {
     595
     596        if (sanitize_text_field(isset($_POST['wpc_location_name'])) && !empty(sanitize_text_field($_POST['wpc_location_name']))) {
     597            $order->update_meta_data('wpc_location_name', sanitize_text_field($_POST['wpc_location_name']));
    552598        }
    553599    }
    … …  
    557603     *
    558604     */
    559     public function wpc_product_cat_taxonomy_add_new_meta_field() {
    560         ?>
     605    public function wpc_product_cat_taxonomy_add_new_meta_field()
     606    {
     607    ?>
    561608        <div class="form-field">
    562             <label for="wpc_menu_order_priority"><?php _e( 'Order menu', 'wpcafe' );?></label>
     609            <label for="wpc_menu_order_priority"><?php _e('Order menu', 'wpcafe'); ?></label>
    563610            <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority">
    564611        </div>
    565         <?php
     612    <?php
    566613    }
    567614
    … …  
    571618     * @param [type] $term
    572619     */
    573     public function wpc_product_cat_taxonomy_edit_meta_field( $term ) {
     620    public function wpc_product_cat_taxonomy_edit_meta_field($term)
     621    {
    574622
    575623        //getting term ID
    576624        $term_id                 = $term->term_id;
    577         $wpc_menu_order_priority = get_term_meta( $term_id, 'wpc_menu_order_priority', true );
    578         ?>
     625        $wpc_menu_order_priority = get_term_meta($term_id, 'wpc_menu_order_priority', true);
     626    ?>
    579627        <tr class="form-field">
    580             <th scope="row" valign="top"><label for="wpc_menu_order_priority"><?php _e( 'Order menu', 'wpcafe' );?></label></th>
     628            <th scope="row" valign="top"><label for="wpc_menu_order_priority"><?php _e('Order menu', 'wpcafe'); ?></label></th>
    581629            <td>
    582                 <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority"
    583                     value="<?php echo esc_attr( $wpc_menu_order_priority ) ? esc_attr( $wpc_menu_order_priority ) : ''; ?>">
     630                <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority" value="<?php echo esc_attr($wpc_menu_order_priority) ? esc_attr($wpc_menu_order_priority) : ''; ?>">
    584631            </td>
    585632        </tr>
    586     <?php
     633<?php
    587634    }
    588635
    … …  
    592639     * @param [type] $term
    593640     */
    594     public function wpc_product_cat_taxonomy_save_meta_field( $term_id ) {
    595         $wpc_menu_order_priority = filter_input( INPUT_POST, 'wpc_menu_order_priority' );
    596         update_term_meta( $term_id, 'wpc_menu_order_priority', $wpc_menu_order_priority );
     641    public function wpc_product_cat_taxonomy_save_meta_field($term_id)
     642    {
     643        $wpc_menu_order_priority = filter_input(INPUT_POST, 'wpc_menu_order_priority');
     644        update_term_meta($term_id, 'wpc_menu_order_priority', $wpc_menu_order_priority);
    597645    }
    598646
    … …  
    602650     * @param mixed $columns
    603651     */
    604     public function wpc_custom_fields_list_title( $columns ) {
    605         $columns['wpc_menu_order_priority'] = __( 'Order menu', 'woocommerce' );
    606         $columns['cat_id']                  = __( 'ID', 'woocommerce' );
     652    public function wpc_custom_fields_list_title($columns)
     653    {
     654        $columns['wpc_menu_order_priority'] = __('Order menu', 'woocommerce');
     655        $columns['cat_id']                  = __('ID', 'woocommerce');
    607656        return $columns;
    608657    }
    … …  
    615664     * @param int $id term ID
    616665     */
    617     public function wpc_custom_fields_list_diplay( $columns, $column, $id ) {
    618 
    619         if ( 'wpc_menu_order_priority' == $column ) {
    620             $columns = esc_html( get_term_meta( $id, 'wpc_menu_order_priority', true ) );
    621         } elseif ( 'cat_id' == $column ) {
    622             $columns = esc_html( $id );
     666    public function wpc_custom_fields_list_diplay($columns, $column, $id)
     667    {
     668
     669        if ('wpc_menu_order_priority' == $column) {
     670            $columns = esc_html(get_term_meta($id, 'wpc_menu_order_priority', true));
     671        } elseif ('cat_id' == $column) {
     672            $columns = esc_html($id);
    623673        }
    624674
  • wp-cafe/trunk/plugin.php

    r2341364 r2343218  
    1414final class Plugin{
    1515   
    16     const version = '1.0.4';
     16    const version = '1.0.5';
    1717
    1818    private static $instance;
  • wp-cafe/trunk/readme.txt

    r2341364 r2343218  
    11=== WP Cafe ===
    2 Contributors: ataurr, themewinter, rezakhan995, abrasel600, nitu456410
     2Contributors: ataurr, themewinter, abrasel600, rezakhan995, nitu456410
    33Tags: reservation, restaurant menu, food menu, restaurant, food delivery
    44Requires at least: 5.2
    55Tested up to: 5.4
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.5
    77Requires PHP: 5.6
    88License: GPLv2 or later
    … …  
    5050
    5151== Changelog ==
     52
     53= 1.0.5 =
     54
     55* Fix   : Price showing both from including and excluding tax in shortcode and widget
     56* Fix   : Mini cart price showing including and excluding tax
     57* Fix   : Storefront theme header mini cart count update bug
     58* Fix   : Mini-cart opening and closing bug
     59* Tweak : header mini-cart and menu tag css update
    5260
    5361= 1.0.4 =
  • wp-cafe/trunk/widgets/wpc-food-menu-tab/style/style-1.php

    r2335589 r2343218  
    8181                                        <div class="<?php echo esc_attr($col); ?>">
    8282                                            <div class="wpc-food-inner-content">
    83                                                 <?php
    84                                                 //only start if we have some tags
    85                                                 if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
    86                                                     //create a list to hold our tags
    87                                                     ?>
     83                                                <!-- product tag and tax -->
     84                                                <?php if ($current_tags || $product->get_price_suffix()) { ?>
    8885                                                    <ul class="wpc-menu-tag">
    89                                                     <?php
    90                                                     //for each tag we create a list item
    91                                                     foreach ($current_tags as $tag) {
    92                                                         $tag_title = $tag->name;
     86                                                        <?php
     87                                                        if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
     88                                                            //for each tag we create a list item
     89                                                            foreach ($current_tags as $tag) {
     90                                                                $tag_title = $tag->name;
    9391                                                        ?>
    94                                                         <li><?php echo esc_html( $tag_title ); ?></li>
    95                                                     <?php } ?>
     92                                                                <li><?php echo esc_html($tag_title); ?></li>
     93                                                        <?php }
     94                                                        } ?>
     95                                                        <!-- product tax -->
     96                                                        <?php if ($product->get_price_suffix() != '') { ?>
     97                                                            <li>
     98                                                                <?php
     99                                                                if (wc_get_price_including_tax($product)) {
     100                                                                    $price      = wc_get_price_including_tax($product);
     101                                                                    // get percentage tax
     102                                                                    echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     103                                                                } else {
     104                                                                    $price = wc_get_price_excluding_tax($product);
     105                                                                }
     106                                                                ?>
     107                                                            </li>
     108                                                        <?php } ?>
    96109                                                    </ul>
    97110                                                <?php } ?>
     111
    98112                                                <h3 class="wpc-post-title wpc-title-with-border">
    99113                                                    <a href="<?php echo esc_url($permalink); ?>" class="<?php echo esc_attr($class); ?>"><?php echo esc_html(get_the_title());  ?> </a>
  • wp-cafe/trunk/widgets/wpc-menus-list/style/style-1.php

    r2335589 r2343218  
    6262                <div class="<?php echo esc_attr($col); ?>">
    6363                    <div class="wpc-food-inner-content">
    64                         <?php
    65                         //only start if we have some tags
    66                         if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
    67                             //create a list to hold our tags
    68                             ?>
     64                        <!-- product tag and tax -->
     65                        <?php if ($current_tags || $product->get_price_suffix()) { ?>
     66
    6967                            <ul class="wpc-menu-tag">
    70                             <?php
    71                             //for each tag we create a list item
    72                             foreach ($current_tags as $tag) {
    73                                 $tag_title = $tag->name;
     68                                <?php
     69                                //only start if we have some tags
     70                                if ($show_item_status == 'yes' && $current_tags && !is_wp_error($current_tags)) {
     71                                    //for each tag we create a list item
     72                                    foreach ($current_tags as $tag) {
     73                                        $tag_title = $tag->name;
    7474                                ?>
    75                                 <li><?php echo esc_html( $tag_title ); ?></li>
    76                             <?php } ?>
     75                                        <li><?php echo esc_html($tag_title); ?></li>
     76                                <?php }
     77                                } ?>
     78                                <!-- product tax -->
     79                                <?php if ($product->get_price_suffix() != '') {  ?>
     80                                    <li>
     81                                        <?php
     82                                        if (wc_get_price_including_tax($product)) {
     83                                            $price      = wc_get_price_including_tax($product);
     84                                            // get percentage tax
     85                                            echo Wpc_Utilities::wpc_kses($product->get_price_suffix());
     86                                        } else {
     87                                            $price = wc_get_price_excluding_tax($product);
     88                                        }
     89                                        ?>
     90                                    </li>
     91                                <?php } ?>
    7792                            </ul>
    7893                        <?php } ?>
     94
    7995                        <h3 class="wpc-post-title wpc-title-with-border">
    8096                            <a href="<?php echo esc_url($permalink); ?>" class="<?php echo esc_attr($class); ?>"><?php echo esc_html(get_the_title());  ?> </a>
  • wp-cafe/trunk/wpcafe.php

    r2341581 r2343218  
    88 * Plugin Name:        WP Cafe
    99 * Plugin URI:         https://product.themewinter.com/wpcafe
    10  * Description:        All in One WordPress Restaurant solution plugin
    11  * Version:            1.0.4
     10 * Description:        WordPress Restaurant solution plugin to launch Restaurant Websites.
     11 * Version:            1.0.5
    1212 * Author:             Themewinter
    1313 * Author URI:         http://themewinter.com/
Note: See TracChangeset for help on using the changeset viewer.