Skip to content

Product slider

The Product Slider Carousel module in Polski for WooCommerce shows a horizontal row of up to 12 products (related, upsell, sale or featured) that scrolls with CSS scroll-snap and loads no carousel JavaScript. It appears under the product summary on single product pages and through a shortcode, a block or an Elementor widget. It is off by default.

Go to Polski > Modules and enable Product Slider Carousel (module ID: product_slider_carousel). The settings are in Polski > Settings > Content & Trust and are stored in the polski_slider option.

Setting Default Description
Show on product page Yes Prints the slider on single product pages (hook woocommerce_after_single_product_summary, priority 19)
Source Related Related, Upsell, Sale or Featured
Title Recommended products Heading above the slider
Limit 8 Number of products, capped at 12
Show title Yes Prints the heading
Show intro text No Prints the intro text below the heading
Intro text empty Text for the line above
Source Products Needs a current product
related WooCommerce's related products (wc_get_related_products()) Yes
upsell The product's upsells Yes
sale Products on sale (wc_get_product_ids_on_sale()) No
featured Products marked as featured (wc_get_featured_product_ids()) No

Only visible products are shown, and a variation on sale is skipped because its parent is already in the list. With no products to show, the slider prints nothing. Related and upsell sliders also print nothing on a page without a current product, such as the home page.

The track uses overflow-x: auto with scroll-snap-type: x mandatory, and each card has scroll-snap-align: start. Scrolling is the browser's own: swipe on touch screens, trackpad or scrollbar on desktop. There are no arrows, dots or autoplay.

The stylesheet polski-product-slider (assets/css/product-slider.css) is registered on every page but only enqueued on pages that actually render a slider.

Each product card shows the image, the name, the price and an add to cart button. The button uses WooCommerce's AJAX add to cart classes when the product supports it.

Parameter Default Description
source Source setting (related) related, upsell, sale or featured
title Title setting Heading above the slider
limit Limit setting (8) Number of products, 1 to 12

The shortcode always uses the current product for related and upsell; it has no product ID attribute.

[polski_product_slider source="sale" limit="12" title="Current promotions"]
[polski_product_slider source="featured" limit="6"]

The Polski Product Slider block (polski/product-slider) has these options:

Option Default
Product ID (for related and upsell) 0 (current product)
Source related
Title empty (uses the setting)
Limit 8
Show title Yes
Show price Yes
Show add to cart Yes

The block can point at a specific product, which the shortcode cannot.

With Elementor active, the plugin also registers a product slider widget.

Class Element
.polski-product-slider Slider container
.polski-product-slider__intro Intro text
.polski-product-slider__track Scroll track
.polski-product-slider__item Product card (also has WooCommerce's product class)
.polski-product-slider__footer Footer with the "view all" link
.polski-product-slider__empty Empty state message

The heading is an h2 and each product name an h3.

The slider does not show on a product page: check that "Show on product page" is on and that the product has related products or upsells for the chosen source.

The shortcode prints nothing on the home page: related and upsell need a current product. Use source="sale" or source="featured" there.

Section titled "Does the slider need jQuery or a carousel library?"

No. Scrolling is plain CSS scroll-snap, and the module loads one small stylesheet.

How many products can the slider show?

Section titled "How many products can the slider show?"

Up to 12. Any higher limit is reduced to 12.

No. There is no autoplay, arrows or dots; visitors scroll it themselves.

Report issues: github.com/wppoland/polski/issues

This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.