This file contains hidden or 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
/** | |
* Hides the product's weight and dimension in the single product page. | |
*/ | |
add_filter( 'wc_product_enable_dimensions_display', '__return_false' ); |
This file contains hidden or 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_attribute_in_product_name', '__return_false' ); |
This file contains hidden or 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
/** | |
* Removes the attribute from the product title, in the cart. | |
* | |
* @return string | |
*/ | |
function remove_variation_from_product_title( $title, $cart_item, $cart_item_key ) { | |
$_product = $cart_item['data']; | |
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); | |
if ( $_product->is_type( 'variation' ) ) { |
This file contains hidden or 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_min_password_strength', create_function( '', 'return 2;' ) ); |
This file contains hidden or 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_remove_password_strength() { | |
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
} | |
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 ); |
This file contains hidden or 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 | |
/** | |
* Load a custom template for vendor taxonomy | |
*/ | |
function load_custom_vendor_template( $located, $template_name ) { | |
if( is_tax( WC_PRODUCT_VENDORS_TAXONOMY ) && 'archive-product.php' == $template_name ) { | |
return get_stylesheet_directory() . '/woocommerce/taxonomy-shop_vendor.php'; | |
} | |
return $located; |
This file contains hidden or 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
/** | |
* Checks if the customer is a reseller and | |
* returns false if they are trying to purchase from a specific category. | |
* | |
* @param bool $is_purchasable If the product is purchasable or not. | |
* @return bool | |
*/ | |
function limit_purchases_by_role( $is_purchasable, $product ) { | |
$categories = $product->get_category_ids(); |
This file contains hidden or 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_no_products_found', 'show_products_on_no_products_found', 20 ); | |
function show_products_on_no_products_found() { | |
echo '<h2>' . __( 'You may be interested in...', 'domain' ) . '</h2>'; | |
echo do_shortcode( '[recent_products per_page="4"]' ); | |
} |
This file contains hidden or 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( 'booking_form_params', 'change_booking_form_params' ); | |
function change_booking_form_params( $params ) { | |
$params['i18n_date_unavailable' = 'This date is unavailable'; | |
$params['i18n_date_fully_booked'] = 'This date is fully booked and unavailable'; | |
$params['i18n_date_partially_booked'] = 'This date is partially booked - but bookings still remain'; | |
$params['i18n_date_available'] = 'This date is available'; | |
$params['i18n_start_date'] = 'Choose a Start Date'; | |
$params['i18n_end_date'] = 'Choose an End Date'; | |
$params['i18n_dates'] = 'Dates'; | |
$params['i18n_choose_options'] = 'Please select the options for your booking above first'; |
This file contains hidden or 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( 'init', 'remove_footer_checkout' ); | |
function remove_footer_checkout() { | |
if ( is_checkout() ) { | |
remove_action( 'storefront_footer', 'storefront_handheld_footer_bar', 999 ); | |
} | |
} |