Allow max of 15 products in Recent Viewed Products widget
This commit is contained in:
parent
929eb48fcd
commit
777a004a1f
|
@ -484,7 +484,7 @@ function wc_track_product_view() {
|
||||||
$viewed_products = (array) explode( '|', $_COOKIE['woocommerce_recently_viewed'] );
|
$viewed_products = (array) explode( '|', $_COOKIE['woocommerce_recently_viewed'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unset if already in viewed products list and append ID.
|
// Unset if already in viewed products list.
|
||||||
$keys = array_flip( $viewed_products );
|
$keys = array_flip( $viewed_products );
|
||||||
if ( isset( $keys[ $post->ID ] ) ) {
|
if ( isset( $keys[ $post->ID ] ) ) {
|
||||||
unset( $viewed_products[ $keys[ $post->ID ] ] );
|
unset( $viewed_products[ $keys[ $post->ID ] ] );
|
||||||
|
|
|
@ -33,7 +33,7 @@ class WC_Widget_Recently_Viewed extends WC_Widget {
|
||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
'step' => 1,
|
'step' => 1,
|
||||||
'min' => 1,
|
'min' => 1,
|
||||||
'max' => '',
|
'max' => 15,
|
||||||
'std' => 10,
|
'std' => 10,
|
||||||
'label' => __( 'Number of products to show', 'woocommerce' ),
|
'label' => __( 'Number of products to show', 'woocommerce' ),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue