Skip to content

Register cart, order and combination extra fields in demoextrafield - #258

Open
jolelievre wants to merge 1 commit into
PrestaShop:masterfrom
jolelievre:demoextrafield-cart-order-combination
Open

Register cart, order and combination extra fields in demoextrafield#258
jolelievre wants to merge 1 commit into
PrestaShop:masterfrom
jolelievre:demoextrafield-cart-order-combination

Conversation

@jolelievre

Copy link
Copy Markdown
Contributor

Description

Companion of PrestaShop/PrestaShop#42538 (extra properties: non-conventional entity naming, default value typing, cart entity). Adds one example per newly supported entity and doubles as the manual-test vehicle for the core PR:

  • cart / delivery_note (COMMON — the cart is a COMMON-only entity, it has no cart_lang/cart_shop base table): seeded once by actionCartSave, displayed on the checkout summary via displayCheckoutSummaryTop reading {$cart.extra_properties.demoextrafield.delivery_note}, and copied onto the order at actionValidateOrder — the intended pattern for cart values that must survive checkout.
  • order / delivery_note (COMMON), registered with the natural entity name order (the core resolves the orders table and id_order primary key), displayed on the customer's order detail page (displayOrderDetail). Deliberately no order-grid placement (id-first pagination limitation, [Extra Properties] Grid columns are silently skipped on grids using id-first pagination (order grid) PrestaShop#42536).
  • combination / ean_verified (COMMON, exposed on the combinations Admin API list) and combination / restock_note (SHOP), registered as combination (resolved to product_attribute / id_product_attribute).
  • The customer extra_json field becomes the JSON showcase: the module writes a PHP structure (the core encodes it for storage) and the shared template iterates the decoded structure reads return.
  • README refreshed: full entity inventory, the snake_case extra_properties Smarty key (extraProperties is Admin-API-JSON-only), the COMMON-only cart caveat.

Requires a core build containing PrestaShop/PrestaShop#42538.

How to test

  1. Install the module on a 9.2 build with the core PR: the registry (Advanced Parameters > Extra Properties) lists the cart, order and combination entities.
  2. Add a product to the cart, open the checkout: the seeded delivery note shows above the cart summary. Place the order: the note appears on the order detail page in the customer account.
  3. On the my-account page, the customer JSON field renders as an iterated structure, not a raw string.

Companion of PrestaShop/PrestaShop#42538, one example per newly supported
entity:

- cart/delivery_note (COMMON — the cart is a COMMON-only entity): seeded
  by actionCartSave, displayed on the checkout summary
  (displayCheckoutSummaryTop reading
  {$cart.extra_properties.demoextrafield.delivery_note}), and copied
  onto the order at actionValidateOrder — the intended pattern for cart
  values that must survive checkout;
- order/delivery_note (COMMON), registered with the natural entity name
  'order' (the core resolves the orders table and id_order primary key),
  displayed on the customer's order detail page; deliberately no
  order-grid placement (id-first pagination limitation, core #42536);
- combination/ean_verified (COMMON, exposed on the combinations API
  list) and combination/restock_note (SHOP), registered as 'combination'
  (resolved to product_attribute);
- the customer extra_json field becomes the JSON showcase: the module
  writes a PHP structure (encoded by the core for storage) and the
  shared template iterates the decoded structure reads return;
- README refreshed: full entity inventory, the snake_case
  extra_properties Smarty key (extraProperties is Admin-API-JSON-only),
  the COMMON-only cart caveat.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant