Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Remove script wd-woocommerce-quantity for auction products for Woodmart theme, this code snippet should go to child theme's functions.php file
- */
- function custom_enqueue_script() {
- $product = wc_get_product( get_the_ID() );
- if ( $product && $product->get_type() == 'auction') {
- wp_add_inline_script( 'wd-woocommerce-quantity', 'jQuery(document).ready(function($) { woodmartThemeModule.$document.off("click", ".plus, .minus"); });');
- }
- }
- add_action( 'wp_enqueue_scripts', 'custom_enqueue_script' , 9999 );
- /**
- * Remove Woodmart's ajax_add_to_cart from auction single page, this code snippet should go to child theme's functions.php file
- */
- add_filter( 'woodmart_ajax_add_to_cart', 'custom_remove_add_ajax_to_cart', 10 );
- function custom_remove_add_ajax_to_cart ( $data ){
- $product = wc_get_product( get_the_ID() );
- if ( is_product() ){
- if ( $product && $product->is_type('auction') ){
- return false;
- }
- }
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement