Automated Cart Update With Alert Box Each Time

// Display sku in cart add_filter( ‘woocommerce_get_item_data’, ‘func_js_display_custom_item_data_in_cart’, 100, 2 ); function func_js_display_custom_item_data_in_cart( $cart_item_data, $cart_item ) { $cart_item_data[] = array( ‘name’ => __( ‘SKU ‘, ‘woocommerce’ ), ‘value’ => ” . $cart_item[‘data’]->get_sku() . ‘ ‘, ); return $cart_item_data; } add_action( ‘wp_footer’, ‘cart_update_qty_script’ ); function cart_update_qty_script() { if (is_cart()) : ?> var $ = jQuery; $(‘div.woocommerce’).on(‘change’, … Read more

Display featured products by category

First, you have to determine from what category you want to display those products. If this happends on a single post display, you can get all post’s categories via wp_get_object_terms function global $post; $query_args[ ‘category__in’ ] = wp_get_object_terms( $post->ID, ‘category’, array( ‘fields’ => ‘ids’ ) ); If this happens on a archive page, you can … Read more