Skip to content

Releases: originalconcepts/oc-bundle

v1.5.4

Choose a tag to compare

@originalconcepts originalconcepts released this 21 Sep 08:37

= 1.5.4 =

  • Fix: the price stored for a bundle left out the surcharge of an automatic swap, so the
    shop sorted and filtered by a lower price than the one shown on the page and in the cart.
    The stored price now matches the displayed one, reaches the product lookup table, and is
    refreshed whenever a component (or one of its alternatives) goes in or out of stock.
  • Fix: returning the component stock of an order line is now recorded right away. When an
    integration failed half way through rebuilding an order, a retry returned the same stock
    a second time.

v1.5.3

Choose a tag to compare

@originalconcepts originalconcepts released this 20 Sep 22:40

Plugin update for the bundle (מארז) product type. Includes everything tagged since the last release (v1.4.7): 1.5.0 Giorgio sync, 1.5.1 order-line API and unit-weight pricing, 1.5.2 automatic-swap pricing, 1.5.3 fixes.

= 1.5.3 =

  • Fix: a bundle whose price comes from its components showed "0.00" on the order, the
    invoice and order emails, instead of no amount at all.
  • Fix: an order line pushed by an integration that both re-measures a component and sets
    the line total lost that total, and the mark that says the price belongs to the
    integration. The line was re-priced from the catalogue and could move again on a later
    re-weigh, so the order stopped matching what the integration charged.
  • Fix: the translation template (languages/oc-bundles.pot) was missing a line and could
    not be read by translation tools.

= 1.5.2 =

  • Catalog / archive price of a bundle now includes the surcharge of AUTOMATIC swaps: with
    "Swap automatically", an out-of-stock component is replaced by its first in-stock
    alternative, and the listed price (regular and sale) is the price the customer gets in
    the cart - it used to show the price with the component that cannot be bought.
  • Alternatives can carry their OWN quantity: qty on a swap entry (REST API, and a
    "Quantity" field next to the surcharge in the admin). Empty / 0 keeps inheriting the
    component's quantity. An alternative with its own quantity is measured the way its
    product is sold (kg for a product sold by weight, units otherwise), in the cart, on
    the order line and for stock.
  • oc_bundles_add_order_line() / oc_bundles_update_order_line(): a swapped component may
    state qty (per bundle) and unit explicitly - an integration that re-expresses a
    swap to a differently measured product by weight (2 portions of 0.2 kg -> 0.4 kg)
    keeps the order line, its label and its stock in that unit.

= 1.5.1 =

  • Merged with 1.4.7: a bundle split for the invoice keeps the ordinary component lines
    (product name, shipped quantity in the quantity column, unit as meta). Weighed
    quantities pushed by an integration (oc_bundles_update_order_line actual_qty) are
    written to those line quantities, so the order screen and the integration see the
    same numbers; a line whose total the integration owns is never re-priced or "put
    back" by an admin re-weigh - it keeps the pushed amount. Component lines are linked
    to their bundle line by its uid (1.4.7) and, once saved, by its item id
    (_oc_bundle_parent_item, what Giorgio reads).
  • Pricing: a component ordered by units but priced per kg (OC Sale Units "sold by
    units" with a unit weight - e.g. a ~200 g portion of a 145/kg product) now costs
    price x unit weight per unit in a "sum" bundle, exactly like the same product on a
    regular cart line (was: price x units, i.e. 145 per portion). Applies to the bundle
    price, to re-weighing and to the invoice split. For a "choose a weight" product the
    REST API accepts unit_weight (kg) per component; without it the first weight
    option is used.
  • Re-pricing of a "sum + re-weigh" bundle line no longer runs before anything was
    weighed (checkout / status changes): the cart price stands until picking. It used
    to replace "original price + swap surcharge" with the swapped product's own price
    x the slot quantity, so an order could total more than the cart it came from.

= 1.5.0 =

  • Giorgio sync: bundles can carry an external id (external_id in the REST API,
    ?external_id= filter on the list). A bundle that has one is managed from Giorgio:
    the "Bundle contents" tab turns read-only with a notice, and saving the product no
    longer overwrites its configuration (filter oc_bundles_lock_managed).
  • Every component now has a stable key (accepted and returned by the REST API,
    generated per card in the admin, derived for older data). It follows the slot
    through swaps and onto the order line.
  • REST API hardening: invoice_display is validated, and a component whose product
    does not exist is rejected with a 400 (oc_bundles_invalid_component) before
    anything is written.
  • Order lines can now carry a swap to a product that is not one of the configured
    alternatives (swap_index = -2, product and surcharge on the selection entry).
    Only external integrations produce it; the shop front end is unchanged.
  • Component lines created by the invoice split are linked to their bundle line by
    item id, so two lines of the same bundle in one order no longer share their
    component lines.
  • New public functions for integrations: oc_bundles_is_bundle_product(),
    oc_bundles_is_bundle_order_item(), oc_bundles_is_component_line(),
    oc_bundles_get_order_item_bundle_data(), oc_bundles_add_order_line(),
    oc_bundles_update_order_line(), oc_bundles_release_order_line() (returns a
    bundle line's component stock before the line is removed from an order).
  • Updating a bundle line swaps stock correctly: a component replaced on the line
    gives its taken quantity back to the old product and the new product is reduced
    in full. A line whose total is owned by Giorgio splits its components (sum
    pricing) so they add up to exactly that total, and the component lines are named
    after the weighed quantities. Re-splitting updates existing component lines in
    place instead of removing and re-adding them. Saving a Giorgio-managed bundle in
    the admin refreshes its price meta.
  • Store promotions can now reach bundles: the cart price is set early and captured
    last, so a promotion engine's discount is what gets charged; the regular price of a
    bundle is its pre-discount base, so it reads as "on sale" when discounted. New
    setting under Settings → Bundles API (on by default) restores the old ordering
    when turned off.

v1.4.7

Choose a tag to compare

@originalconcepts originalconcepts released this 13 Sep 20:36

1.4.7 — bundle components as ordinary order lines

  • Orders: a bundle split for the invoice (invoice_display = components) now lists each component as an ordinary WooCommerce line. The line shows the product's name, the quantity that ships in the quantity column, and its unit as item meta. Previously the quantity was spelled out in the line name.
  • Re-weighing: edit the component line's quantity, like any weighable product. This works on the order screen while the order is pending payment or on hold, or through the WooCommerce REST API.
    • Saving settles component stock by the difference.
    • The line keeps its checkout amount unless the bundle has reweigh_price.
  • No separate table: the "Weighed quantities" table under the bundle line no longer appears for these orders. Orders split before 1.4.7 keep it.
  • Removed lines: removing a component line, or saving it at quantity 0, returns that component's stock.
  • Two lines of the same bundle: each component line is tied to its own bundle line, so two lines of the same bundle in one order never mix.
  • REST updates: WooCommerce REST order updates settle component stock too, once the order has taken its stock.

For integrations (e.g. Giorgio): order line structure changed in 1.4.7

  • Quantity and name: a component line's quantity is the quantity that ships (it may be a decimal), not 1. Its name is the product name, so don't parse quantities out of line names. The unit is visible item meta (Unit, translated; יחידת מידה on Hebrew sites).

  • Identifying lines: component lines have no product_id, so identify them by hidden meta, returned in meta_data.

    Line Meta Meaning
    Component _oc_bundle_component_of Bundle product ID
    Component _oc_bundle_component_index Component index in the bundle
    Component _oc_bundle_component_parent The bundle line's _oc_bundle_line_uid
    Component _oc_bundle_component_qty_line 1
    Bundle _oc_bundle_line_uid Links the bundle line to its component lines
    Bundle _oc_bundle_qty_lines 1
  • Pushing a weighed amount: send PUT /wp-json/wc/v3/orders/{id} with line_items: [{"id": <component line id>, "quantity": 0.6}]. No plugin endpoint is needed.

  • Older orders: orders split before 1.4.7 keep the old shape: the quantity is in the name and the line quantity is 1.

Also in this release (tagged earlier, first GitHub Release)

  • 1.4.6: a bundle line in the Deliz float cart gets the theme's "Edit" button. It reopens the product popup with the customer's quantity and swaps, and saving replaces the cart line. The popup REST payload accepts oc_bundle_selection.
  • 1.4.5: a discounted bundle reports regular = before the discount and sale = after it, so it shows struck-through and in sale colours like any product on sale. A coupon that excludes sale items now skips it. Deliz popup: bundles get the theme's opening scroll nudge.
  • 1.4.4: in the Deliz float cart, a bundle keeps the standard cart row and lists its contents on a full-width line under it, with no sideways scroll.