mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-20 04:00:29 +08:00
Merge pull request #893 from woocommerce/fix/892
Update homepage shortcodes
This commit is contained in:
commit
64d7ece8f7
1 changed files with 37 additions and 17 deletions
|
@ -610,12 +610,16 @@ if ( ! function_exists( 'storefront_recent_products' ) ) {
|
|||
if ( storefront_is_woocommerce_activated() ) {
|
||||
|
||||
$args = apply_filters( 'storefront_recent_products_args', array(
|
||||
'limit' => 4,
|
||||
'columns' => 4,
|
||||
'title' => __( 'New In', 'storefront' ),
|
||||
'limit' => 4,
|
||||
'columns' => 4,
|
||||
'orderby' => 'date',
|
||||
'order' => 'desc',
|
||||
'title' => __( 'New In', 'storefront' ),
|
||||
) );
|
||||
|
||||
$shortcode_content = storefront_do_shortcode( 'recent_products', apply_filters( 'storefront_recent_products_shortcode_args', array(
|
||||
$shortcode_content = storefront_do_shortcode( 'products', apply_filters( 'storefront_recent_products_shortcode_args', array(
|
||||
'orderby' => esc_attr( $args['orderby'] ),
|
||||
'order' => esc_attr( $args['order'] ),
|
||||
'per_page' => intval( $args['limit'] ),
|
||||
'columns' => intval( $args['columns'] ),
|
||||
) ) );
|
||||
|
@ -658,18 +662,20 @@ if ( ! function_exists( 'storefront_featured_products' ) ) {
|
|||
if ( storefront_is_woocommerce_activated() ) {
|
||||
|
||||
$args = apply_filters( 'storefront_featured_products_args', array(
|
||||
'limit' => 4,
|
||||
'columns' => 4,
|
||||
'orderby' => 'date',
|
||||
'order' => 'desc',
|
||||
'title' => __( 'We Recommend', 'storefront' ),
|
||||
'limit' => 4,
|
||||
'columns' => 4,
|
||||
'orderby' => 'date',
|
||||
'order' => 'desc',
|
||||
'visibility' => 'featured',
|
||||
'title' => __( 'We Recommend', 'storefront' ),
|
||||
) );
|
||||
|
||||
$shortcode_content = storefront_do_shortcode( 'featured_products', apply_filters( 'storefront_featured_products_shortcode_args', array(
|
||||
'per_page' => intval( $args['limit'] ),
|
||||
'columns' => intval( $args['columns'] ),
|
||||
'orderby' => esc_attr( $args['orderby'] ),
|
||||
'order' => esc_attr( $args['order'] ),
|
||||
$shortcode_content = storefront_do_shortcode( 'products', apply_filters( 'storefront_featured_products_shortcode_args', array(
|
||||
'per_page' => intval( $args['limit'] ),
|
||||
'columns' => intval( $args['columns'] ),
|
||||
'orderby' => esc_attr( $args['orderby'] ),
|
||||
'order' => esc_attr( $args['order'] ),
|
||||
'visibility' => esc_attr( $args['visibility'] ),
|
||||
) ) );
|
||||
|
||||
/**
|
||||
|
@ -712,12 +718,16 @@ if ( ! function_exists( 'storefront_popular_products' ) ) {
|
|||
$args = apply_filters( 'storefront_popular_products_args', array(
|
||||
'limit' => 4,
|
||||
'columns' => 4,
|
||||
'orderby' => 'rating',
|
||||
'order' => 'desc',
|
||||
'title' => __( 'Fan Favorites', 'storefront' ),
|
||||
) );
|
||||
|
||||
$shortcode_content = storefront_do_shortcode( 'top_rated_products', apply_filters( 'storefront_popular_products_shortcode_args', array(
|
||||
$shortcode_content = storefront_do_shortcode( 'products', apply_filters( 'storefront_popular_products_shortcode_args', array(
|
||||
'per_page' => intval( $args['limit'] ),
|
||||
'columns' => intval( $args['columns'] ),
|
||||
'orderby' => esc_attr( $args['orderby'] ),
|
||||
'order' => esc_attr( $args['order'] ),
|
||||
) ) );
|
||||
|
||||
/**
|
||||
|
@ -760,12 +770,18 @@ if ( ! function_exists( 'storefront_on_sale_products' ) ) {
|
|||
$args = apply_filters( 'storefront_on_sale_products_args', array(
|
||||
'limit' => 4,
|
||||
'columns' => 4,
|
||||
'orderby' => 'date',
|
||||
'order' => 'desc',
|
||||
'on_sale' => 'true',
|
||||
'title' => __( 'On Sale', 'storefront' ),
|
||||
) );
|
||||
|
||||
$shortcode_content = storefront_do_shortcode( 'sale_products', apply_filters( 'storefront_on_sale_products_shortcode_args', array(
|
||||
$shortcode_content = storefront_do_shortcode( 'products', apply_filters( 'storefront_on_sale_products_shortcode_args', array(
|
||||
'per_page' => intval( $args['limit'] ),
|
||||
'columns' => intval( $args['columns'] ),
|
||||
'orderby' => esc_attr( $args['orderby'] ),
|
||||
'order' => esc_attr( $args['order'] ),
|
||||
'on_sale' => esc_attr( $args['on_sale'] ),
|
||||
) ) );
|
||||
|
||||
/**
|
||||
|
@ -807,12 +823,16 @@ if ( ! function_exists( 'storefront_best_selling_products' ) ) {
|
|||
$args = apply_filters( 'storefront_best_selling_products_args', array(
|
||||
'limit' => 4,
|
||||
'columns' => 4,
|
||||
'orderby' => 'popularity',
|
||||
'order' => 'desc',
|
||||
'title' => esc_attr__( 'Best Sellers', 'storefront' ),
|
||||
) );
|
||||
|
||||
$shortcode_content = storefront_do_shortcode( 'best_selling_products', apply_filters( 'storefront_best_selling_products_shortcode_args', array(
|
||||
$shortcode_content = storefront_do_shortcode( 'products', apply_filters( 'storefront_best_selling_products_shortcode_args', array(
|
||||
'per_page' => intval( $args['limit'] ),
|
||||
'columns' => intval( $args['columns'] ),
|
||||
'orderby' => esc_attr( $args['orderby'] ),
|
||||
'order' => esc_attr( $args['order'] ),
|
||||
) ) );
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue