[IMP] website_sale_aplicoop: pay on the checkout page, not a step later
The separate /eskaera/<slug>/payment step is gone. Members review the summary, choose home delivery and pick a payment method on the checkout, in one screen; the old URL redirects there so bookmarks and sessions that were mid-flow do not hit a 404. The checkout now renders the member's draft sale.order instead of the localStorage cart. That is what fixes the products appearing "out of nowhere" between the two pages: the summary was a snapshot of localStorage taken at page load, and `_autoLoadDraftOnInit` then pulled the draft back into localStorage without re-rendering. Deleting a product in the shop removed it from the cart but left the line on the draft, so the autoload resurrected it, the confirm button sent it back, and it only became visible one page later. The checkout no longer auto-loads the draft — it renders it, and what it shows is what the payment form charges. "Proceed to Checkout" pushes the cart to that draft before navigating. Saving is idempotent: `_merge_or_replace_draft` reuses the cycle's draft and, through the new `_draft_matches_lines`, rewrites `order_line` only when the lines actually differ — replacing them unlinks and recreates every one of them, which is pure churn when nothing changed. The home delivery checkbox goes through the new /eskaera/set-home-delivery so the delivery line moves on the order itself. Writing only to localStorage would have changed the summary and left the amount alone, which with online payment on is the amount being charged. Also fixes the confirmation notice nobody ever saw: saving answered with the payment step URL and the frontend followed it immediately, destroying the toast in the same tick. Saving no longer navigates; the caller decides whether it is staying or moving on. Along the way: checkout_labels.js and the eskaera_checkout_summary / eskaera_payment templates are removed, superseded by the server-rendered summary and checkout, and the stale sessionStorage delivery preference no longer overrides the checkbox the order just rendered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
f81c1ca8e7
commit
e625b0c2f3
11 changed files with 873 additions and 746 deletions
|
|
@ -1,5 +1,36 @@
|
|||
# Changelog - Website Sale Aplicoop
|
||||
|
||||
## [18.0.1.16.0] - 2026-08-17
|
||||
|
||||
### Changed
|
||||
|
||||
- **Payment moved into the checkout**: the separate `/eskaera/<slug>/payment`
|
||||
step is gone. Members review the summary, pick home delivery and choose a
|
||||
payment method on `/eskaera/<slug>/checkout`, in one screen. The old URL
|
||||
redirects there so bookmarks and in-flight sessions keep working.
|
||||
- **The checkout summary is server-side**: it renders the draft `sale.order`
|
||||
instead of the localStorage cart, so what is shown is what gets charged.
|
||||
"Proceed to Checkout" pushes the cart to that draft before navigating,
|
||||
reusing the cycle's draft and rewriting its lines only when they differ.
|
||||
- The home delivery checkbox on the checkout writes to the order through
|
||||
`/eskaera/set-home-delivery`, so the total and the payment amount follow it.
|
||||
|
||||
### Fixed
|
||||
|
||||
- The confirmation notice after saving a draft was destroyed by the immediate
|
||||
redirect to the payment step, so members saw nothing at all. Saving no longer
|
||||
navigates.
|
||||
- Products the member had deleted reappeared between the checkout and the
|
||||
payment page. The checkout auto-loaded the draft into localStorage after the
|
||||
summary had already rendered, resurrecting deleted lines, which were then
|
||||
sent back on confirm. The checkout no longer auto-loads the draft — it
|
||||
renders it.
|
||||
|
||||
### Removed
|
||||
|
||||
- `checkout_labels.js` and the `eskaera_checkout_summary` / `eskaera_payment`
|
||||
templates, superseded by the server-rendered summary and checkout.
|
||||
|
||||
## [18.0.1.13.0] - 2026-08-11
|
||||
|
||||
### Added
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue