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_before_cart', 'display_total_weight_notice' ); | |
add_filter( 'woocommerce_before_checkout_form', 'display_total_weight_notice' ); | |
function display_total_weight_notice( $message ) { | |
// DEFINE the allowed weight limit | |
$allowed_weight = 3; | |
$cart_total_weight = WC()->cart->get_cart_contents_weight(); | |
if( cart_total_weight <= $allowed_weight ) : | |
wc_print_notice( sprintf( |
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
//Remove old button which submiting form: | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
//Add ajax-link from archive page to single product page: | |
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_loop_add_to_cart', 30 ); |
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
/** | |
* Put this in your functions.php file | |
*/ | |
function change_submenu_class($menu) { | |
$menu = preg_replace('/ class="sub-menu"/','/ class="sc-dropdown" /',$menu); | |
return $menu; | |
} | |
add_filter('wp_nav_menu','change_submenu_class'); |
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
/** | |
* Change currency display in WooCommerce | |
* Put this in your functions.php file | |
*/ | |
function softiconic_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'USD': | |
$currency_symbol = 'USD $'; | |
break; | |
case 'CAD': |
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
/** | |
* remove shipping method - Cart page | |
* Put this in your functions.php file | |
*/ | |
function disable_shipping_calc_on_cart( $show_shipping ) { | |
if( is_cart() ) { | |
return false; | |
} | |
return $show_shipping; | |
} |
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
//Elementor Function Code | |
class ElementorCustomElement | |
{ | |
private static $instance = null; | |
public static function get_instance() | |
{ | |
if (!self::$instance) | |
self::$instance = new self; | |
return self::$instance; | |
} |
NewerOlder