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 | |
/** | |
* 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
<?php | |
/** | |
* Change the default shortcode button text for both shortcodes | |
*/ | |
add_filter( 'wcepe_external_product_shortcode', 'wcepe_change_default_button_text' ); | |
add_filter( 'wcepe_recent_external_products_shortcode', 'wcepe_change_default_button_text' ); | |
function wcepe_change_default_button_text( $atts ) { |
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
/** | |
* Add Tracking Code to the Order Recieved Page | |
*/ | |
function wc_ninja_checkout_analytics( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$currency = $order->get_order_currency(); | |
$total = $order->get_total(); | |
$date = $order->order_date; | |
?> | |
<!-- Paste Tracking Code Under Here --> |
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_manipulate_shipping( $rates, $package ) { | |
// All available rates and their costs | |
//print_r($rates); | |
// All products in the cart and their costs | |
//print_r($package); | |
// Example of manipulating the cost of | |
// a shipping method based on the above variables. | |
if ( isset( $rates['flat_rate'] ) ) { |
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
<?php | |
/** | |
* Plugin Name: Conditional WooCommerce Checkout Fields | |
* Description: Adds the abilitiy to conditionally show / hide checkout fields. | |
* Version: 1.0 | |
* Author: Caleb Burks | |
* Author URI: http://calebburks.com | |
*/ | |
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>'; | |
} |
OlderNewer