Display Sales Quantity by product – Woocommerce [closed]

Please try with this, I hope it will be help, I did try with this code. It’s work for me. add_filter( ‘manage_edit-shop_order_columns’, ‘admin_orders_list_add_column’, 10, 1 ); function admin_orders_list_add_column( $columns ){ $columns[‘custom_column2’] = __( ‘Quantidade’, ‘woocommerce’ ); return $columns; } add_action( ‘manage_shop_order_posts_custom_column’ , ‘admin_orders_list_column_content’, 10, 2 ); function admin_orders_list_column_content( $column){ global $the_order; // the global order … Read more

echo something inside a shortcode

There are a few to do this: Using double quotes Don’t forget to escape the double quotes inside the string. global $post; echo do_shortcode(“[sc name=\”$post->post_name\”]”); Using sigle quotes global $post; echo do_shortcode(“[sc name=”$post->post_name”]”); Using sprintf global $post; echo do_shortcode( sprintf(‘[sc name=”%s”]’, $post->post_name) ); Using wp_sprintf global $post; echo do_shortcode( wp_sprintf(‘[sc name=”%s”]’, $post->post_name) ); Using heredoc … Read more

how customise Woocommerce style of custom theme

You can add your own css based on the classes created by WooCommerce. If you are working in a (child)theme, you can add a stylesheet by adding this code in functions.php: /** * Enqueue your own stylesheet */ function custom_wp_enqueue_woocommerce_style(){ wp_register_style( ‘mytheme-woocommerce’, get_template_directory_uri() . ‘/css/woocommerce.css’ ); if ( class_exists( ‘woocommerce’ ) ) { wp_enqueue_style( ‘mytheme-woocommerce’ … Read more

Using a filter to change a path

Create the template you want to use, say wc-vp-table-rows.php, put it in your theme, and add the following to your functions.php: add_filter( ‘wcvendors_pro_table_display_rows_path’, fn() => locate_template( ‘wc-vp-table-rows.php’ ) ); locate_template() returns a complete path; it also searches in parent and child themes.

Woocommerce: Complex query in pre_get_posts [closed]

When I have complex querie to do, I often use a prequery to get the good post_ids. Then I pass this list of post_ids to my main query via the post__in parameter of WP_Query. $meta_key = ‘RepeaterName_%_FieldName’; $meta_value=”MyCustomValue”; global $wpdb; $post_ids = $wpdb->get_col( $wpdb->prepare( ” SELECT pm.post_id FROM $wpdb->postmeta pm WHERE pm.meta_key LIKE %s AND … Read more

WordPress Comment Box on woocommerce product page [closed]

Replies aren’t disabled for reviews in woocommerce, but there is no output of a reply button. If you add one to the review.php template via comment_reply_link() – exemplary usage below – replies are possible. Code: $args = array( ‘reply_text’ => ‘Reply <span>&darr;</span>’, ‘depth’ => ‘1’, ‘max_depth’ => ‘5’ ); comment_reply_link( $args );