WooCommerce Webhook Action When a New Product Review was Submitted/Created

As we know WooCommerce product reviews are essentially WordPress comments with a specific comment_type. Firstly we hook into the Comment Submission and then we will check If the Comment is a WooCommerce Product Review and then we trigger our Custom Action. Could you please try to add this to your theme’s functions.php or in your … Read more

How to get the WooCommerce product variation image

here is product set in display in cart in cart.php $_product = apply_filters( ‘woocommerce_cart_item_product’, $cart_item[‘data’], $cart_item, $cart_item_key ); $product_id = apply_filters( ‘woocommerce_cart_item_product_id’, $cart_item[‘product_id’], $cart_item, $cart_item_key ); $thumbnail = apply_filters( ‘woocommerce_cart_item_thumbnail’, $_product->get_image(), $cart_item, $cart_item_key ); if ( ! $_product->is_visible() ) { echo $thumbnail; } else { $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($_product->id), ‘thumbnail’ ); $cartimgsrc=UNAVAILABLEIMG; if($thumb[0]){ $cartimgsrc=$thumb[0]; $product … Read more

Optimizing or rewriting core queries

You could certainly write a wrapper function that implements caching of the WooCommerce core functionality, but WooCommerce isn’t going to use your wrapper function, so pretty pointless. Your best option is to create and use your own data store for WooCommerce that extends the WC_Data_Store_WP class, and add caching to those functions.

Add another user role based on a defined input field in WordPress (Woocommerce)

Add the following code snippet to your WordPress theme’s functions.php file. Define the new user role and capabilities (you can customize this based on your needs) function add_custom_roles() { add_role( ‘corporate_customer’, ‘Corporate Customer’, array( ‘read’ => true, ‘edit_posts’ => true, ‘delete_posts’ => false, )); } add_action( ‘init’, ‘add_custom_roles’ ); A function to update the user … Read more

deneme bonusudeneme bonusu veren sitelerOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino