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
<?php | |
// UPDATE: Stefan from Stack Overflow has explained a better way to handle cart item data. | |
// See http://stackoverflow.com/a/32327810/470480 | |
// ---------------------- | |
/* | |
Instructions: |
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
/** | |
* Each of these samples can be used - note that you should pick one rather than add them all. | |
* | |
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96 | |
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/ | |
**/ | |
/** | |
* Add a content block after all notices, such as the login and coupon notices. | |
* |
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
<?php | |
/* | |
Plugin Name: Homepage Settings for BigBang | |
Plugin URI: http://www.inboundnow.com/ | |
Description: Adds additional functionality to the big bang theme. | |
Author: David Wells | |
Author URI: http://www.inboundnow.com | |
*/ | |
// Specify Hooks/Filters |
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
// Add Downloadable Products to Woocommerce Completed Order & Invoice Emails as Attachments | |
add_filter( 'woocommerce_email_attachments', 'woocommerce_emails_attach_downloadables', 10, 3); | |
function woocommerce_emails_attach_downloadables($attachments, $status, $order) { | |
if ( ! is_object( $order ) || ! isset( $status ) ) { | |
return $attachments; | |
} | |
if ( empty( $order ) ) { |
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
1. Change post title in post list column | |
add_action( | |
'admin_head-edit.php', | |
'wpse152971_edit_post_change_title_in_list' | |
); | |
function wpse152971_edit_post_change_title_in_list() { | |
add_filter( | |
'the_title', | |
'wpse152971_construct_new_title', | |
100, |
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
<div class="row"> | |
<div class="small-12 columns"> | |
<ul class="tabs show-for-medium-up" data-tab> | |
<li class="tab-title active"><a href="#panel1">Tab / Accordion 1</a></li> | |
<li class="tab-title"><a href="#panel2">Tab / Accordion 2</a></li> | |
<li class="tab-title"><a href="#panel3">Tab / Accordion 3</a></li> | |
<li class="tab-title"><a href="#panel4">Tab / Accordion 4</a></li> | |
<li class="tab-title"><a href="#panel5">Tab / Accordion 5</a></li> | |
</ul> |
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
add_action( 'woocommerce_product_write_panel_tabs', 'woo_add_custom_admin_product_tab' ); | |
function woo_add_custom_admin_product_tab() { | |
?> | |
<li class="custom_tab"><a href="#custom_tab_data"><?php _e('Price Settings', 'woocommerce'); ?></a></li> | |
<?php | |
} | |
add_action( 'woocommerce_product_options_general_product_data', 'wdm_add_custom_settings' ); |
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
// add a product type | |
add_filter( 'product_type_selector', 'wdm_add_custom_product_type' ); | |
function wdm_add_custom_product_type( $types ){ | |
$types[ 'wdm_custom_product' ] = __( 'Tour package' ); | |
return $types; | |
} | |
add_action( 'plugins_loaded', 'wdm_create_custom_product_type' ); | |
function wdm_create_custom_product_type(){ | |
// declare the product class | |
class WC_Product_Wdm extends WC_Product{ |
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
add_filter('woocommerce_cart_item_name','ym_package_name'); | |
function ym_package_name() | |
{ | |
$wp_session = WP_Session::get_instance(); | |
return "Customized Kerala Tour Package"; | |
} |