- bootstrap with typeahead
- jquery
This will use bootstrap with typeahead to create an autocomplete search.
/** 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'); | |
/** |
function so_31493236_sale_price( $sale_price, $product ) { | |
$sale_price = $product->get_regular_price() * 0.15; | |
return $sale_price; | |
} | |
add_filter( 'woocommerce_get_sale_price', 'so_31493236_sale_price', 10, 2 ); |
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter | |
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' ); | |
function add_my_custom_product_data_tab( $product_data_tabs ) { | |
$product_data_tabs['my-custom-tab'] = array( | |
'label' => __( 'My Custom Tab', 'my_text_domain' ), | |
'target' => 'my_custom_product_data', | |
); | |
return $product_data_tabs; | |
} |
<?php | |
add_filter( 'woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 3); | |
function attach_terms_conditions_pdf_to_email ( $attachments , $id, $object ) { | |
$your_pdf_path = get_template_directory() . '/terms.pdf'; | |
$attachments[] = $your_pdf_path; | |
return $attachments; | |
} |
// Send Email | |
require_once 'Mandrill.php'; | |
$mandrill = new Mandrill($apikey); | |
$message = new stdClass(); | |
$message->html = "html message"; | |
$message->text = "text body"; | |
$message->subject = "email subject"; | |
$message->from_email = "address@test.com"; |
Login to super user | |
su <password> | |
sudo gksudo mdmsetup | |
<?php | |
/* | |
Plugin Name: Dashboard Widget Example Plugin | |
Plugin URI: http://example.com/wordpress-plugins/my-plugin | |
Description: A plugin to create dashboard widgets in WordPress | |
Version: 1.0 | |
Author: Brad Williams | |
Author URI: http://wrox.com | |
License: GPLv2 | |
*/ |
<?php | |
/* | |
Plugin Name: Widget Example Plugin | |
Plugin URI: http://example.com/wordpress-plugins/my-plugin | |
Description: A plugin to create widgets in WordPress | |
Version: 1.0 | |
Author: Brad Williams | |
Author URI: http://wrox.com | |
License: GPLv2 | |
*/ |
/** | |
* This function allows you to retrieve the wp_get_attachment_image_src() | |
* data for any post's featured image on your network. If you are running | |
* a multisite network, you can supply another blog's ID to retrieve a post's | |
* featured image data from another site on your WordPress multisite network. | |
* | |
* Does not take care of icon business (at this time). | |
* | |
* If successful, this function returns an array of the following: | |
* [0] => url |