MJDD Sidrena Cijena

MJDD Sidrena Cijena

Details
View on WordPress

With WooCommerce active, MJDD Sidrena Cijena stores each product and variation regular price in its own field and shows it next to the current price. Without WooCommerce, you enter products in a repeater and publish the same XML/CSV feed plus a public HTML pricelist at /sidrena-cjenik.

The prefix is text only; the date is added automatically in one of two formats:

Sidrena cijena (10.09.2026.) : 19,99 €
Sidrena cijena na 10.09.2026. : 19,99 €

Hovering the row shows a tooltip with an explanation (can be turned off). The prefix and tooltip can be translated with WPML, Polylang, TranslatePress, or Loco Translate.

The line under the product price has the CSS class sidrena-cijena so you can style it in the theme or Customizer (Appearance Customize Additional CSS). The default size is 14px (12px on mobile), without bold.

Features

  • Works with WooCommerce, or standalone on a plain WordPress site
  • Snapshot of the regular price on activation (does not overwrite values already entered)
  • Display follows WooCommerce tax settings (same VAT treatment as the regular price)
  • Filter sidrena_cijena_price_to_display when MPC is calculated outside WooCommerce Tax
  • Field below the sale price on simple products and on every variation
  • WooCommerce Sidrena cijena tabs: Settings, Import/Export, Public feed (top-level menu when Woo is not active)
  • Without Woo: product repeater (name, SKU, URL, regular, sale, sidrena) feeding the same export
  • Without Woo: public HTML pricelist at /sidrena-cjenik
  • Prefix without a date; storefront format: Prefix (date) or Prefix date (the word “na” belongs in the prefix)
  • Default reference date plus an optional per-product date (FMCG 02.05.2025. vs other goods 10.09.2026.)
  • Tooltip on hover of the whole row (switch, on by default)
  • Prefix and tooltip translations in WPML, Polylang, TranslatePress, or Loco Translate
  • Export of the price list and of products missing a sidrena price (CSV or XML)
  • Bulk import CSV/XML by SKU, with price column mapping (creates catalog rows when Woo is off)
  • Public price list at /sidrena-cijena.xml or /sidrena-cijena.csv (choose format in settings; manual or daily after 00:05)
  • 30-day archive at /arhiva-sidrene-cijene (OBLIK_ADRESA_OZNAKA_POHRANA_YYYYMMDD_HHMM.xml or .csv)
  • Optional unit-price (CJM) switch on the product, appended to the prefix, e.g. “za kg/l”
  • Automatic display below the price (can be turned off; the shortcode remains)
  • Shortcode [sidrena-cijena] for product loops and custom templates ([sidrena-cijena id="123"])
  • Universal hook: do_action( 'sidrena_cijena' ); or sidrena_cijena();
  • WooCommerce CSV product import / export columns
  • HPOS compatibility

Development: MJDD / Jure Zadravec – https://mjdd.hr

This is not legal advice.

WP-CLI

The admin Fill empty fields button processes 40 products per AJAX request. For a full catalog:

wp sidrena-cijena status
wp sidrena-cijena fill --dry-run
wp sidrena-cijena fill
wp sidrena-cijena fill --today

Default fill is a SQL copy of _regular_price into empty _sidrena_cijena (does not overwrite values already stored). Variable/grouped parents are skipped; variations are filled. --today also writes today’s date as the per-product reference date when that field is empty (products first put on sale after 10.09.2026.).

wp sidrena-cijena fill --safe uses WooCommerce product objects (same as the admin button, slower). Fallback: `wp eval-file wp-content/plugins/sidrena-cijena/bin/fill.php`<h3>Tax (VAT)</h3>

The sidrena price is stored in the same form as the WooCommerce regular price. On the storefront the plugin uses wc_get_price_to_display(), so the display follows WooCommerce Settings Tax (entered including or excluding tax, shop display with or without VAT). You do not need to re-enter prices after an update.

