Changeset 2343218
- Timestamp:
- 07/20/2020 06:09:13 AM (6 years ago)
- Location:
- wp-cafe
- Files:
-
- 3 deleted
- 12 edited
- 45 copied
-
assets/banner-1544x500.png (modified) ( previous)
-
assets/banner-772x250.png (modified) ( previous)
-
tags/1.0.5 (copied) (copied from wp-cafe/trunk )
-
tags/1.0.5/assets/css/wpc-admin.css (copied) (copied from wp-cafe/trunk/assets/css/wpc-admin.css )
-
tags/1.0.5/assets/css/wpc-icon.css (copied) (copied from wp-cafe/trunk/assets/css/wpc-icon.css )
-
tags/1.0.5/assets/css/wpc-public.css (copied) (copied from wp-cafe/trunk/assets/css/wpc-public.css ) (4 diffs)
-
tags/1.0.5/assets/fonts/wpcafe.eot (copied) (copied from wp-cafe/trunk/assets/fonts/wpcafe.eot )
-
tags/1.0.5/assets/fonts/wpcafe.svg (copied) (copied from wp-cafe/trunk/assets/fonts/wpcafe.svg )
-
tags/1.0.5/assets/fonts/wpcafe.ttf (copied) (copied from wp-cafe/trunk/assets/fonts/wpcafe.ttf )
-
tags/1.0.5/assets/fonts/wpcafe.woff (copied) (copied from wp-cafe/trunk/assets/fonts/wpcafe.woff )
-
tags/1.0.5/assets/js/elementor.js (copied) (copied from wp-cafe/trunk/assets/js/elementor.js )
-
tags/1.0.5/assets/js/wpc-admin-menu.js (copied) (copied from wp-cafe/trunk/assets/js/wpc-admin-menu.js )
-
tags/1.0.5/assets/js/wpc-admin.js (copied) (copied from wp-cafe/trunk/assets/js/wpc-admin.js )
-
tags/1.0.5/assets/js/wpc-public.js (copied) (copied from wp-cafe/trunk/assets/js/wpc-public.js ) (1 diff)
-
tags/1.0.5/assets/scss/wpc-admin.scss (copied) (copied from wp-cafe/trunk/assets/scss/wpc-admin.scss )
-
tags/1.0.5/assets/scss/wpc-public.scss (copied) (copied from wp-cafe/trunk/assets/scss/wpc-public.scss ) (4 diffs)
-
tags/1.0.5/autoloader.php (copied) (copied from wp-cafe/trunk/autoloader.php )
-
tags/1.0.5/core.php (copied) (copied from wp-cafe/trunk/core.php )
-
tags/1.0.5/core/Template (deleted)
-
tags/1.0.5/core/action/wpc-action.php (copied) (copied from wp-cafe/trunk/core/action/wpc-action.php )
-
tags/1.0.5/core/action/wpc-ajax-action.php (copied) (copied from wp-cafe/trunk/core/action/wpc-ajax-action.php ) (4 diffs)
-
tags/1.0.5/core/action/wpc-reservation.php (deleted)
-
tags/1.0.5/core/base/wpc-custom-post.php (copied) (copied from wp-cafe/trunk/core/base/wpc-custom-post.php )
-
tags/1.0.5/core/base/wpc-menu-build.php (copied) (copied from wp-cafe/trunk/core/base/wpc-menu-build.php )
-
tags/1.0.5/core/base/wpc-metabox.php (copied) (copied from wp-cafe/trunk/core/base/wpc-metabox.php )
-
tags/1.0.5/core/base/wpc-settings-field.php (copied) (copied from wp-cafe/trunk/core/base/wpc-settings-field.php )
-
tags/1.0.5/core/enqueue (copied) (copied from wp-cafe/trunk/core/enqueue )
-
tags/1.0.5/core/menu/wpc-menus.php (copied) (copied from wp-cafe/trunk/core/menu/wpc-menus.php )
-
tags/1.0.5/core/metaboxes/wpc-reservation-meta.php (copied) (copied from wp-cafe/trunk/core/metaboxes/wpc-reservation-meta.php )
-
tags/1.0.5/core/post-type/cpt.php (copied) (copied from wp-cafe/trunk/core/post-type/cpt.php )
-
tags/1.0.5/core/report/wpc-menu-report.php (copied) (copied from wp-cafe/trunk/core/report/wpc-menu-report.php )
-
tags/1.0.5/core/report/wpc-reservation-report.php (copied) (copied from wp-cafe/trunk/core/report/wpc-reservation-report.php )
-
tags/1.0.5/core/template (copied) (copied from wp-cafe/trunk/core/template )
-
tags/1.0.5/core/template/wpc-key-options.php (copied) (copied from wp-cafe/trunk/core/template/wpc-key-options.php )
-
tags/1.0.5/core/widgets/cancellation-form-template.php (copied) (copied from wp-cafe/trunk/core/widgets/cancellation-form-template.php )
-
tags/1.0.5/core/widgets/hook.php (copied) (copied from wp-cafe/trunk/core/widgets/hook.php ) (31 diffs)
-
tags/1.0.5/core/widgets/reservation-form-template.php (copied) (copied from wp-cafe/trunk/core/widgets/reservation-form-template.php )
-
tags/1.0.5/languages (copied) (copied from wp-cafe/trunk/languages )
-
tags/1.0.5/plugin.php (copied) (copied from wp-cafe/trunk/plugin.php ) (1 diff)
-
tags/1.0.5/readme.txt (copied) (copied from wp-cafe/trunk/readme.txt ) (2 diffs)
-
tags/1.0.5/traits/wpc-singleton.php (copied) (copied from wp-cafe/trunk/traits/wpc-singleton.php )
-
tags/1.0.5/uninstall.php (deleted)
-
tags/1.0.5/utils/wpc-utilities.php (copied) (copied from wp-cafe/trunk/utils/wpc-utilities.php )
-
tags/1.0.5/widgets/manifest.php (copied) (copied from wp-cafe/trunk/widgets/manifest.php )
-
tags/1.0.5/widgets/wpc-food-menu-tab/style/style-1.php (copied) (copied from wp-cafe/trunk/widgets/wpc-food-menu-tab/style/style-1.php ) (1 diff)
-
tags/1.0.5/widgets/wpc-food-menu-tab/wpc-food-menu-tab.php (copied) (copied from wp-cafe/trunk/widgets/wpc-food-menu-tab/wpc-food-menu-tab.php )
-
tags/1.0.5/widgets/wpc-menus-list/style/style-1.php (copied) (copied from wp-cafe/trunk/widgets/wpc-menus-list/style/style-1.php ) (1 diff)
-
tags/1.0.5/widgets/wpc-menus-list/wpc-menus-list.php (copied) (copied from wp-cafe/trunk/widgets/wpc-menus-list/wpc-menus-list.php )
-
tags/1.0.5/widgets/wpc-resevation-form/wpc-resevation-form.php (copied) (copied from wp-cafe/trunk/widgets/wpc-resevation-form/wpc-resevation-form.php )
-
tags/1.0.5/wpcafe.php (copied) (copied from wp-cafe/trunk/wpcafe.php ) (1 diff)
-
trunk/assets/css/wpc-public.css (modified) (4 diffs)
-
trunk/assets/js/wpc-public.js (modified) (1 diff)
-
trunk/assets/scss/wpc-public.scss (modified) (4 diffs)
-
trunk/core/action/wpc-ajax-action.php (modified) (4 diffs)
-
trunk/core/widgets/hook.php (modified) (31 diffs)
-
trunk/plugin.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/widgets/wpc-food-menu-tab/style/style-1.php (modified) (1 diff)
-
trunk/widgets/wpc-menus-list/style/style-1.php (modified) (1 diff)
-
trunk/wpcafe.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-cafe/tags/1.0.5/assets/css/wpc-public.css
r2335589 r2343218 4574 4574 .wpc-food-menu-item .wpc-menu-tag { 4575 4575 padding: 0; 4576 margin: 0; 4576 4577 } 4577 4578 .wpc-food-menu-item .wpc-menu-tag li { … … 4590 4591 -ms-border-radius: 36px; 4591 4592 } 4593 .wpc-food-menu-item .wpc-menu-tag-wrap .wpc-menu-tag { 4594 display: inline-block; 4595 } 4592 4596 .wpc-food-menu-item .wpc-food-inner-content { 4593 4597 position: relative; … … 4660 4664 text-align: center; 4661 4665 color: #fff; 4666 padding: 0; 4662 4667 } 4663 4668 .wpc-food-menu-item .wpc-add-to-cart a i { … … 5078 5083 -ms-transition: all 0.4s ease; 5079 5084 transform: translateY(-50%); 5085 padding-left: 40px; 5080 5086 } 5081 5087 .wpc_cart_block.cart_icon_active { -
wp-cafe/tags/1.0.5/assets/js/wpc-public.js
r2335589 r2343218 678 678 }, 679 679 success: function (results) { 680 $( document.body ).trigger( 'wc_fragment_refresh' ); 680 681 $('#wpc-mini-cart-count').html(""); 681 682 $('#wpc-mini-cart-count').html(results.data.wpc_count); -
wp-cafe/tags/1.0.5/assets/scss/wpc-public.scss
r2335589 r2343218 38 38 .wpc-menu-tag { 39 39 padding: 0; 40 40 margin: 0; 41 41 li { 42 42 font-size : 11px; … … 53 53 } 54 54 } 55 .wpc-menu-tag-wrap{ 56 .wpc-menu-tag{ 57 display: inline-block; 58 } 59 } 55 60 56 61 .wpc-food-inner-content { … … 130 135 text-align : center; 131 136 color : #fff; 137 padding: 0; 132 138 133 139 i { … … 659 665 @include transition(); 660 666 @include transform(translateY(-50%)); 661 667 padding-left: 40px; 662 668 &.cart_icon_active { 663 669 right: 0; -
wp-cafe/tags/1.0.5/core/action/wpc-ajax-action.php
r2335589 r2343218 225 225 $response = [ 'status_code' => 500 , 'message' => ['somthing is wrong'] , 'data' => [] ]; 226 226 wp_send_json_error( $response ); 227 wp_die(); 228 } 229 227 } 230 228 if ( "wpc_add_car_single_page" == sanitize_text_field( $_POST['wpc_action'] ) ) { 231 229 $post_arr = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING ); … … 246 244 247 245 } 248 246 247 // mini cart content 249 248 $wpc_cart_content = ''; 250 249 $items = WC()->cart->get_cart(); … … 265 264 266 265 $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 269 267 $_woo_product = wc_get_product( $product_id ); 268 270 269 $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 ); 275 275 } 276 276 … … 314 314 'wpc_count' => $item_count, 'wpc_cart_content' => $wpc_cart_content] ); 315 315 } 316 317 316 die(); 318 317 } 319 320 318 } -
wp-cafe/tags/1.0.5/core/widgets/hook.php
r2335589 r2343218 1 1 <?php 2 2 3 namespace WpCafe\Core\Widgets; 3 4 4 defined( "ABSPATH") || exit;5 defined("ABSPATH") || exit; 5 6 6 7 use WpCafe\Utils\Wpc_Utilities as Utils; … … 11 12 * create post type class 12 13 */ 13 class Hook { 14 class Hook 15 { 14 16 15 17 use Wpc_Singleton; 16 18 17 19 private $settings_obj = null; 18 20 public $wpc_message = ''; … … 21 23 * call hooks 22 24 */ 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(); 25 28 26 29 // 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']); 30 33 // add minicart to header 31 add_action( 'wp_head',[$this, 'wpc_custom_mini_cart']);34 add_action('wp_head', [$this, 'wpc_custom_mini_cart']); 32 35 33 36 // 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); 38 41 } 39 42 // 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); 44 47 //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); 47 50 // 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']); 51 53 } 52 54 … … 55 57 * Print the reservation form's HTML code. 56 58 */ 57 public function wpc_booking_form_shortcode($atts) { 59 public function wpc_booking_form_shortcode($atts) 60 { 58 61 ob_start(); 59 62 $settings = $this->settings_obj; 60 63 include_once 'reservation-form-template.php'; 61 if ( isset( $settings['wpc_allow_cancellation'] )) {64 if (isset($settings['wpc_allow_cancellation'])) { 62 65 include_once 'cancellation-form-template.php'; 63 66 } … … 71 74 * @param [type] $id 72 75 */ 73 public function wpc_tag($id) {74 ?>75 <div class="wpc-menu-tag-wrap">76 public function wpc_tag($id) 77 { 78 ?> 76 79 <?php 77 80 $current_tags = get_the_terms($id, 'product_tag'); … … 80 83 if ($current_tags && !is_wp_error($current_tags)) { 81 84 //create a list to hold our tags 82 ?>85 ?> 83 86 <ul class="wpc-menu-tag"> 84 <?php85 86 //for each tag we create a list item87 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; 89 92 ?> 90 <li><?php echo esc_html( $tag_title); ?></li>93 <li><?php echo esc_html($tag_title); ?></li> 91 94 <?php 92 }93 ?>95 } 96 ?> 94 97 </ul> 95 <?php } ?> 96 </div> 97 <?php 98 <?php } 98 99 } 99 100 … … 102 103 * 103 104 */ 104 public function wpc_location() { 105 public function wpc_location() 106 { 105 107 // show location 106 108 $settings = $this->settings_obj; 107 109 if (isset($settings['wpcafe_food_location']) && $settings['wpcafe_food_location'] == 'on') { 108 ?>110 ?> 109 111 <div id="wpc_location_modal" class="wpc_modal"> 110 112 <!-- Modal content --> 111 113 <div class="modal-content"> 112 114 <select name="wpc-location" class="wpc-location"> 113 <option value=""><?php echo esc_html('Select a location', 'wpcafe') ?></option>114 <?php115 // get wpcafe locations116 $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) { 119 121 ?> 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> 121 128 <?php 122 129 } 123 }124 else {125 130 ?> 126 <option value=""><?php echo esc_html__('No location set', 'wpcafe')?></option>127 <?php128 }129 ?>130 131 </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> 133 134 </div> 134 135 </div> 135 <?php136 <?php 136 137 } 137 138 } … … 143 144 * @param $content 144 145 */ 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; 148 150 } 149 151 ob_start(); … … 152 154 $this->wpc_location(); 153 155 } 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); 160 164 $wpc_cat_sort_arr = []; 161 165 $i = 0; 162 166 163 foreach ( $wpc_cat_arr as $value) {167 foreach ($wpc_cat_arr as $value) { 164 168 $i++; 165 169 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 == '') { 169 173 $wpc_cat_sort_arr[$i] = $value; 170 174 } else { … … 172 176 } 173 177 } 174 175 } 176 ksort( $wpc_cat_sort_arr ); 178 } 179 ksort($wpc_cat_sort_arr); 177 180 $current = ''; 178 181 ?> … … 180 183 <ul class="wpc-nav"> 181 184 <?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 197 196 } 197 } 198 198 ?> 199 199 </ul> 200 200 <div class='wpc-tab-content'> 201 201 <?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') { 221 261 ?> 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> 228 266 </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 ?> 253 270 </div> 254 271 </div> 255 272 </div> 256 < ?php } ?>257 < /div>273 </div> 274 <?php } ?> 258 275 </div> 259 <?php 260 } 276 </div> 277 <?php 278 } 261 279 ?> 262 280 </div> 263 281 </div> 264 <?php282 <?php 265 283 $contents = ob_get_clean(); 266 284 return $contents; … … 272 290 * @param Type $var 273 291 */ 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; 277 296 } 278 297 ob_start(); … … 282 301 } 283 302 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 )); 287 307 288 308 // category sorting from backend 289 $wpc_cat_arr = explode( ',', $wpc_food_catgeries);309 $wpc_cat_arr = explode(',', $wpc_food_catgeries); 290 310 291 311 $args = array( … … 296 316 'post_status' => 'publish', 297 317 'suppress_filters' => false, 298 318 299 319 ); 300 if (is_array( $wpc_cat_arr ) && count( $wpc_cat_arr )>0) {320 if (is_array($wpc_cat_arr) && count($wpc_cat_arr) > 0) { 301 321 $args['tax_query'] = array( 302 322 array( … … 310 330 }; 311 331 $products = wc_get_products($args); 312 ?>332 ?> 313 333 <div class='wpc-food-wrapper'> 314 334 <?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 ?> 323 387 </div> 324 388 </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 <?php335 echo esc_html__(get_the_excerpt( $product->get_id() ) , 'wpcafe');336 // show cart button337 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 <?php345 }346 ?>347 </div>348 389 </div> 349 </div>350 390 <?php } ?> 351 391 </div> … … 360 400 * 361 401 */ 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')) { 364 405 return; 365 406 } 366 407 $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 370 413 $wpc_cart_icon = ''; 371 414 $wpc_custom_css = ''; 372 415 373 416 // icon 374 if ( isset( $settings['wpc_mini_cart_icon'] )) {417 if (isset($settings['wpc_mini_cart_icon'])) { 375 418 $wpc_cart_icon = $settings['wpc_mini_cart_icon'] != '' ? $settings['wpc_mini_cart_icon'] : 'wpcafe-cart_icon'; 376 419 } else { … … 379 422 380 423 // cart bg color 381 if ( isset( $settings['wpc_primary_color'] )) {424 if (isset($settings['wpc_primary_color'])) { 382 425 $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) . '}'; 384 427 //button 385 428 $wpc_custom_css .= ' … … 390 433 .wpc-food-menu-item .wpc-add-to-cart a, 391 434 .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) . ' 393 436 } 394 437 … … 398 441 399 442 .wpc-food-tab-wrapper .wpc-nav li a.wpc-active{ 400 color : ' . esc_attr( $bg_color) . '443 color : ' . esc_attr($bg_color) . ' 401 444 } 402 445 .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) . ' 404 447 } 405 448 .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; 407 450 } 408 451 409 452 '; 410 453 // 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) . '}'; 413 455 } else { 414 456 $wpc_custom_css .= '.wpc_background_color { background-color : #d5d5d5 }'; 415 457 //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') . '}'; 417 459 } 418 460 419 461 // cart icon color 420 if ( isset( $settings['wpc_secondary_color'] )) {462 if (isset($settings['wpc_secondary_color'])) { 421 463 $color = $settings['wpc_secondary_color'] ? $settings['wpc_secondary_color'] : "#d5d5d5 "; 422 464 423 465 //button hover 424 466 $wpc_custom_css .= ' … … 430 472 .wpc-settings-dashboard .button-primary:focus, 431 473 #wpc_location_modal .wpc-close { 432 background-color : ' . esc_attr( $color) . '474 background-color : ' . esc_attr($color) . ' 433 475 } 434 476 '; 435 477 // 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) . '}'; 437 479 // count 438 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( $color ) . '}'; 439 480 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr($color) . '}'; 440 481 } else { 441 482 $wpc_custom_css .= 'a.wpc_cart_icon i { color : #000}'; 442 483 //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') . '}'; 444 485 // 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) . '}'; 446 487 // count 447 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( '#fff') . '}';488 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr('#fff') . '}'; 448 489 } 449 490 // 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 ?> 454 495 <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> 461 502 <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> 465 506 </li> 466 507 </ul> 467 <?php508 <?php 468 509 } 469 510 } … … 474 515 * @param [type] $fragments 475 516 */ 476 public function wpc_add_to_cart_count_fragment_refresh( $fragments ) { 517 public function wpc_add_to_cart_count_fragment_refresh($fragments) 518 { 477 519 ob_start(); 478 520 ?> … … 480 522 <?php echo WC()->cart->get_cart_contents_count(); ?> 481 523 </div> 482 <?php524 <?php 483 525 $fragments['#wpc-mini-cart-count'] = ob_get_clean(); 484 526 return $fragments; … … 490 532 * @param [type] $fragments 491 533 */ 492 public function wpc_add_to_cart_content_fragment_refresh( $fragments ) { 534 public function wpc_add_to_cart_content_fragment_refresh($fragments) 535 { 493 536 ob_start(); 494 ?>537 ?> 495 538 <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'; ?> 497 540 </div> 498 <?php541 <?php 499 542 $fragments['div.widget_shopping_cart_content'] = ob_get_clean(); 500 543 return $fragments; … … 505 548 * 506 549 */ 507 public function wpc_location_checkout_form() { 550 public function wpc_location_checkout_form() 551 { 508 552 $domain = 'woocommerce'; 509 553 $checkout = WC()->checkout; 510 ?>554 ?> 511 555 <div id="wpc_location_field"> 512 <?php556 <?php 513 557 // 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]); 515 559 $wpc_loctaion_arr = ['' => 'Select a loctaion']; 516 560 517 foreach ( $wpc_loctaion as $value) {561 foreach ($wpc_loctaion as $value) { 518 562 $wpc_loctaion_arr["$value->slug"] = $value->name; 519 563 } 520 woocommerce_form_field( 'wpc_location_name', [564 woocommerce_form_field('wpc_location_name', [ 521 565 'type' => 'select', 522 566 '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), 525 569 'required' => true, 526 570 'options' => $wpc_loctaion_arr, 527 ], $checkout->get_value( 'wpc_location_name' ));528 ?>571 ], $checkout->get_value('wpc_location_name')); 572 ?> 529 573 </div> 530 <?php574 <?php 531 575 } 532 576 … … 535 579 * 536 580 */ 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'); 540 585 } 541 586 } … … 546 591 * @param [type] $order 547 592 */ 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'])); 552 598 } 553 599 } … … 557 603 * 558 604 */ 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 ?> 561 608 <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> 563 610 <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority"> 564 611 </div> 565 <?php612 <?php 566 613 } 567 614 … … 571 618 * @param [type] $term 572 619 */ 573 public function wpc_product_cat_taxonomy_edit_meta_field( $term ) { 620 public function wpc_product_cat_taxonomy_edit_meta_field($term) 621 { 574 622 575 623 //getting term ID 576 624 $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 ?> 579 627 <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> 581 629 <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) : ''; ?>"> 584 631 </td> 585 632 </tr> 586 <?php633 <?php 587 634 } 588 635 … … 592 639 * @param [type] $term 593 640 */ 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); 597 645 } 598 646 … … 602 650 * @param mixed $columns 603 651 */ 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'); 607 656 return $columns; 608 657 } … … 615 664 * @param int $id term ID 616 665 */ 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); 623 673 } 624 674 -
wp-cafe/tags/1.0.5/plugin.php
r2341364 r2343218 14 14 final class Plugin{ 15 15 16 const version = '1.0. 4';16 const version = '1.0.5'; 17 17 18 18 private static $instance; -
wp-cafe/tags/1.0.5/readme.txt
r2341364 r2343218 1 1 === WP Cafe === 2 Contributors: ataurr, themewinter, rezakhan995, abrasel600,nitu4564102 Contributors: ataurr, themewinter, abrasel600, rezakhan995, nitu456410 3 3 Tags: reservation, restaurant menu, food menu, restaurant, food delivery 4 4 Requires at least: 5.2 5 5 Tested up to: 5.4 6 Stable tag: 1.0. 46 Stable tag: 1.0.5 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 50 50 51 51 == 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 52 60 53 61 = 1.0.4 = -
wp-cafe/tags/1.0.5/widgets/wpc-food-menu-tab/style/style-1.php
r2335589 r2343218 81 81 <div class="<?php echo esc_attr($col); ?>"> 82 82 <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()) { ?> 88 85 <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; 93 91 ?> 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 } ?> 96 109 </ul> 97 110 <?php } ?> 111 98 112 <h3 class="wpc-post-title wpc-title-with-border"> 99 113 <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 62 62 <div class="<?php echo esc_attr($col); ?>"> 63 63 <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 69 67 <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; 74 74 ?> 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 } ?> 77 92 </ul> 78 93 <?php } ?> 94 79 95 <h3 class="wpc-post-title wpc-title-with-border"> 80 96 <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 8 8 * Plugin Name: WP Cafe 9 9 * Plugin URI: https://product.themewinter.com/wpcafe 10 * Description: All in One WordPress Restaurant solution plugin11 * Version: 1.0. 410 * Description: WordPress Restaurant solution plugin to launch Restaurant Websites. 11 * Version: 1.0.5 12 12 * Author: Themewinter 13 13 * Author URI: http://themewinter.com/ -
wp-cafe/trunk/assets/css/wpc-public.css
r2335589 r2343218 4574 4574 .wpc-food-menu-item .wpc-menu-tag { 4575 4575 padding: 0; 4576 margin: 0; 4576 4577 } 4577 4578 .wpc-food-menu-item .wpc-menu-tag li { … … 4590 4591 -ms-border-radius: 36px; 4591 4592 } 4593 .wpc-food-menu-item .wpc-menu-tag-wrap .wpc-menu-tag { 4594 display: inline-block; 4595 } 4592 4596 .wpc-food-menu-item .wpc-food-inner-content { 4593 4597 position: relative; … … 4660 4664 text-align: center; 4661 4665 color: #fff; 4666 padding: 0; 4662 4667 } 4663 4668 .wpc-food-menu-item .wpc-add-to-cart a i { … … 5078 5083 -ms-transition: all 0.4s ease; 5079 5084 transform: translateY(-50%); 5085 padding-left: 40px; 5080 5086 } 5081 5087 .wpc_cart_block.cart_icon_active { -
wp-cafe/trunk/assets/js/wpc-public.js
r2335589 r2343218 678 678 }, 679 679 success: function (results) { 680 $( document.body ).trigger( 'wc_fragment_refresh' ); 680 681 $('#wpc-mini-cart-count').html(""); 681 682 $('#wpc-mini-cart-count').html(results.data.wpc_count); -
wp-cafe/trunk/assets/scss/wpc-public.scss
r2335589 r2343218 38 38 .wpc-menu-tag { 39 39 padding: 0; 40 40 margin: 0; 41 41 li { 42 42 font-size : 11px; … … 53 53 } 54 54 } 55 .wpc-menu-tag-wrap{ 56 .wpc-menu-tag{ 57 display: inline-block; 58 } 59 } 55 60 56 61 .wpc-food-inner-content { … … 130 135 text-align : center; 131 136 color : #fff; 137 padding: 0; 132 138 133 139 i { … … 659 665 @include transition(); 660 666 @include transform(translateY(-50%)); 661 667 padding-left: 40px; 662 668 &.cart_icon_active { 663 669 right: 0; -
wp-cafe/trunk/core/action/wpc-ajax-action.php
r2335589 r2343218 225 225 $response = [ 'status_code' => 500 , 'message' => ['somthing is wrong'] , 'data' => [] ]; 226 226 wp_send_json_error( $response ); 227 wp_die(); 228 } 229 227 } 230 228 if ( "wpc_add_car_single_page" == sanitize_text_field( $_POST['wpc_action'] ) ) { 231 229 $post_arr = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING ); … … 246 244 247 245 } 248 246 247 // mini cart content 249 248 $wpc_cart_content = ''; 250 249 $items = WC()->cart->get_cart(); … … 265 264 266 265 $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 269 267 $_woo_product = wc_get_product( $product_id ); 268 270 269 $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 ); 275 275 } 276 276 … … 314 314 'wpc_count' => $item_count, 'wpc_cart_content' => $wpc_cart_content] ); 315 315 } 316 317 316 die(); 318 317 } 319 320 318 } -
wp-cafe/trunk/core/widgets/hook.php
r2335589 r2343218 1 1 <?php 2 2 3 namespace WpCafe\Core\Widgets; 3 4 4 defined( "ABSPATH") || exit;5 defined("ABSPATH") || exit; 5 6 6 7 use WpCafe\Utils\Wpc_Utilities as Utils; … … 11 12 * create post type class 12 13 */ 13 class Hook { 14 class Hook 15 { 14 16 15 17 use Wpc_Singleton; 16 18 17 19 private $settings_obj = null; 18 20 public $wpc_message = ''; … … 21 23 * call hooks 22 24 */ 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(); 25 28 26 29 // 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']); 30 33 // add minicart to header 31 add_action( 'wp_head',[$this, 'wpc_custom_mini_cart']);34 add_action('wp_head', [$this, 'wpc_custom_mini_cart']); 32 35 33 36 // 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); 38 41 } 39 42 // 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); 44 47 //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); 47 50 // 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']); 51 53 } 52 54 … … 55 57 * Print the reservation form's HTML code. 56 58 */ 57 public function wpc_booking_form_shortcode($atts) { 59 public function wpc_booking_form_shortcode($atts) 60 { 58 61 ob_start(); 59 62 $settings = $this->settings_obj; 60 63 include_once 'reservation-form-template.php'; 61 if ( isset( $settings['wpc_allow_cancellation'] )) {64 if (isset($settings['wpc_allow_cancellation'])) { 62 65 include_once 'cancellation-form-template.php'; 63 66 } … … 71 74 * @param [type] $id 72 75 */ 73 public function wpc_tag($id) {74 ?>75 <div class="wpc-menu-tag-wrap">76 public function wpc_tag($id) 77 { 78 ?> 76 79 <?php 77 80 $current_tags = get_the_terms($id, 'product_tag'); … … 80 83 if ($current_tags && !is_wp_error($current_tags)) { 81 84 //create a list to hold our tags 82 ?>85 ?> 83 86 <ul class="wpc-menu-tag"> 84 <?php85 86 //for each tag we create a list item87 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; 89 92 ?> 90 <li><?php echo esc_html( $tag_title); ?></li>93 <li><?php echo esc_html($tag_title); ?></li> 91 94 <?php 92 }93 ?>95 } 96 ?> 94 97 </ul> 95 <?php } ?> 96 </div> 97 <?php 98 <?php } 98 99 } 99 100 … … 102 103 * 103 104 */ 104 public function wpc_location() { 105 public function wpc_location() 106 { 105 107 // show location 106 108 $settings = $this->settings_obj; 107 109 if (isset($settings['wpcafe_food_location']) && $settings['wpcafe_food_location'] == 'on') { 108 ?>110 ?> 109 111 <div id="wpc_location_modal" class="wpc_modal"> 110 112 <!-- Modal content --> 111 113 <div class="modal-content"> 112 114 <select name="wpc-location" class="wpc-location"> 113 <option value=""><?php echo esc_html('Select a location', 'wpcafe') ?></option>114 <?php115 // get wpcafe locations116 $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) { 119 121 ?> 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> 121 128 <?php 122 129 } 123 }124 else {125 130 ?> 126 <option value=""><?php echo esc_html__('No location set', 'wpcafe')?></option>127 <?php128 }129 ?>130 131 </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> 133 134 </div> 134 135 </div> 135 <?php136 <?php 136 137 } 137 138 } … … 143 144 * @param $content 144 145 */ 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; 148 150 } 149 151 ob_start(); … … 152 154 $this->wpc_location(); 153 155 } 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); 160 164 $wpc_cat_sort_arr = []; 161 165 $i = 0; 162 166 163 foreach ( $wpc_cat_arr as $value) {167 foreach ($wpc_cat_arr as $value) { 164 168 $i++; 165 169 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 == '') { 169 173 $wpc_cat_sort_arr[$i] = $value; 170 174 } else { … … 172 176 } 173 177 } 174 175 } 176 ksort( $wpc_cat_sort_arr ); 178 } 179 ksort($wpc_cat_sort_arr); 177 180 $current = ''; 178 181 ?> … … 180 183 <ul class="wpc-nav"> 181 184 <?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 197 196 } 197 } 198 198 ?> 199 199 </ul> 200 200 <div class='wpc-tab-content'> 201 201 <?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') { 221 261 ?> 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> 228 266 </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 ?> 253 270 </div> 254 271 </div> 255 272 </div> 256 < ?php } ?>257 < /div>273 </div> 274 <?php } ?> 258 275 </div> 259 <?php 260 } 276 </div> 277 <?php 278 } 261 279 ?> 262 280 </div> 263 281 </div> 264 <?php282 <?php 265 283 $contents = ob_get_clean(); 266 284 return $contents; … … 272 290 * @param Type $var 273 291 */ 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; 277 296 } 278 297 ob_start(); … … 282 301 } 283 302 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 )); 287 307 288 308 // category sorting from backend 289 $wpc_cat_arr = explode( ',', $wpc_food_catgeries);309 $wpc_cat_arr = explode(',', $wpc_food_catgeries); 290 310 291 311 $args = array( … … 296 316 'post_status' => 'publish', 297 317 'suppress_filters' => false, 298 318 299 319 ); 300 if (is_array( $wpc_cat_arr ) && count( $wpc_cat_arr )>0) {320 if (is_array($wpc_cat_arr) && count($wpc_cat_arr) > 0) { 301 321 $args['tax_query'] = array( 302 322 array( … … 310 330 }; 311 331 $products = wc_get_products($args); 312 ?>332 ?> 313 333 <div class='wpc-food-wrapper'> 314 334 <?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 ?> 323 387 </div> 324 388 </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 <?php335 echo esc_html__(get_the_excerpt( $product->get_id() ) , 'wpcafe');336 // show cart button337 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 <?php345 }346 ?>347 </div>348 389 </div> 349 </div>350 390 <?php } ?> 351 391 </div> … … 360 400 * 361 401 */ 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')) { 364 405 return; 365 406 } 366 407 $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 370 413 $wpc_cart_icon = ''; 371 414 $wpc_custom_css = ''; 372 415 373 416 // icon 374 if ( isset( $settings['wpc_mini_cart_icon'] )) {417 if (isset($settings['wpc_mini_cart_icon'])) { 375 418 $wpc_cart_icon = $settings['wpc_mini_cart_icon'] != '' ? $settings['wpc_mini_cart_icon'] : 'wpcafe-cart_icon'; 376 419 } else { … … 379 422 380 423 // cart bg color 381 if ( isset( $settings['wpc_primary_color'] )) {424 if (isset($settings['wpc_primary_color'])) { 382 425 $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) . '}'; 384 427 //button 385 428 $wpc_custom_css .= ' … … 390 433 .wpc-food-menu-item .wpc-add-to-cart a, 391 434 .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) . ' 393 436 } 394 437 … … 398 441 399 442 .wpc-food-tab-wrapper .wpc-nav li a.wpc-active{ 400 color : ' . esc_attr( $bg_color) . '443 color : ' . esc_attr($bg_color) . ' 401 444 } 402 445 .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) . ' 404 447 } 405 448 .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; 407 450 } 408 451 409 452 '; 410 453 // 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) . '}'; 413 455 } else { 414 456 $wpc_custom_css .= '.wpc_background_color { background-color : #d5d5d5 }'; 415 457 //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') . '}'; 417 459 } 418 460 419 461 // cart icon color 420 if ( isset( $settings['wpc_secondary_color'] )) {462 if (isset($settings['wpc_secondary_color'])) { 421 463 $color = $settings['wpc_secondary_color'] ? $settings['wpc_secondary_color'] : "#d5d5d5 "; 422 464 423 465 //button hover 424 466 $wpc_custom_css .= ' … … 430 472 .wpc-settings-dashboard .button-primary:focus, 431 473 #wpc_location_modal .wpc-close { 432 background-color : ' . esc_attr( $color) . '474 background-color : ' . esc_attr($color) . ' 433 475 } 434 476 '; 435 477 // 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) . '}'; 437 479 // count 438 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( $color ) . '}'; 439 480 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr($color) . '}'; 440 481 } else { 441 482 $wpc_custom_css .= 'a.wpc_cart_icon i { color : #000}'; 442 483 //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') . '}'; 444 485 // 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) . '}'; 446 487 // count 447 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr( '#fff') . '}';488 $wpc_custom_css .= '.cart-items-count { color : ' . esc_attr('#fff') . '}'; 448 489 } 449 490 // 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 ?> 454 495 <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> 461 502 <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> 465 506 </li> 466 507 </ul> 467 <?php508 <?php 468 509 } 469 510 } … … 474 515 * @param [type] $fragments 475 516 */ 476 public function wpc_add_to_cart_count_fragment_refresh( $fragments ) { 517 public function wpc_add_to_cart_count_fragment_refresh($fragments) 518 { 477 519 ob_start(); 478 520 ?> … … 480 522 <?php echo WC()->cart->get_cart_contents_count(); ?> 481 523 </div> 482 <?php524 <?php 483 525 $fragments['#wpc-mini-cart-count'] = ob_get_clean(); 484 526 return $fragments; … … 490 532 * @param [type] $fragments 491 533 */ 492 public function wpc_add_to_cart_content_fragment_refresh( $fragments ) { 534 public function wpc_add_to_cart_content_fragment_refresh($fragments) 535 { 493 536 ob_start(); 494 ?>537 ?> 495 538 <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'; ?> 497 540 </div> 498 <?php541 <?php 499 542 $fragments['div.widget_shopping_cart_content'] = ob_get_clean(); 500 543 return $fragments; … … 505 548 * 506 549 */ 507 public function wpc_location_checkout_form() { 550 public function wpc_location_checkout_form() 551 { 508 552 $domain = 'woocommerce'; 509 553 $checkout = WC()->checkout; 510 ?>554 ?> 511 555 <div id="wpc_location_field"> 512 <?php556 <?php 513 557 // 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]); 515 559 $wpc_loctaion_arr = ['' => 'Select a loctaion']; 516 560 517 foreach ( $wpc_loctaion as $value) {561 foreach ($wpc_loctaion as $value) { 518 562 $wpc_loctaion_arr["$value->slug"] = $value->name; 519 563 } 520 woocommerce_form_field( 'wpc_location_name', [564 woocommerce_form_field('wpc_location_name', [ 521 565 'type' => 'select', 522 566 '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), 525 569 'required' => true, 526 570 'options' => $wpc_loctaion_arr, 527 ], $checkout->get_value( 'wpc_location_name' ));528 ?>571 ], $checkout->get_value('wpc_location_name')); 572 ?> 529 573 </div> 530 <?php574 <?php 531 575 } 532 576 … … 535 579 * 536 580 */ 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'); 540 585 } 541 586 } … … 546 591 * @param [type] $order 547 592 */ 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'])); 552 598 } 553 599 } … … 557 603 * 558 604 */ 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 ?> 561 608 <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> 563 610 <input type="text" name="wpc_menu_order_priority" id="wpc_menu_order_priority"> 564 611 </div> 565 <?php612 <?php 566 613 } 567 614 … … 571 618 * @param [type] $term 572 619 */ 573 public function wpc_product_cat_taxonomy_edit_meta_field( $term ) { 620 public function wpc_product_cat_taxonomy_edit_meta_field($term) 621 { 574 622 575 623 //getting term ID 576 624 $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 ?> 579 627 <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> 581 629 <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) : ''; ?>"> 584 631 </td> 585 632 </tr> 586 <?php633 <?php 587 634 } 588 635 … … 592 639 * @param [type] $term 593 640 */ 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); 597 645 } 598 646 … … 602 650 * @param mixed $columns 603 651 */ 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'); 607 656 return $columns; 608 657 } … … 615 664 * @param int $id term ID 616 665 */ 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); 623 673 } 624 674 -
wp-cafe/trunk/plugin.php
r2341364 r2343218 14 14 final class Plugin{ 15 15 16 const version = '1.0. 4';16 const version = '1.0.5'; 17 17 18 18 private static $instance; -
wp-cafe/trunk/readme.txt
r2341364 r2343218 1 1 === WP Cafe === 2 Contributors: ataurr, themewinter, rezakhan995, abrasel600,nitu4564102 Contributors: ataurr, themewinter, abrasel600, rezakhan995, nitu456410 3 3 Tags: reservation, restaurant menu, food menu, restaurant, food delivery 4 4 Requires at least: 5.2 5 5 Tested up to: 5.4 6 Stable tag: 1.0. 46 Stable tag: 1.0.5 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 50 50 51 51 == 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 52 60 53 61 = 1.0.4 = -
wp-cafe/trunk/widgets/wpc-food-menu-tab/style/style-1.php
r2335589 r2343218 81 81 <div class="<?php echo esc_attr($col); ?>"> 82 82 <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()) { ?> 88 85 <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; 93 91 ?> 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 } ?> 96 109 </ul> 97 110 <?php } ?> 111 98 112 <h3 class="wpc-post-title wpc-title-with-border"> 99 113 <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 62 62 <div class="<?php echo esc_attr($col); ?>"> 63 63 <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 69 67 <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; 74 74 ?> 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 } ?> 77 92 </ul> 78 93 <?php } ?> 94 79 95 <h3 class="wpc-post-title wpc-title-with-border"> 80 96 <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 8 8 * Plugin Name: WP Cafe 9 9 * Plugin URI: https://product.themewinter.com/wpcafe 10 * Description: All in One WordPress Restaurant solution plugin11 * Version: 1.0. 410 * Description: WordPress Restaurant solution plugin to launch Restaurant Websites. 11 * Version: 1.0.5 12 12 * Author: Themewinter 13 13 * Author URI: http://themewinter.com/
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)