merge tabs in woocommerce

the content from additional information is shown above the description content Because the following code calls wc_display_product_attributes() which displays the default content for the additional information tab: do_action( ‘woocommerce_product_additional_information’, $product ); To fix it, you can turn on output buffering, run the do_action() and then get the output using ob_get_clean(): function customizing_woocommerce_description( $content ) { … Read more

How to send an automatic email to a custom field in Woocommerce order meta 2 weeks after a product is bought

It’s getting quite late here as I’m typing this so take the code below with a grain of salt. I think if you modify the code provided here (modified version below for future reference), https://businessbloomer.com/woocommerce-custom-cron-job/ (I’m not affiliated to the site), you should get the thing done. The thing you need to change is the … Read more

currentURL is not defined

The way I found at the moment to fix that was disabling the ajax from checkout /** Disable Ajax Call from WooCommerce added in functions.php*/ add_action( ‘wp_enqueue_scripts’, ‘dequeue_woocommerce_cart_fragments’, 11); function dequeue_woocommerce_cart_fragments() { if (is_front_page()) wp_dequeue_script(‘wc-cart-fragments’); } function disable_checkout_script(){ wp_dequeue_script( ‘wc-checkout’ ); } add_action( ‘wp_enqueue_scripts’, ‘disable_checkout_script’ );

Product related to post by title

default woocommerce shortcodes won’t do that. you’ll need to write something custom to get the product by title, grab the ID from there, and then call the add to cart shortcode using the ID. something like this: add_shortcode(‘add_to_cart_by_title’, ‘add_to_cart_by_title’); function add_to_cart_by_title ($atts) { if (!class_exists(‘WooCommerce’)) { return ”; } $args = shortcode_atts(array( ‘title’ => ” … Read more

remove add to cart for free (0 $) product woocommerce

Please try to add following code into your theme functions.php file function remove_add_to_cart_option( $purchasable, $product ){ if( $product->get_price() == 0 ) $purchasable = false; return $purchasable; } add_filter( ‘woocommerce_is_purchasable’, ‘remove_add_to_cart_option’, 10, 2 ); Replace below function instead of above and check again /* * Override via functions.php **/ if (!function_exists(‘woocommerce_template_loop_add_to_cart’)) { function woocommerce_template_loop_add_to_cart() { global … Read more

Woocommerce – Default product image by user role

/** * Only allowing the customer and admin user role to view the product images * * @param $value * * @return bool */ function woocommerce_product_get_image_id_callback( $value ) { global $current_user; if ( in_array( ‘customer’, (array) $current_user->roles ) || in_array( ‘administrator’, (array) $current_user->roles ) ) { return $value; } else { return false; } } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)