Template overrides
Template system modeled after WooCommerce. Override any template by copying it to yourtheme/polski/ in your theme.
How to override a template
Section titled “How to override a template”- Find the original template in the plugin directory:
wp-content/plugins/polski/templates/ - Copy the file to your theme directory:
wp-content/themes/your-theme/polski/ - Preserve the subdirectory structure
- Modify the copied file
The plugin will automatically detect the template in your theme and use it instead of the default.
Example: to override the Omnibus price template, copy:
wp-content/plugins/polski/templates/omnibus/price-display.phpto:
wp-content/themes/your-theme/polski/omnibus/price-display.phpChild theme
Section titled “Child theme”If you use a child theme, place templates in the child theme directory. The plugin searches for templates in the following order:
wp-content/themes/child-theme/polski/wp-content/themes/parent-theme/polski/wp-content/plugins/polski/templates/
Template list
Section titled “Template list”Legal requirements
Section titled “Legal requirements”| Template file | Description |
|---|---|
omnibus/price-display.php | Omnibus price display |
omnibus/price-history.php | Price history (table) |
gpsr/product-info.php | GPSR information on product page |
gpsr/safety-sheet.php | Product safety data sheet |
withdrawal/form.php | Contract withdrawal form |
withdrawal/confirmation.php | Withdrawal submission confirmation |
withdrawal/email.php | Confirmation email template |
dsa/report-form.php | DSA report form |
dsa/report-confirmation.php | DSA report confirmation |
gdpr/consent-checkboxes.php | GDPR consent checkboxes |
ksef/invoice-template.php | KSeF invoice template |
greenwashing/product-claims.php | Product environmental claims |
legal-pages/terms-template.php | Store terms and conditions template |
legal-pages/privacy-template.php | Privacy policy template |
legal-pages/withdrawal-template.php | Withdrawal information template |
Prices and product information
Section titled “Prices and product information”| Template file | Description |
|---|---|
prices/unit-price.php | Unit price |
prices/vat-notice.php | VAT and delivery information |
prices/delivery-time.php | Estimated delivery time |
manufacturer/info.php | Manufacturer information |
manufacturer/logo.php | Manufacturer logo |
Food products
Section titled “Food products”| Template file | Description |
|---|---|
food/nutrients-table.php | Nutrition facts table |
food/allergens-list.php | Allergens list |
food/nutri-score.php | Nutri-Score badge |
Checkout and orders
Section titled “Checkout and orders”| Template file | Description |
|---|---|
checkout/button-label.php | Order button label |
checkout/legal-checkboxes.php | Legal checkboxes at checkout |
checkout/nip-field.php | NIP field with auto-completion |
checkout/doi-notice.php | Double opt-in message |
Storefront modules
Section titled “Storefront modules”| Template file | Description |
|---|---|
wishlist/table.php | Wishlist table |
wishlist/button.php | Add to list button |
wishlist/header-icon.php | Header icon |
compare/table.php | Comparison table |
compare/button.php | Compare button |
compare/floating-bar.php | Comparison bar (bottom of screen) |
quick-view/modal.php | Quick view lightbox window |
quick-view/button.php | Quick view button |
ajax-search/form.php | AJAX search field |
ajax-search/results.php | Search results dropdown |
ajax-search/result-item.php | Single search result |
ajax-filters/container.php | AJAX filters container |
ajax-filters/filter-category.php | Category filter |
ajax-filters/filter-price.php | Price filter (slider) |
ajax-filters/filter-attribute.php | Attribute filter |
ajax-filters/active-filters.php | Active filters bar |
product-slider/slider.php | Slider container |
product-slider/item.php | Product card in slider |
badges/badge.php | Single badge |
badges/container.php | Badge container on product |
waitlist/form.php | Waitlist form |
waitlist/email.php | Availability notification email |
| Template file | Description |
|---|---|
tools/compliance-checklist.php | Compliance checklist |
tools/audit-report.php | Audit report |
tools/security-incident-form.php | Security incident form |
tools/verified-review-badge.php | Verified review badge |
Available variables in templates
Section titled “Available variables in templates”Each template receives a set of variables. Example for omnibus/price-display.php:
<?php/** * Omnibus price display template * * Available variables: * @var float $lowest_price Lowest price from the period * @var int $days Number of days * @var int $product_id Product ID * @var string $price_html Formatted price HTML * @var string $date Lowest price date * * @package Polski */
defined('ABSPATH') || exit;?>
<div class="polski-omnibus-price"> <span class="polski-omnibus-label"> <?php printf( esc_html__('Lowest price from %d days before the discount:', 'polski'), $days ); ?> </span> <span class="polski-omnibus-amount"> <?php echo wp_kses_post($price_html); ?> </span></div>Checking template version
Section titled “Checking template version”Each template contains a @version comment in the header. After updating the plugin, check if your overridden templates need updating.
The plugin displays a warning in the admin panel (WooCommerce > Status > Polski) if it detects outdated templates in the theme.
/** * @version 1.5.0 */Hook for changing template path
Section titled “Hook for changing template path”If you want to change the default template location in the theme:
add_filter('polski/template/path', function (string $path): string { return 'custom-polski-templates/'; // instead of 'polski/'});Then templates will be searched in: wp-content/themes/your-theme/custom-polski-templates/
Debugging templates
Section titled “Debugging templates”To check which template is currently being loaded, enable debug mode:
// In wp-config.phpdefine('POLSKI_TEMPLATE_DEBUG', true);In debug mode, each template is surrounded by HTML comments indicating the path:
<!-- polski template: /themes/your-theme/polski/omnibus/price-display.php -->...<!-- /polski template -->Report issues: github.com/wppoland/polski/issues