Created
October 6, 2015 10:55
-
-
Save zarankumar/6a788f0cd0c4c8cdacf4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Custom Tabs for Opening Hours. **/ | |
function opening_hours_options_tab() { | |
?> | |
<li class="opening_hours"><a href="#opening_hours_data"><?php _e('Cab Price Settings', 'yatramantra'); ?></a></li> | |
<li class="opening_hours"><a href="#opening_hours_data"><?php _e('Hotel Price Settings', 'yatramantra'); ?></a></li> | |
<?php | |
} | |
add_action('woocommerce_product_write_panel_tabs', 'opening_hours_options_tab'); | |
/** | |
* Custom Tab Options | |
* | |
* Provides the input fields and add/remove buttons for custom tabs on the single product page. | |
*/ | |
function opening_hours_options() { | |
global $post; | |
$opening_hours_options = array( | |
'title' => get_post_meta($post->ID, 'opening_hours_title', true), | |
'content' => get_post_meta($post->ID, 'opening_hours_content', true), | |
); | |
?> | |
<div id="opening_hours_data" class="panel woocommerce_options_panel"> | |
<div class="club-opening-hours"> | |
<p class="form-field"> | |
<?php | |
// Opening Hours Custom field Type | |
?> | |
<p class="form-field day_field_type"> | |
<label for="day_field_type"><?php echo __( 'Opening Hours', 'woocommerce' ); ?></label> | |
<span class="wrap"> | |
</span> | |
<span class="description"><?php _e( 'e.g. 06:00-22:00', 'woocommerce' ); ?></span> | |
</p> | |
</div> | |
</div> | |
<?php | |
} | |
add_action('woocommerce_product_write_panels', 'opening_hours_options'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment