| 开发者 | juremjdd |
|---|---|
| 更新时间 | 2026年11月21日 13:03 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/sidrena-cjenik.
The prefix is text only; the date is added automatically in one of two formats:
Bazna cijena (10.09.2026.) : 19,99 €
Bazna 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
sidrena_cijena_price_to_display when MPC is calculated outside WooCommerce Tax[sidrena-cijena id="d1"][sidrena-cijena id="x"] for pages/sidrena-cjenik (always without Woo; on a shop only after HTML stranica /sidrena-cjenik is turned on)Prefix (date) or Prefix date (the word “na” belongs in the prefix). An empty prefix with Prefix date prints only the date and the amount/sidrena-cijena-robe.xml and /sidrena-cijena-usluge.xml (or .csv). /sidrena-cijena.xml stays an alias of the goods file, or of the services file when there are no goodsnaziv, sifra, marka, neto_kolicina, jedinica_mjere, maloprodajna_cijena, poseban_oblik (DA/NE), cijena_jedinice_mjere, barkod, ean_barkod, bazna_cijena. Services: naziv, maloprodajna_cijena, poseban_oblik, bazna_cijena. A virtual product with no saved Vrsta is a service. Isključi iz javnog cjenika on the product (and in bulk edit) leaves that row out of the public files/sidrena-cijena-robe-001.xml and /sidrena-cijena-usluge-001.xml. One cjenik for every place uses ZA_SVA_PRODAJNA_MJESTA and no per-outlet files. /sidrena-cjenik stays one mixed HTML table[sidrena-cjenik] prints the searchable pricelist table (name, SKU, barcode, prices, availability) on any page. oznaka="001" limits it to one outlet. [sidrena-arhiva oznaka="001"] does the same for the archive listposeban_oblik is DA, otherwise NE. The action name stays on the HTML table only[sidrena-cijena] for product loops and custom templates. prikaz="redovna", prikaz="akcijska", or prikaz="sidrena" prints only that amountdo_action( 'sidrena_cijena' ); or sidrena_cijena();sidrena-cijena folder to wp-content/plugins/.[sidrena-cijena id="d1"] from a row onto a page./sidrena-cijena-robe.xml and /sidrena-cijena-usluge.xml. A file is replaced only when its content changes. The archive keeps the replaced file for 15 days. A catch-up runs at 10:00./sidrena-cijena-robe-001.xml and /sidrena-cijena-usluge-001.xml. Tick the same-cjenik box to publish one file for every place (ZA_SVA_PRODAJNA_MJESTA).[sidrena-cjenik] (or [sidrena-cjenik oznaka="001"] for one outlet). The shortcode is also shown on the Public feed tab, with a copy button.[sidrena-cijena id="x"] from a row onto any page so prices stay in admin. Paste [sidrena-cjenik] where you want the full searchable table./sidrena-cjenik. XML/CSV feed and 30-day archive work the same as with Woo.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
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.
Sidrena cijena settings (WooCommerce submenu, or a top-level menu without Woo). The admin and storefront text is Croatian when the site language is Croatian (or when WordPress has no other match). English, German, and Slovenian are included for en_US, en_GB, de_DE, and sl_SI. A saved prefix and tooltip stay as you typed them.
[sidrena-cijena] / [sidrena-cijena id="x"] remainBazna cijena (do not type the date here). Sidrena cijena is accepted and is not rewritten. If the saved prefix is only Cijena, an admin notice offers the statutory label.Prefix (date) or Prefix date (e.g. put Sidrena cijena na in the prefix). Leave the prefix empty with Prefix date to print only the date and the amount, with no colon10.09.2026. (used for every product without its own date)02.05.2025.za kg/l). The phrase is added only to that row's sidrena label. The public feed uses separate fields: jedinica_mjere and cijena_jedinice_mjere, entered on the product or the manual row.[sidrena-cijena id="d1"].max_input_vars limits./sidrena-cjenik publishes the full HTML pricelist. The shortcode [sidrena-cjenik] works either way.wp sidrena-cijena fill or wp sidrena-cijena fill --today (see WP-CLI).Import/Export tab:
id, vrsta, naziv, sku, marka, url, jedinica_mjere, cijena_jedinice_mjere, maloprodajna_cijena, naziv_posebnog_oblika, sidrena_cijena, sidrena_datum, barkod, dostupnost. Published products only. Variations are separate rows. Dodatne stavke are at the end. A file that contains only services leaves out SKU, brand, unit, barcode, and availability.naziv, sku, cijena_redovna, cijena_akcijska, sidrena_cijena, including unpublished products, only where sidrena is emptyPublic feed tab. Goods: https://shop.example/sidrena-cijena-robe.xml. Services, when at least one priced service exists: https://shop.example/sidrena-cijena-usluge.xml. Format is a setting (default XML). /sidrena-cijena.xml is an alias of the goods file, or of the services file when there are no goods.
Goods columns, in this order: naziv, sifra, marka, neto_kolicina, jedinica_mjere, maloprodajna_cijena, poseban_oblik, cijena_jedinice_mjere, barkod, ean_barkod, bazna_cijena. Service columns: naziv, maloprodajna_cijena, poseban_oblik, bazna_cijena. neto_kolicina is filled only when that good has a unit or a unit price. poseban_oblik is DA while a sale price is active, otherwise NE. An EAN-8 or EAN-13 goes in ean_barkod; any other code stays in barkod. bazna_cijena is the stored regular reference price. CSV is UTF-8, separated by ;, with a decimal comma. The HTML table may still show a link and availability. Those columns are not in the XML or CSV.
A price, sale, catalog, or manual-row change queues one rebuild about a minute later. The 10:00 run repeats the same check so a missed overnight change is published before 11:00. The same statutory body does not touch the live file or the archive. A changed body overwrites the stable URL, copies the previous bytes into the archive under the legal name, and advances that kind's storage number. The replaced file stays for 15 days. A visit to a missing file returns 503 and queues one rebuild, with a 15-minute cooldown. Files live in wp-content/uploads/sidrena-cijena/.
The legal download name is {OIB or personal number}_{sales-place class}_{address}_{code}_{ROBE or USLUGE}_{storage}_{YYYYMMDD}_{HHMM}.xml. One cjenik for every place keeps the class and uses ZA_SVA_PRODAJNA_MJESTA instead of the address and code: {OIB}_{class}_ZA_SVA_PRODAJNA_MJESTA_{ROBE or USLUGE}_{storage}_{YYYYMMDD}_{HHMM}.xml. Enter the number, class, address, and code on Poslovnice. The e-računi extension follows that same checkbox and does not publish a file per store while it is on.
Several outlets. Each outlet is published at /sidrena-cijena-robe-001.xml and /sidrena-cijena-usluge-001.xml (or .csv). With the same-cjenik option there are no per-outlet files. /sidrena-cjenik stays one mixed HTML table. Each outlet HTML page is https://shop.example/sidrena-cjenik/001/.
Table shortcode. [sidrena-cjenik] prints only the searchable table (plugin design) on any page or in an Oxygen shortcode element. [sidrena-cjenik oznaka="001"] limits the rows to one outlet. Columns follow the public feed: name, SKU, brand, barcode, unit, unit price, retail price, sale-form name, sidrena price, availability. The name links to the product URL when one is set. The Public feed tab lists these shortcodes with a copy button.
Archive shortcode. [sidrena-arhiva] prints only the archived filenames and dates, in the same light-blue list. [sidrena-arhiva oznaka="001"] limits the list to one object code. The public archive page groups files by outlet when several are on. The Public feed tab shows these shortcodes with a copy button.
Without WooCommerce, the same table is also a page at https://shop.example/sidrena-cjenik/. On a WooCommerce shop that page is off until you turn on HTML stranica /sidrena-cjenik on the Public feed tab.
In settings, enable Cijena za jedinicu mjere (CJM). On each Woo product and variation, and on each row of Proizvodi or Dodatne stavke, a CJM switch appears. When that row's switch is on, you enter a unit phrase (e.g. za kg/l).
Bazna cijena + za kg/l + parentheses format = Bazna cijena za kg/l (10.09.2026.)
Bazna cijena + za kg/l + “na” format = Bazna cijena za kg/l na 10.09.2026.
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. WPML and Polylang store each translation as its own product and do not copy the sidrena field, so the storefront uses the default-language sidrena when the translated product has none.
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:
woocommerce-product-pricejet-single-price, shopengine-product-price[product_price], wrapper .wpb_wrapper > p.price.oxy-product-price)et_pb_wc_price / block divi/wc-product-priceproduct-price.wd-single-price, .product-page-pricewoocommerce/product-priceOutput 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 id="123"]
[sidrena-cijena id="123" prikaz="sidrena"]
[sidrena-cjenik]
[sidrena-cjenik oznaka="001"]
[sidrena-arhiva]
[sidrena-arhiva oznaka="001"]
[sidrena-cjenik] prints only the searchable pricelist table, using the plugin table design. Put it on any page or in an Oxygen shortcode element. With multiple outlets, oznaka limits the table to that poslovnica. Without it, the table lists every product.
[sidrena-arhiva] prints only the archive file list: each legal filename and its date. It does not add a title or a back link. oznaka keeps one object code. Older filenames that have no object code stay in the list only when oznaka is omitted.
Without WooCommerce, [sidrena-cijena id="123"] prints that catalog row's current price and sidrena line. On a shop, [sidrena-cijena id="d1"] does the same for a row on Dodatne stavke. Add prikaz="redovna", prikaz="akcijska", or prikaz="sidrena" to print only that amount, for example 120,00 €. Without prikaz, the full line with the label and tooltip stays. An empty sale price prints nothing. A variable product with a price range prints od plus the amount. Paste it once and change prices in Sidrena cijena, not on the page.
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 );
Dostavu postavite kao uslugu (kartica Dodatne stavke ili Proizvodi, vrsta Usluga) te koristite shortcode za programatski ispis, npr. [sidrena-cijena id="d1" prikaz="sidrena"]. Na trgovini s WooCommerceom ručni redak ide s prefiksom d. Integracija sidrenih cijena za dostave nije dio plugina zbog raznih dostupnih načina kalkulacije i prikaza istih.
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. Bazna cijena (10.09.2026.)).sidrena-cijena__sep - colon between prefix and amount, or a space when the prefix is empty and the date format is plain.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.sidrena-cijena { font-size: 14px; color: #555; }
.sidrena-cijena__amount { font-weight: 700; color: #111; }
/sidrena-cjenik i [sidrena-cjenik] bez oznake više ne vrti „Cjenik se priprema” — prikazuju se poveznice na cjenik po poslovnici./sidrena-cjenik keeps the webshop table and always offers the webshop XML/CSV download when several outlets are on. Each outlet has its own HTML page at /sidrena-cjenik/{oznaka} with that outlet's table and download.[sidrena-arhiva oznaka="001"] lists archive files for one object code. The public archive page groups files by outlet.sidrena-cijena_DD-MM-YYYY links stay as they were.glob(), so hosts without that flag still list XML and CSV files.[sidrena-cijena prikaz="redovna"], prikaz="akcijska", or prikaz="sidrena" prints only that amount. Without prikaz the full line stays. An empty sale price prints nothing. A variable product with a range prints od plus the amount.vrsta and sidrena_datum. With several outlets, /sidrena-cijena.xml stays the webshop file. Each poslovnica keeps its own feed, HTML table, and 30-file archive. A service is written only into the feed it belongs to. A file that contains only services leaves out SKU, brand, unit, barcode, and availability.[sidrena-cjenik] serve the table saved with the feed. A missing file shows a preparing message and queues one rebuild instead of loading every product on the request.[sidrena-arhiva] prints only the archive filenames and dates.DISABLE_WP_CRON is not set, the Public feed tab warns that 00:05 runs on the next PHP request and how to call wp-cron.php from system cron. It also warns when the last successful file is older than 26 hours.prodavaonica_Ilica 150 Zagreb_P-01_104_01.10.2026_07:45. Spaces, hyphens, and typed case stay. Date is DD.MM.YYYY and time is HH:MM. Windows servers write the time as 07-45.marka. Settings: pick a product taxonomy and/or type a fallback brand. Manual rows (Proizvodi / Dodatne stavke) have their own Marka field.[sidrena-cijena] shows a price only for a published product the visitor can open. Drafts, private products, and password-protected products stay hidden. The public XML, CSV, and HTML cjenik include published products even when WooCommerce catalog visibility is hidden (common on B2B shops). Isključi iz javnog cjenika on the product, variation, or bulk edit leaves that row out. A virtual product with an empty Vrsta is published as a service. Use the filter sidrena_cijena_include_in_public_feed to tighten that list.maloprodajna_cijena) plus naziv_posebnog_oblika. An active sale price writes akcija unless the product or manual row sets another name.jedinica_mjere and cijena_jedinice_mjere. The CJM label suffix stays on the storefront line and is no longer a feed column.mjerna_jedinica, and a Mjerna jedinica column in the HTML table./sidrena-cjenik) includes barcode and Dostupno/Nedostupno as well as the prices./sidrena-cjenik from the Public feed tab. It stays off until then.[sidrena-cijena id="d1"]./sidrena-cijena-{oznaka}.xml (or .csv) and its own 30-file archive. Daily generation after 00:05 covers every outlet that has products.[sidrena-cjenik] prints only the pricelist table (plugin design) on any page. Optional oznaka="001" limits the rows to one outlet.[sidrena-cijena id="x"] shortcode for non-Woo pages.dostupno/nedostupno from WooCommerce stock and barcode from GTIN, UPC, EAN or ISBN..summary.OBLIK_ADRESA_OZNAKA_POHRANA_YYYYMMDD_HHMM (date format YYYYMMDD, time HHMM)./sidrena-cjenik.pll_translate_string() is called with the language code (or pll__()), fixing a PHP 8 critical error./sidrena-cijena.xml or /sidrena-cijena.csv). Archive files keep the type they were generated as.wp sidrena-cijena fill --today.sidrena_cijena_price_to_display for shops that add VAT outside WooCommerce Tax.