If the shop shows MPC with a custom VAT calculation (not WooCommerce Tax), hook sidrena_cijena_price_to_display so the sidrena amount matches the regular price. See Hook and shortcode.

Settings

Sidrena cijena settings (WooCommerce submenu, or a top-level menu without Woo):

  • Automatic sidrena price display – Woo only; below the current price; when off, only [sidrena-cijena] / [sidrena-cijena id="x"] remain
  • Prefix – words only, e.g. Sidrena cijena (do not type the date here)
  • Date format – Prefix (date) or Prefix date (e.g. put Sidrena cijena na in the prefix)
  • Default reference date – e.g. 10.09.2026. (used for every product without its own date)
  • Per-product reference date – Woo only; leave empty for the default; for FMCG enter 02.05.2025.
  • Tooltip – switch and text (translate in WPML / Polylang / Loco)
  • CJM – Woo only
  • Products tab (without Woo) – repeater for the public pricelist. Required: name, regular price, sidrena price. Saved as one JSON field to avoid max_input_vars limits.
  • At the bottom of the Woo settings tab: Fill empty fields from the regular price – empty fields only; existing sidrena values are left alone. The date stays the shop default (e.g. 10.09.2026.). Fill empty sidrena prices with today’s date – same fill, plus today’s date on products that have no date yet (new products after the reference day). Empty-field snapshot also runs on activation. Saving a product does not fill sidrena automatically. For large catalogs use WP-CLI: wp sidrena-cijena fill or wp sidrena-cijena fill --today (see WP-CLI).
  • Delete all data and deactivate – removes sidrena prices, standalone catalog, settings, public XML and archive, then deactivates the plugin. Cannot be undone.

Import / export

Import/Export tab:

  • Bulk import – CSV or XML. With Woo: match by SKU (choose the column/node). Regular, sale, and sidrena prices are mapped separately; the default is Do not import. Import does not create Woo products, it only updates existing ones. Without Woo: rows with a matching SKU are updated, other rows are appended to the catalog (name, regular, and sidrena are required for new rows). Empty cells are skipped. The progress bar uses AJAX batches.
  • Export price list – all products and variations (or standalone catalog rows): naziv, sku, cijena_redovna, cijena_akcijska, sidrena_cijena
  • Export products without a sidrena price – same columns, only rows where sidrena is empty
  • Sidrena price, date, and CJM remain columns in WooCommerce Products Import/Export (for the catalog, not for the price list itself)

After importing sidrena prices, regenerate the public feed if you use it.

Public feed

Public feed tab. Price list of published products and variations (or the standalone catalog): https://shop.example/sidrena-cijena.xml or .csv (format is a setting; default XML).

Fields: id, naziv, sku, url, cijena_redovna, cijena_akcijska, sidrena_cijena.

Generated with the “Generate public feed” button, on the first visit to the URL, or daily after 00:05 (on by default; WordPress timezone, so the file is ready before 08:00). The file is stored in wp-content/uploads/sidrena-cijena/.

The daily cron also stores a legally named file in the archive, following the HOK webinar template OBLIK_ADRESA_OZNAKA_POHRANA_YYYYMMDD_HHMM.xml (date YYYYMMDD, time HHMM; 30 files maximum; the oldest is deleted). Older sidrena-cijena_DD-MM-YYYY files stay listed. HTML listing: https://shop.example/arhiva-sidrene-cijene/. Set store type, address and object code on the Public feed tab.

Without WooCommerce, a searchable HTML pricelist is also published at https://shop.example/sidrena-cjenik/.

CJM

In settings, enable “Enable CJM switch”. On the product and variation, next to the sidrena price, a CJM switch appears. When it is on, you enter a prefix suffix (e.g. za kg/l).

Sidrena cijena + `za kg/l` + parentheses format = `Sidrena cijena za kg/l (10.09.2026.)`
Sidrena cijena + `za kg/l` + “na” format = `Sidrena cijena za kg/l na 10.09.2026.`<h3>Compatibility</h3>

