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: WooCommerce Product Fees Prefix Addition | |
* Description: Add a prefix to the additional fees that is shown at checkout in front of the fee name. | |
* Version: 1.0 | |
* Author: Caleb Burks | |
* Author URI: http://calebburks.com | |
*/ | |
// Exit if accessed directly |
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_is_purchasable', '__return_true'); |
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
// Remove '(Free)' or '(FREE!)' label text on cart page for Shipping and Handling if cost equal to $0 | |
function woo_ninja_custom_shipping_free_label( $label ) { | |
$label = str_replace( "(Free)", "New Text Here", $label ); | |
$label = str_replace( "(FREE!)", "New Text Here", $label ); | |
return $label; | |
} | |
add_filter( 'woocommerce_cart_shipping_method_full_label' , 'woo_ninja_custom_shipping_free_label' ); |
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 | |
/** | |
* Add Product Settings Section to the Admin | |
*/ | |
add_action( 'wcepe_after_transients_settings', 'wcepe_custom_settings_section' ); | |
function wcepe_custom_settings_section() { | |
// Transient Section |
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
function wc_ninja_free_shipping_for_a_user_role( $rates, $package ) { | |
// Only modify rates if free_shipping is present | |
if ( isset( $rates['free_shipping'] ) ) { | |
// Add a user role specific capability here | |
if ( ! current_user_can( 'manage_woocommerce' ) ) { | |
// Cart Subtotal | |
$subtotal = WC()->cart->subtotal; | |
// Number of products in the cart |
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_after_shop_loop_item_title', 'wc_ninja_add_short_desc', 15 ); | |
function wc_ninja_add_short_desc() { | |
global $post; | |
echo '<p>' . $post->post_excerpt . '</p>'; | |
} |
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 | |
function get_products_in_cart2() { | |
$cart_ids = array(); | |
foreach( WC()->cart->get_cart() as $cart_item_key => $values ) { | |
$cart_product = $values['data']; | |
$cart_ids[] = $cart_product->id; | |
} | |
return $cart_ids; | |
} |
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 | |
// Display subtitle after the header for posts and pages | |
add_action( 'storefront_single_post', 'storefront_add_subtitle_after_header', 15 ); | |
add_action( 'storefront_page', 'storefront_add_subtitle_after_header', 15 ); | |
function storefront_add_subtitle_after_header() { | |
the_subtitle( "<h2 class='subtitle'>", "</h2>" ); | |
} | |
// Display subtitle in the header for posts |
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_single_product_summary', 'wc_ninja_add_brand_to_product_page', 19 ); | |
function wc_ninja_add_brand_to_product_page() { | |
echo do_shortcode('[product_brand width="64px" height="64px" class="alignright"]'); | |
} |
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_sortable_taxonomies','wt_sort_brands' ); | |
function wt_sort_brands( $sortable ) { | |
$sortable[] = 'product_brand'; | |
return $sortable; | |
} |
OlderNewer