Changeset 2700472
- Timestamp:
- 03/28/2022 07:36:31 AM (3 years ago)
- Location:
- tourfic/trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
tourfic/trunk/admin/assets/js/admin.js
r2696074 r2700472 1 /** 2 * Ajax install 3 * 4 * @since 1.0 5 */ 6 (function($) { 1 (function($) { 7 2 8 3 $(document).ready(function(){ 9 4 5 // Create an instance of Notyf 6 const notyf = new Notyf({ 7 ripple: true, 8 dismissable: true, 9 duration: 3000, 10 position: { 11 x: 'right', 12 y: 'bottom', 13 }, 14 }); 15 16 /** 17 * Tour location required 18 * 19 * show notyf error 20 */ 21 $(document).on('click', '.post-type-tf_tours #publish, .post-type-tf_tours #save-post', function(e) { 22 if( $('textarea[name="tf_tours_option[text_location]"]').val().length === 0 ) { 23 e.preventDefault; 24 e.stopImmediatePropagation(); 25 notyf.error('Tour Location is a required field!'); 26 return false; 27 } 28 }); 29 30 /** 31 * Ajax install 32 * 33 * @since 1.0 34 */ 10 35 $(document).on('click', '.tf-install', function(e) { 11 36 e.preventDefault(); -
tourfic/trunk/admin/inc/functions.php
r2696074 r2700472 102 102 wp_localize_script( 'tf-required', 'tf_params', array( 103 103 'taxonomies' => $post_types[ $post_type ], 104 'error' => false 104 'error' => false, 105 'tour_location_required' => __('Tour Location is a required field!', 'tourfic'), 105 106 ) 106 107 ); -
tourfic/trunk/admin/options/global/parts/miscellaneous.php
r2696074 r2700472 68 68 69 69 ) ); 70 71 /** 72 * Permalink Settings 73 * 74 * Sub Menu 75 */ 76 CSF::createSection( $prefix, array( 77 'parent' => 'miscellaneous', 78 'title' => __( 'Permalink Settings', 'tourfic' ), 79 'fields' => array( 80 81 array( 82 'type' => 'subheading', 83 'content' => __('Permalink Settings', 'tourfic' ), 84 ), 85 86 array( 87 'type' => 'content', 88 'content' => __('For permalink settings go to default <a href="' .get_admin_url(). 'options-permalink.php">permalink settings page</a>.', 'tourfic' ), 89 ), 90 91 ) 92 93 ) ); 70 94 ?> -
tourfic/trunk/assets/css/style.css
r2696074 r2700472 179 179 justify-content: center; 180 180 padding: 20px; 181 background-position: center center; 182 background-size: cover; 181 183 } 182 184 -
tourfic/trunk/assets/css/tourfic-styles.css
r2696074 r2700472 51 51 .tf_content { 52 52 width: 75%; 53 box-sizing: border-box; 53 54 } 54 55 55 56 .tf_sidebar { 56 57 width: 25%; 58 box-sizing: border-box; 57 59 } 58 60 … … 265 267 } 266 268 267 .slick-slide {268 display: none;269 float: left;270 height: 100%;271 min-height: 1px;272 }273 274 269 [dir=rtl] .slick-slide { 275 270 float: right; … … 358 353 height: 100%; 359 354 -o-object-fit: cover; 360 object-fit: cover; 355 object-fit: cover; 356 cursor: zoom-in; 361 357 } 362 358 -
tourfic/trunk/assets/css/tourfic.css
r2696074 r2700472 430 430 font-size: 12px; 431 431 } 432 433 /*================================ 434 | Theme based CSS Fix | 435 ================================*/ 436 /** 437 * Twenty Twenty Two 438 */ 439 /* Slick SLider*/ 440 .single-tf_hotel.theme-twentytwentytwo .slick-slide { 441 height: auto !important; 442 } 443 .single-tf_hotel.theme-twentytwentytwo .slick-slide img{ 444 height: auto !important; 445 } 446 .single-tf_tours.theme-twentytwentytwo .tf-tour-booking-wrap { 447 height: auto !important; 448 } -
tourfic/trunk/assets/js/tourfic.js
r2696074 r2700472 212 212 dots: false, 213 213 centerMode: false, 214 asNavFor: '.tf_slider-nav', 215 variableWidth: true 216 }); 217 218 $('.single-slider-wrapper .tf_slider-nav').slick({ 219 slidesToShow: 4, 220 slidesToScroll: 1, 221 asNavFor: '.tf_slider-for', 222 dots: false, 223 arrows: false, 224 centerMode: true, 225 focusOnSelect: true 214 variableWidth: false, 226 215 }); 227 216 -
tourfic/trunk/inc/functions.php
r2697462 r2700472 312 312 */ 313 313 if ( !function_exists('tf_admin_role_caps') ) { 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 314 function tf_admin_role_caps() { 315 316 if ( get_option( 'tf_admin_caps' ) < 1 ) { 317 $admin_role = get_role( 'administrator' ); 318 $editor_role = get_role( 'editor' ); 319 320 // Add a new capability. 321 $caps = array ( 322 // Hotels 323 'edit_tf_hotel', 324 'read_tf_hotel', 325 'delete_tf_hotel', 326 'edit_tf_hotels', 327 'edit_others_tf_hotels', 328 'publish_tf_hotels', 329 'read_private_tf_hotels', 330 'delete_tf_hotels', 331 'delete_private_tf_hotels', 332 'delete_published_tf_hotels', 333 'delete_others_tf_hotels', 334 'edit_private_tf_hotels', 335 'edit_published_tf_hotels', 336 'create_tf_hotels', 337 // Tours 338 'edit_tf_tours', 339 'read_tf_tours', 340 'delete_tf_tours', 341 'edit_tf_tourss', 342 'edit_others_tf_tourss', 343 'publish_tf_tourss', 344 'read_private_tf_tourss', 345 'delete_tf_tourss', 346 'delete_private_tf_tourss', 347 'delete_published_tf_tourss', 348 'delete_others_tf_tourss', 349 'edit_private_tf_tourss', 350 'edit_published_tf_tourss', 351 'create_tf_tourss', 352 ); 353 354 foreach ( $caps as $cap ) { 355 $admin_role->add_cap( $cap ); 356 $editor_role->add_cap( $cap ); 357 } 358 359 update_option( 'tf_admin_caps', 1 ); 360 } 361 } 362 add_action( 'admin_init', 'tf_admin_role_caps', 999 ); 363 363 } 364 364 -
tourfic/trunk/inc/functions/functions-hotel.php
r2696074 r2700472 50 50 'query_var' => true, 51 51 'menu_icon' => 'dashicons-building', 52 'rewrite' => array( 'slug' => $hotel_slug ),52 'rewrite' => array( 'slug' => $hotel_slug, 'with_front' => false ), 53 53 'capability_type' => array( 'tf_hotel', 'tf_hotels' ), 54 54 'has_archive' => true, … … 148 148 'show_in_nav_menus' => true, 149 149 'query_var' => true, 150 'rewrite' => array('slug' => $hotel_location_slug ),150 'rewrite' => array('slug' => $hotel_location_slug, 'with_front' => false ), 151 151 'show_admin_column' => true, 152 152 'show_in_rest' => true, … … 324 324 $pricing_by = !empty($room['pricing-by']) ? $room['pricing-by'] : ''; 325 325 326 if ($form_total_person < $total_person) {326 if ($form_total_person <= $total_person) { 327 327 ?> 328 328 <tr> … … 691 691 dateFormat: "Y/m/d", 692 692 allowInput: true, 693 minDate: "today", 693 694 }); 694 695 -
tourfic/trunk/inc/functions/functions-tour.php
r2696338 r2700472 53 53 'query_var' => true, 54 54 'menu_icon' => 'dashicons-location-alt', 55 'rewrite' => array( 'slug' => $tour_slug ),55 'rewrite' => array( 'slug' => $tour_slug, 'with_front' => false ), 56 56 'capability_type' => array( 'tf_tours', 'tf_tourss' ), 57 57 'has_archive' => true, … … 151 151 'show_in_nav_menus' => true, 152 152 'query_var' => true, 153 'rewrite' => array('slug' => $tour_destination_slug ),153 'rewrite' => array('slug' => $tour_destination_slug, 'with_front' => false ), 154 154 'show_admin_column' => true, 155 155 'show_in_rest' => true, … … 348 348 $meta = get_post_meta( $post_id, 'tf_tours_option', true ); 349 349 $tour_type = !empty($meta['type']) ? $meta['type'] : ''; 350 // Continuous custom availability 351 $custom_avail = !empty($meta['custom_avail']) ? $meta['custom_avail'] : ''; 350 352 351 353 if ($tour_type == 'fixed') { … … 358 360 } elseif ($tour_type == 'continuous') { 359 361 360 $custom_avail = !empty($meta['custom_avail']) ? $meta['custom_avail'] : '';361 362 $disabled_day = !empty($meta['disabled_day']) ? $meta['disabled_day'] : ''; 362 363 $disable_range = !empty($meta['disable_range']) ? $meta['disable_range'] : ''; … … 384 385 $times = []; 385 386 386 if ($ meta['custom_avail']== true && !empty($meta['cont_custom_date'])) {387 if ($custom_avail == true && !empty($meta['cont_custom_date'])) { 387 388 $allowed_times = array_map(function ($v) { 388 389 return $times[] = ['date' => $v['date'], 'times' => array_map(function ($v) { … … 391 392 }, $meta['cont_custom_date']); 392 393 } 393 if ($meta['custom_avail'] == false && !empty($meta['allowed_time'])) { 394 395 if ($custom_avail == false && !empty($meta['allowed_time'])) { 394 396 $allowed_times = array_map(function ($v) { 395 return $v['time']; 396 397 return $v['time']; 397 398 }, $meta['allowed_time'] ?? []); 398 399 } … … 407 408 <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16.5 6a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0zM18 6A6 6 0 1 0 6 6a6 6 0 0 0 12 0zM3 23.25a9 9 0 1 1 18 0 .75.75 0 0 0 1.5 0c0-5.799-4.701-10.5-10.5-10.5S1.5 17.451 1.5 23.25a.75.75 0 0 0 1.5 0z"></path></svg> 408 409 </span> 409 <?php if ($ meta['custom_avail']== true || (!$disable_adult_price && $adult_price != false)) { ?>410 <?php if ($custom_avail == true || (!$disable_adult_price && $adult_price != false)) { ?> 410 411 <div class="adults-text"><?php echo (!empty($adults) ? $adults : '0') . ' ' . __("Adults", "tourfic"); ?></div> 411 412 <?php } ?> 412 <?php if ($ meta['custom_avail']== true || (!$disable_child_price && $child_price != false)) { ?>413 <?php if ($custom_avail == true || (!$disable_child_price && $child_price != false)) { ?> 413 414 <div class="person-sep"></div> 414 415 <div class="child-text"><?php echo (!empty($child) ? $child : '0') . ' ' . __("Children", "tourfic"); ?></div> 415 416 <?php } ?> 416 <?php if ($ meta['custom_avail']== true || (!$disable_infant_price && $infant_price != false)) { ?>417 <?php if ($custom_avail == true || (!$disable_infant_price && $infant_price != false)) { ?> 417 418 <div class="person-sep"></div> 418 419 <div class="infant-text"><?php echo (!empty($infant) ? $infant : '0') . ' ' . __("Infant", "tourfic"); ?></div> … … 421 422 <div class="tf_acrselection-wrap" style="display: none;"> 422 423 <div class="tf_acrselection-inner"> 423 <?php if ($ meta['custom_avail']== true || (!$disable_adult_price && $adult_price != false)) { ?>424 <?php if ($custom_avail == true || (!$disable_adult_price && $adult_price != false)) { ?> 424 425 <div class="tf_acrselection"> 425 426 <div class="acr-label"><?php _e('Adults', 'tourfic'); ?></div> … … 431 432 </div> 432 433 <?php } ?> 433 <?php if ($ meta['custom_avail']== true || (!$disable_child_price && $child_price != false)) { ?>434 <?php if ($custom_avail == true || (!$disable_child_price && $child_price != false)) { ?> 434 435 <div class="tf_acrselection"> 435 436 <div class="acr-label"><?php _e('Children', 'tourfic'); ?></div> … … 441 442 </div> 442 443 <?php } ?> 443 <?php if ($ meta['custom_avail']== true || (!$disable_infant_price && $infant_price != false)) { ?>444 <?php if ($custom_avail == true || (!$disable_infant_price && $infant_price != false)) { ?> 444 445 <div class="tf_acrselection"> 445 446 <div class="acr-label"><?php _e('Infant', 'tourfic'); ?></div> … … 484 485 485 486 const allowed_times = JSON.parse('<?php echo wp_json_encode($allowed_times ?? []) ?>'); 486 const custom_avail = '<?php echo $ meta['custom_avail']?>';487 const custom_avail = '<?php echo $custom_avail; ?>'; 487 488 if (custom_avail == false && allowed_times.length > 0) { 488 489 populateTimeSelect(allowed_times) -
tourfic/trunk/inc/functions/woocommerce/wc-hotel.php
r2696074 r2700472 103 103 //$response['errors'][] = $pricing_by; 104 104 // If no errors then process 105 if( 0 == count( $response['errors'] )) {105 if(!array_key_exists('errors', $response) || count($response['errors']) == 0) { 106 106 107 107 $tf_room_data['tf_hotel_data']['order_type'] = 'hotel'; … … 116 116 $tf_room_data['tf_hotel_data']['room_name'] = $room_name; 117 117 118 $tf_room_data['tf_hotel_data']['price'] = $get_room_type['price'];119 $tf_room_data['tf_hotel_data']['sale_price'] = $get_room_type['sale_price'];120 121 118 if ($pricing_by == '1') { 122 119 $total_price = $rooms[$room_id]['price']; -
tourfic/trunk/inc/functions/woocommerce/wc-tour.php
r2696074 r2700472 25 25 $tour_type = !empty($meta['type']) ? $meta['type'] : ''; 26 26 27 // If continuous is selected but pro is not activated return 28 if ($tour_type == 'continuous' && !defined( 'TF_PRO' )) { 27 /** 28 * If fixed is selected but pro is not activated 29 * 30 * show error 31 * 32 * @return 33 */ 34 if ($tour_type == 'fixed' && !defined( 'TF_PRO' )) { 35 $response['errors'][] = __( 'Fixed Availability is selected but Tourfic Pro is not activated!', 'tourfic' ); 36 $response['status'] = 'error'; 37 echo wp_json_encode( $response ); 38 die(); 29 39 return; 30 40 } 41 31 42 if ($tour_type == 'fixed') { 32 43 … … 53 64 } else { 54 65 66 } 67 68 /** 69 * If continuous custom availability is selected but pro is not activated 70 * 71 * Show error 72 * 73 * @return 74 */ 75 if ($tour_type == 'continuous' && $custom_avail == true && !defined( 'TF_PRO' )) { 76 $response['errors'][] = __( 'Custom Continous Availability is selected but Tourfic Pro is not activated!', 'tourfic' ); 77 $response['status'] = 'error'; 78 echo wp_json_encode( $response ); 79 die(); 80 return; 55 81 } 56 82 … … 243 269 * Add to cart with custom data 244 270 */ 245 if ( 0 == count( $response['errors'] )) {271 if (!array_key_exists('errors', $response) || count($response['errors']) == 0) { 246 272 247 273 $tf_tours_data['tf_tours_data']['order_type'] = 'tour'; -
tourfic/trunk/readme.txt
r2696074 r2700472 2 2 Contributors: fida02, themefic, devkabir, mdshuvo, codexa, kamrul0424, raihan143, hasanet 3 3 Tags: tour booking, tour operator, travel, tour, trip, travel-booking, travel agency, hotel booking, reservation, hotel, booking engine, booking, booking calendar, booking system, calendar, online booking, travel, airbnb, booking.com, homeaway, apartments, villa, hostel, reservation system, travel itinerary, trekking, tour itinerary, travel booking engine, tour accommodation listings, travel destinations, trip book, travel payment, woocommerce tour booking, woocommerce travel booking plugin, woocommerce tour, woocommerce travel, wordpress travel, wp travel plugin, wp travel, wordpress travel booking plugin, wordpress tour plugin, tour booking plugin wordpress, wordpress travel agency, travel tour wordpress, wordpress tour, tour-booking, travel wp, travel wordpress, tour wp, travel wordpress, hotel wp, hotel wordpress 4 Requires at least: 4.74 Requires at least: 5.4 5 5 Tested up to: 5.9.2 6 Stable tag: 2.1. 06 Stable tag: 2.1.1 7 7 Requires PHP: 7.1 8 8 License: GPLv2 or later … … 196 196 197 197 == Changelog == 198 199 = 2.1.1 - 28/03/2022 = 200 201 * Added: Tour location is required warning on tour publish/edit page. 202 * Added: Permalink settings page on Global settings section 203 * Fixed: Tour booking issue 204 * Fixed: Tour description visibility issue 205 * Fixed: Single tour hero section background position and size. 206 * Fixed: Hotel room availability based on person number 207 * Fixed: Hotel booking calendar minimum date set to today date 208 * Fixed: Tour and hotel permalink structure 209 * Fixed: Tour and hotel's terms and conditions auto paragraph issue 210 * Fixed: Compatible issue with Twenty Twenty Two theme 211 * Fixed: PHP variable error while booking through WooCommerce 212 * Removed: Hotel gallery thumbnails 198 213 199 214 = 2.1.0 - 18/03/2022 = -
tourfic/trunk/templates/hotel/single-hotel.php
r2696074 r2700472 218 218 <div class="swiper-button-next sw-btn"><i class="fa fa-angle-right"></i></div> 219 219 </div> 220 <div class="single-slider-wrapper fl-wrap">221 <div class="tf_slider-nav fl-wrap">222 <?php foreach ( (array) $gallery_ids as $attachment_id ) {223 echo '<div class="slick-slide-item">';224 echo wp_get_attachment_image( $attachment_id, 'thumbnail' );225 echo '</div>';226 } ?>227 </div>228 </div>229 220 </div> 230 221 </div> … … 474 465 <div class="tf_toc-wrap"> 475 466 <div class="tf_toc-inner"> 476 <?php echo $tc; ?>467 <?php echo wpautop($tc); ?> 477 468 </div> 478 469 </div> … … 494 485 <?php endwhile; ?> 495 486 <?php 496 get_footer( 'tourfic');487 get_footer(); -
tourfic/trunk/templates/tour/single-tour.php
r2696074 r2700472 41 41 } 42 42 $hero_title = !empty($meta['hero_title']) ? $meta['hero_title'] : ''; 43 43 44 // Highlights 44 45 $highlights = !empty($meta['additional_information']) ? $meta['additional_information'] : ''; … … 211 212 <div class="tf-row"> 212 213 <div class="tf-overview-content-wrapper"> 213 < div class="tf-overview-item">214 <div class="tf-overview- text">215 < h2><?php _e( 'Highlights','tourfic' ); ?></h2>216 <?php echo $highlights; ?>217 218 </div>219 <div class="tf-ohi-image">220 <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id(), 'tf_gallery_thumb' ); ?>" alt="">221 </div>222 </div>223 <?php if( $highlights ): ?>224 <div class="">214 <?php if($highlights) { ?> 215 <div class="tf-overview-item"> 216 <div class="tf-overview-text"> 217 <h2><?php _e( 'Highlights','tourfic' ); ?></h2> 218 <?php echo $highlights; ?> 219 </div> 220 <div class="tf-ohi-image"> 221 <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id(), 'tf_gallery_thumb' ); ?>" alt=""> 222 </div> 223 </div> 224 <?php } 225 if(get_the_content()) { ?> 225 226 <div class="tf-overview-text"> 226 227 <h2><?php _e( 'Overview','tourfic' ); ?></h2> 227 228 <?php the_content(); ?> 228 229 </div> 229 </div> 230 <?php endif; ?> 230 <?php } ?> 231 231 </div> 232 232 </div> … … 361 361 <h2><?php _e("Terms and Conditions", 'tourfic'); ?></h2> 362 362 <div class="tf-travel-itinerary-items-wrapper"> 363 <?php echo $terms_and_conditions; ?>363 <?php echo wpautop($terms_and_conditions); ?> 364 364 </div> 365 365 </div> -
tourfic/trunk/tourfic.php
r2696074 r2700472 8 8 * Text Domain: tourfic 9 9 * Domain Path: /lang/ 10 * Version: 2.1. 010 * Version: 2.1.1 11 11 * Tested up to: 5.9.2 12 12 * WC tested up to: 6.3.1 … … 92 92 */ 93 93 if ( !defined( 'TOURFIC' ) ) { 94 define( 'TOURFIC', '2.1. 0' );94 define( 'TOURFIC', '2.1.1' ); 95 95 } 96 96 … … 201 201 <div id="message" class="error"> 202 202 <p><?php printf( __( 'Tourfic requires %1$s WooCommerce %2$s to be activated.', 'tourfic' ), '<strong><a href="https://wordpress.org/plugins/woocommerce/" target="_blank">', '</a></strong>' ); ?></p> 203 <p><a class="install-now button tf-install" data-plugin-slug="woocommerce"><?php esc_attr_e( 'Install Now', 'tourfic' ); ?></a></p>203 <p><a class="install-now button" href="<?php echo esc_url( admin_url('/plugin-install.php?s=slug:woocommerce&tab=search&type=term') ); ?>"><?php esc_attr_e( 'Install Now', 'tourfic' ); ?></a></p> 204 204 </div> 205 205
Note: See TracChangeset
for help on using the changeset viewer.