Developer notes
Legal sources
Section titled “Legal sources”Read for version 1.0.0 (13 November 2026). The add-on displays text and applies rules the merchant configures; these notes explain the presets.
New York: General Business Law section 349-a (Algorithmic Pricing Disclosure Act)
Section titled “New York: General Business Law section 349-a (Algorithmic Pricing Disclosure Act)”Source: nysenate.gov, GBS 349-A (official consolidated law).
- (1) Definitions: “personalized algorithmic pricing” means dynamic pricing derived from or set by an algorithm that uses consumer data; “personal data” is data that identifies or could reasonably be linked to a specific consumer or device; “clear and conspicuous disclosure” is in the same medium as the price, at or near it, at the same time, in lettering and wording easily visible and understandable to the average consumer; “entity” is a person or organization domiciled or doing business in New York.
- (2) An entity that sets a price with personalized algorithmic pricing and advertises or publishes that price to a New York consumer using that consumer’s personal data must include, with that statement, display, image, offer or announcement, a clear and conspicuous disclosure that reads: “THIS PRICE WAS SET BY AN ALGORITHM USING YOUR PERSONAL DATA”.
- (3) Exceptions: persons subject to the Insurance Law; financial institutions under Title V of the Gramm-Leach-Bliley Act; financial institutions under Financial Services Law 801(f); a price offered to a consumer with an existing subscription that is lower than the subscription contract’s price for the same good or service.
- (4) The Attorney General may send a cease-and-desist letter with a cure deadline, then seek an injunction; civil penalty up to 1,000 USD per violation.
- Upheld against a First Amendment challenge on 8 October 2025 (National Retail Federation v. James, S.D.N.Y.).
Preset: on, no start date, notice on every personal-data price (lower or higher), exempt class subscription only. The text is the statutory sentence: the editor says to keep it unchanged.
Maryland: 2026 Laws of Maryland, Chapter 154 (House Bill 895), Commercial Law section 13-321
Section titled “Maryland: 2026 Laws of Maryland, Chapter 154 (House Bill 895), Commercial Law section 13-321”Source: Chapter 154 (enrolled, chapter text), bill page. Approved 28 April 2026; Section 2: “shall take effect October 1, 2026”. We read the chapter text with the struck-through words removed (the PDF marks committee deletions with strike-through).
- 13-321(A): “dynamic pricing” means offering or setting a personalized price for a good or service that is specific to a consumer based on the consumer’s personal data (whether the seller collected or purchased it); “food retailer” means a merchant operating a business establishment of at least 15,000 square feet that sells food exempt from the sales and use tax under Tax-General 11-206(c); “third-party delivery service provider” facilitates the delivery of such food (not a food retailer); “personal data” has the meaning of 14-4701 (linked or reasonably linkable to an identified or identifiable consumer; not de-identified or publicly available data).
- 13-321(B)(2): a food retailer or third-party delivery service provider may not (I) engage in dynamic pricing to set a higher price for food exempt from the sales and use tax for a specific consumer, or (II) use personal data to set a higher price for such food for a single consumer.
- 13-321(B)(1) exceptions: (I) promotional pricing offers, loyalty program benefits or other temporary discounts or retention pricing; (II) objective costs such as shipping or taxes by location; (III) cost or supply and demand differences between locations; (IV) availability or supply costs; (V) loyalty, membership or rewards programs any consumer may join; (VI) subscription contracts; (VII) a price offered to a consumer who consents to provide personal data in exchange; (VIII) correcting a pricing error; (IX) resetting a price after an outage.
- 13-321(C): no use of protected class data that withholds an accommodation, advantage or privilege (not a pricing feature of this add-on).
- 13-321(D): the Division of Consumer Protection issues a notice of violation and allows 45 days to cure; (E) no private right of action.
- The bill’s separate merchant disclosure section (“THIS PRICE WAS SET BY AN ALGORITHM OR BY USING YOUR PERSONAL DATA”) is struck in the chapter text: Maryland requires no notice.
Preset: off (only food retailers / delivery services are covered), start 2026-10-01 00:00 America/New_York, no notice, guard U (higher prices) on covered goods, exempt classes public_discount, loyalty, subscription, consent.
Connecticut (2026 surveillance pricing provisions)
Section titled “Connecticut (2026 surveillance pricing provisions)”Official source: Public Act 26-64 (SB 4) as amended by HB 5222 and HB 5563 section 501, on cga.ct.gov. The host refused connections from our build machine and from our fetch service on 13 November 2026, so we could not read the enacted text. Secondary sources (for example the Future of Privacy Forum) report: retail sellers and third-party delivery services may not use surveillance pricing; anyone who raises a price with personal data must show a readily visible statement “THIS PRICE WAS INCREASED USING YOUR PERSONAL DATA” (one source quotes “… INCREASED BY A PRICE SETTING DEVICE USING YOUR PERSONAL DATA”) and inform consumers of their privacy rights; exceptions for posted discounts, cost or timing differences, uniform public terms and loyalty programs; Attorney General enforcement only. The start date is reported differently by different sources (all in 2027 except one that reads an older text).
Preset: off, no start date (the merchant enters it), notice text editable, notice only on higher prices, guard U on all products, exempt public_discount, loyalty. The add-on never states a Connecticut date.
New Jersey: Fair Price Protection Act (A4085 / A4523, signed 23 July 2026)
Section titled “New Jersey: Fair Price Protection Act (A4085 / A4523, signed 23 July 2026)”Official source: njleg.state.nj.us (chapter law cited as P.L.2026, c.55 by Lowenstein Sandler). The host refused connections on 13 November 2026; we could not read the enacted text. Secondary sources (FPF, Skadden, Morgan Lewis) report: no person may use surveillance pricing to determine or vary the sale price of groceries and other foodstuffs (including paper products, household cleaning items, health and beauty products, pet food and supplies); exceptions for reasonable cost differences (at most one change in 24 hours), bona fide discounts with public criteria for a broadly defined group, and bona fide opt-in loyalty programs; an unlawful practice under the Consumer Fraud Act (Attorney General and a private right of action with treble damages); start date 1 August 2027 per these summaries.
Preset: off, no start date, no notice, guard A (any variation) on covered goods, exempt public_discount, loyalty.
Not built in 1.0.0
Section titled “Not built in 1.0.0”Seattle’s Fair Pricing and Transparency Ordinance (signed 5 October 2026, not checked) and the bills pending in other states: add a rule per state when a law applies to you (city rules are not supported).
Architecture
Section titled “Architecture”Tygh\Addons\KvPersonalizedPricing\ Rules pure: presets, normalize(), inForce(), decide(), decideAll() (unknown state), decideFor() Context shopper state: shipping > billing > Cloudflare headers (opt-in) > unknown; FPC-cacheable guest page = unknown Store rules, flagged sources, covered categories, minPrice() (same formula as fn_get_product_price + Ultimate shared prices) Engine sources of a product for the shopper, guard, notices Log order log rows, CSV Scanner customer groups with own prices, promotions with customer conditions, price add-onsSource keys: U:<usergroup_id> (customer group price), P:<promotion_id> (catalog promotion), X:<name> (reported by another add-on). Classes: personal, public_discount, loyalty, subscription, consent.
Hooks used
Section titled “Hooks used”| Hook | What |
|---|---|
gather_additional_product_data_before_discounts |
Group guard on displayed products: price += public − personal; quantity tier rows of the reset group are dropped. |
promotion_apply_pre / promotion_apply_post |
Blocked flagged catalog promotions are taken out of the (static) list for this product and put back after. 4.17.2 has no promotion_apply_post: the next promotion_apply_pre restores the list (also covers the early return false when no promotion is left). |
get_product_price_post |
Group guard on fn_get_product_price() (cart lines use it). |
gather_additional_product_data_post |
$product['kv_pp']['notices'] for templates. |
get_cart_product_data_post |
Record per cart line ($cart['products'][hash]['kv_pp']: state, notices, blocked, sources in effect, public price). |
place_order / delete_order |
Order log rows. |
Customer group price: the shopper is in a flagged group, MIN(price) over all their groups is lower than over the non-flagged groups (incl. group 0), and the flagged group’s own row equals that minimum. CS-Cart takes the lowest row, so a group price can only lower a price (“down”). Promotion direction: to_fixed above the base price, to_percentage above 100 or a negative by_* value is “up”.
Template hooks: products:prices_block (post), checkout:product_info, checkout:minicart_product_info, block_checkout:product_extra, orders:product_info (storefront); orders:details_sidebar (admin).
- Full page cache:
Context::cacheable()treats a guest request on a cacheable page as “unknown” (one result for every guest). Cart, checkout, profile, orders, POST and signed-in requests use the address. - Block cache:
schemas/block_manager/blocks.post.phpaddscallable_handlers.kv_pp => fn_kv_personalized_pricing_cache_key()(state part, e.g.kvpp-ny,kvpp-unk,kvpp-xx,kvpp-off) and the rule/source tables as update handlers to the product page, category page and products blocks.
Reporting your own prices (other add-ons)
Section titled “Reporting your own prices (other add-ons)”An add-on that computes a personal price itself can report it, so the notice appears:
// init.php: fn_register_hooks('kv_personalized_pricing_sources');function fn_my_addon_kv_personalized_pricing_sources($product, $auth, &$rows){ if (my_addon_changed_price_for($product['product_id'], $auth)) { $rows[] = ['source' => 'my_addon', 'class' => 'personal', 'direction' => 'down']; }}Or set $product['kv_pp_external'] = [[...same row...]] before gather_additional_product_data_post.
To respect the guard, ask before applying your price:
if (function_exists('fn_kv_personalized_pricing_blocked') && in_array('X:my_addon', fn_kv_personalized_pricing_blocked($product_id, [['source' => 'my_addon', 'class' => 'personal', 'direction' => 'up']]), true)) { // do not apply the personal price for this shopper}Tables
Section titled “Tables”| Table | Content |
|---|---|
?:kv_pp_rules |
One row per state (PK state_code). |
?:kv_pp_sources |
Flagged sources (PK source_type, object_id) with class. |
?:kv_pp_categories |
Covered goods categories. |
?:kv_pp_log |
Order log (order, cart item, product, company, state, action N/G, sources, blocked, notice text, price, public price, time). |
All four are kept on uninstall unless “Permanently delete …” is ticked (retention.json, Retention).
php81 tests/unit_pure.php/php83 tests/unit_pure.php: rules, presets vsaddon.xml, decisions per state, context, engine on seeded caches (group guard, promotion pre/post and the 4.17 restore path, notices, cart record), log, CSV, scanner, language keys, no Connecticut date in shipped text.tests/store_test.php(from the store root),tests/e2e.mjs: store and browser tests (seetests/test-plan.md).