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; | |
} |
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
/** | |
* 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
/** | |
* 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
//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
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
//Replace carousel images into background images. | |
$('#carousel .item img').each(function() { | |
var imgSrc = $(this).attr('src'); | |
$(this).parent().css({'background-image': 'url('+imgSrc+')'}); | |
$(this).remove(); | |
}); |
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
$(document).ready(function() { | |
// Define the offset | |
var offset = -200; // Adjust this value as needed | |
// Function to scroll to the target with offset | |
function scrollToTarget(target) { | |
$('html, body').animate({ | |
scrollTop: target.offset().top + offset | |
}, 1000); | |
} |
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
//**********Sticky Header********** | |
$(window).on('scroll', function (){ | |
var sticky = $('header'), | |
scroll = $(window).scrollTop(); | |
if (scroll >= 100) sticky.addClass('sticky'); | |
else sticky.removeClass('sticky'); | |
}); |
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
$('.dropdown-menu a.dropdown-toggle').on('click', function(e) { | |
if (!$(this).next().hasClass('show')) { | |
$(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); | |
} | |
var $subMenu = $(this).next(".dropdown-menu"); | |
$subMenu.toggleClass('show'); | |
$(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) { | |
$('.dropdown-submenu .show').removeClass("show"); | |
}); |
OlderNewer