Download the PHP package wmd/craft-omnibus without Composer

On this page you can find all versions of the php package wmd/craft-omnibus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-omnibus

Omnibus, Price History and Anchor Price for Craft Commerce

Price history per variant, and the two reference prices EU and Croatian law require next to a selling price:

Plus the daily price list the same decision package requires from every trader with a website (Odluka o objavi cjenika proizvoda i usluga, NN 101/2026): CSV and XML, prescribed columns, prescribed file name, published on the site, kept 30 days.

Requirements

Craft CMS 5.0+, Craft Commerce 5.0+, PHP 8.2+.

Installation

The plugin records a history row whenever a variant's base price changes, and the current price when a variant is first saved (including variants created together with their product, as importers do).

Installing on a store that already has prices

The anchor is read from history. A store that installs the plugin after the reference day has no rows for that day; if its prices have not changed since, assert that once:

anchor/backfill without --as-of records today's price for variants that have no history at all.

Prices of an earlier reference day (2.5.2025)

No install has history from 2 May 2025. Import the prices in force that day from a spreadsheet or ERP export, one sku;price per line, after the history since has been recorded (the backfill above):

Each row becomes a history row dated noon of that day (site time zone). The delimiter (;, ,, tab) is detected, a header row is skipped, prices may be written 1234.56, 1234,56 or 1.234,56; 1.234 is refused as ambiguous. Running it again with the same day updates those rows. Unknown SKUs, bad lines and variants with no history after that day (whose imported price would stand for every day since) are listed, skipped, and make the command exit non-zero.

A product that was on sale on that day takes, under the draft Pravilnik o isticanju bazne cijene (čl. 3(3)), the lowest price of the 30 days before the sale started, which a price history from 2026 cannot compute. Set Anchor price override field to a number or money field on the variant or product and type that price there; a filled override is the anchor.

Settings

Settings → Plugins → Omnibus, Price History and Anchor Price

Setting Default Notes
Reference day 2026-09-10 the day the anchor price is read for, unless a row below matches
Other reference days none date, product type handles, category or entry IDs (subcategories included); first match wins
Anchor price override field empty number/money field handle; a filled value is the anchor
Label empty printed next to the selling price; empty uses the translated default ("Anchor price", hr "Sidrena cijena")
Products listed after the reference day use their first price on the anchor then carries the listing date
Lowest-price window 30 days
Publish the daily price list on
Oblik / adresa / oznaka prodajnog objekta parts of the file name (čl. VI)
Publish directory @webroot/cjenik files must be public
Index route cjenik public page listing the files
Retention 30 days čl. VII
CSV delimiter ;
CSV decimal separator . , for shops whose customers open the CSV in a Croatian Excel (28.05 reads as a date); XML always .
Name of a reduction without a pricing rule empty ("Sniženje") naziv_posebnog_oblika_prodaje for a promotional price typed on the variant
Field mapping brand: productsBrandCategories handles for marka, neto količina, barkod, jedinica mjere, cijena za jedinicu mjere

Reference day per product

config/omnibus.php can hold the rules as arrays:

Anything else goes through an event; date arrives as the rules' answer:

Twig

anchor() accepts a Variant, a Product (its default variant) or an id and returns { price, date, source } where date is the variant's reference day (or its first listing) and source is anchorDate, firstListing or override. anchorDate(variant) gives a variant's reference day, anchorDate() the default one. lowestBefore(variant, saleStart = null, days = null) closes the window at saleStart, by default where the reduction started: the history row that lowered the price, or, for a promotional price or catalog pricing rule (the history records base prices only), the rule's start date, else now.

The original API stays: getVariantLowestPrice(id, days, fallback) and getProductLowestPrice(id, days, fallback).

Price list

Run publish from cron every day before 08:00 local time:

Columns, in the order of čl. III: naziv, sifra, marka, neto_kolicina, jedinica_mjere, cijena_za_jedinicu_mjere, maloprodajna_cijena, posebni_oblik_prodaje (DA/NE), naziv_posebnog_oblika_prodaje, sidrena_cijena, barkod, dostupnost. neto_kolicina comes from the draft Pravilnik o načinu objave cjenika (e-Savjetovanje, until 13 November 2026), filled from netQuantityField or by a row handler such as wmd/craft-units. naziv_posebnog_oblika_prodaje is the name of the Commerce catalog pricing rule that gives the sale price (customer-group rules do not count), else the setting above: name the rules as customers see them. Each XML proizvod carries sidreni_datum, the day its sidrena_cijena refers to; the root attribute keeps the default day. Readers should go by the header, not the column position. sidrena_cijena keeps its name until the Pravilnik on bazna cijena is final. File name per čl. VI: {oblik}_{adresa}_{oznaka}_{broj-pohrane}_{YYYYMMDD_HHMMSS}.csv|xml, the outlet parts ASCII and kebab-cased; broj pohrane counts the outlet's runs that day. The decision does not prescribe column names or an XSD; adjust if the Ministry publishes a technical specification.

Prices from a spreadsheet

A shop whose prices are not in Commerce (a catalogue without prices on the web, prices kept in Excel) publishes the price list from a file. Set Price list source to Uploaded file ('priceListSource' => 'file' in config/omnibus.php), then upload the sheet under Utilities → Price list file (users need the utility's permission) or from the console:

Every publish writes the last uploaded file with that day's date. The first sheet is read; its header row needs Šifra, Naziv and Maloprodajna cijena and may have Marka, Jedinica mjere, Neto količina, Cijena za jedinicu mjere, Posebni oblik prodaje, Naziv posebnog oblika prodaje, Sidrena (dodatna) cijena, Barkod and Dostupnost. Missing columns are filled (NE, dostupno, price per unit from the unit: "5l" is the price per litre). Rows that cannot be used are left out and listed after the upload.

One file per store

The settings describe one outlet, the web shop. A retailer with physical stores publishes a file per store ("prodajni objekt") every day; the site adds them from a module or plugin:

Each outlet's file has the web prices. With inventoryLocationId, a variant the web sells only from stock is nedostupno when that location has none; otherwise, and without a location, availability is the web shop's. An outlet that is invalid or repeats another's file name is skipped, and publish exits with an error. A store with its own prices, or one that does not carry a product, changes the row:

The index (priceListRoute and index.html next to the files) lists the files by day, newest first, then by outlet. Files of a store that is no longer registered stay listed under their code until retention removes them.

Console

Command Does
anchor/backfill [--as-of=Y-m-d] [--store=id] record the current price for variants with no history
anchor/import <file> --as-of=Y-m-d [--dry-run] [--delimiter=;] import sku;price of a past reference day
anchor/show <variantId> print the anchor and the lowest price before now
price-list/publish [--outlet=code] write every outlet (or one), prune, index
price-list/preview [--outlet=code] print rows of the web shop (or one outlet)
price-list/outlets list outlets, their stock location and file prefix

Legal references

This plugin implements the rules as published; it is not legal advice.

License

MIT. Developed by WMD.


All versions of craft-omnibus with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
craftcms/cms Version ^5.0.0
craftcms/commerce Version ^5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wmd/craft-omnibus contains the following files

Loading the files please wait ...