Works alongside the Croatian 30-day Omnibus plugins WooCommerce Lowest Price by Igor Kovačić (1.x) and Media X / Borko Livić (2.x). Sidrena cijena is the fixed reference price; those plugins show the lowest price in the last 30 days while a product is on sale. When both are active the storefront order is: current price sidrena cijena 30-day lowest price, without a duplicate sidrena line.

The core filter is woocommerce_get_price_html (priority 9999). It covers Storefront, Astra, GeneratePress, OceanWP, Kadence, Blocksy, and most themes that call $product->get_price_html().

Builders that often skip that filter have extra PHP hooks plus JS injection into their .price container:

  • Elementor / AnyWhere Elementor – widget woocommerce-product-price
  • JetWooBuilder / ShopEngine – jet-single-price, shopengine-product-price
  • WPBakery – shortcode [product_price], wrapper .wpb_wrapper > p.price
  • Oxygen – Product Price element (.oxy-product-price)
  • Divi 4 / Divi 5 – module et_pb_wc_price / block divi/wc-product-price
  • Bricks – element product-price
  • Beaver Builder – WooCommerce price module
  • Breakdance / Brizy – CSS selectors for price elements
  • Avada / Fusion – Woo Price theme builder element
  • Woodmart / Flatsome – .wd-single-price, .product-page-price
  • WooCommerce Blocks – woocommerce/product-price

If a theme still does not show the line, put the shortcode or hook below the price in the template or loop.

Hook and shortcode

Output goes through woocommerce_get_price_html (product page, shop, archive, related products — anywhere the theme calls get_price_html()), Woo blocks, and popular page builders.

For custom product loops (Elementor, page builder, custom PHP) use:

[sidrena-cijena]
[sidrena-cijena id="123"]

In a PHP template:

echo do_shortcode( '[sidrena-cijena]' );
do_action( 'sidrena_cijena' );
sidrena_cijena();
sidrena_cijena( $product );

Filter the storefront amount after WooCommerce tax display. Arguments: $amount (float), $product (WC_Product), $raw (stored sidrena string, same basis as _regular_price). Does not change the value stored in the product field.

`

add_filter( ‘sidrena_cijena_price_to_display’, function( $amount, $product, $raw ) {
return (float) $amount * 1.25;
}, 10, 3 );
<h3>Custom CSS</h3>
The line under the product price has the class
sidrena-cijena. Use it for color, size, or alignment. The tooltip is on hover/focus of the whole row (no “i” icon). Default: 14px / 12px on mobile,font-weight: 400`.

HTML structure:

<span class="sidrena-cijena sidrena-cijena--has-tooltip">
  <span class="sidrena-cijena__text">…</span>
  <span class="sidrena-cijena__tooltip">…</span>
</span>

Classes:

  • .sidrena-cijena – the whole row under the product price (main class for styling)
  • .sidrena-cijena__prefix – prefix text with the date (e.g. Sidrena cijena (10.09.2026.))
  • .sidrena-cijena__sep – colon between prefix and amount
  • .sidrena-cijena__amount – sidrena price amount
  • .sidrena-cijena__tooltip – tooltip text (hover/focus on the whole row, no icon)
  • .sidrena-cijena--variable – variable product while no variation is selected

Example:

.sidrena-cijena { font-size: 14px; color: #555; }
.sidrena-cijena__amount { font-weight: 700; color: #111; }

Details

Plugin code:
mjdd-sidrena-cijena
Plugin version:
1.12.0
Outdated:
No
WP version:
6.0 or higher
PHP version:
7.4 or higher
Test up to WP version:
7.1.1
Total installations:
0
Last updated:
2026-09-20
Rating:
Times rated:
0
bazna-cijena
consumer-protection
croatia
sidrena-cijena
woocommerce