Hướng dẫn custom woocommerce – phần 5
Sunday, January 24, 2016 2:03
% of readers think this story is Fact. Add your two cents.
Mời anh chị xem video Hướng dẫn custom woocommerce – phần 5
Một số code liên quan tới phần 5:
- Tạo widget best selling products
'Best selling products'); $control_ops = array('width' => 300, 'height' => 300); parent::WP_Widget(false,$name='Best selling products',$widget_ops,$control_ops); } function form($instance){ global $wpdb; //Defaults $instance = wp_parse_args( (array) $instance, array('title'=>'','numbershow'=>'') ); $title = htmlspecialchars($instance['title']); $numbershow = htmlspecialchars($instance['numbershow']); ?>
'product', 'meta_key' => 'total_sales', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'posts_per_page' => $numbershow, 'post_status' => 'publish' ); $wp_query = new WP_Query( $args ); if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
2016-01-24 01:00:06
Nguồn: http://fcwordpress.net/huong-dan-custom-woocommerce-phan-5.html