Commit Graph

189 Commits

Author SHA1 Message Date
Navaneeth
f1ffadd39c Make the width of "Back to Store" and "Back to Website" buttons consistent with other buttons in order confirmation page 2025-10-25 22:15:14 +05:30
Cillian O'Ruanaidh
6f7a547e15 Add a :link_to_or_disabled helper method 2025-09-05 09:38:20 +01:00
Cillian O'Ruanaidh
32e3fc0175 Replace disable-dynamically angular directive 2025-09-05 09:38:20 +01:00
cyrillefr
08114b495a Align Cart Price column texts to the left 2025-07-17 14:17:57 +02:00
Carlos Chitty
85e4f749f9 refactor: move unit price formatting logic out of model into helper
Solves Psych::DisallowedClass errors
Example: https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/14739687958/job/41374343627?pr=13232

unit_price returns object with amount and unit, as mentioned in https://github.com/openfoodfoundation/openfoodnetwork/pull/6905\#discussion_r578401368
2025-06-16 12:53:41 +01:00
David Cook
5a1190cdda Remove superfluous %div from haml elements with class
Div is the default element in HAML, so we don't need to specify it. https://haml.info/docs/yardoc/file.REFERENCE.html#implicit-div-elements
2025-03-03 14:46:24 +01:00
Filipe
5d360730c7 Merge pull request #13023 from rioug/12907-fix-checkout-shipping-fee
[Checkout] Shipping fees update, remove order callback
2025-01-23 18:50:31 -06:00
Gaetan Craig-Riou
c71ae35685 Fix payment_total calculation
For payment that complete during the checkout (Paypal, Stripe) the
amount was recorded twice against `order.payment_total`. This is because
the `payment_total` gets updated in an afer_save Payment callback when a
payment is completed, and then once more when we process payment in
`Spree::Order#process_each_payment`.
This is an existing  issue on master, but it was hidden by the
`update_shipping_fees!` callback, it trigerred an update of the order's
total, which then updated `order.payment_total` with the correct value.
Now that we removed the callback, the bug showed up.

Note, I updated the stripe specs for consistency even though they are
currently disabled.
2025-01-20 16:07:32 +11:00
kernal053
45a4b33920 Ensure existing format 'Voucher: Code' on edit cart page. Handle rubocop warning 2025-01-07 09:17:24 +05:30
kernal053
98adefbd67 Add 'Voucher:' before voucher code on edit cart page. Add spec correspondigly 2025-01-04 14:26:02 +05:30
Maikel Linke
135128cf41 Remove obsolete Enterprise#next_collection_at
This was actually shown in one place and represents a user-facing
change. But you weren't able to edit the field which means that only
very old enterprises would have had this field set and were not able to
change it anymore.

I searched au-prod and found the following values in the database:

- "Friday 31st January"
- "From 4pm, Monday 30 September"
- "From 5pm-7pm Monday"
- "Saturday 27 April 12noon"
- "January 31st/February 1st"
- "Saturday 1st February"

They seem specific to a certain order cycle and have no value as
fallback any more. Seems safe to remove.
2024-05-16 07:57:02 +10:00
filipefurtad0
e182365006 Replaces missing keys by existing ones 2024-04-15 15:05:53 +01:00
Maikel Linke
ba51641271 Symbolise hash keys in HAML files
This was done by the haml-up script.
2024-02-22 15:01:14 +11:00
Maikel Linke
c097f2b622 Upgrade HAML syntax with script 2024-02-22 15:01:13 +11:00
Dusan Orlovic
120e299653 Use activate instead of changeActivePanel/ChangeActiveTab
Remove shop-tabs controllers since we can listen on `"data-action":
"orderCycleSelected@window->tabs-and-panels#activateDefaultPanel"`

Test for cases:
* activate by clicking on tab
* activateDefaultPanel on orderCycleSelected event
* activateFromWindowLocationOrDefaultPanelTarget to activate tab based
  on achor in URL
2023-12-16 10:00:17 +01:00
Maikel Linke
c0938d1607 Simplify view with number helpers 2023-10-16 16:37:47 +11:00
drummer83
c2b82651ee Don't show credit owed when = 0 2023-10-13 20:51:12 +02:00
Konrad
5859d2ff78 Merge pull request #11114 from lauriejefferson/not-paid-order-confirmations-resemble-paid-orders-7603
Not paid order confirmations resemble paid orders 7603
2023-10-13 18:52:10 +02:00
lauriejefferson
43232a5d63 removed not-paid styling for credit owed 2023-10-12 11:50:30 -04:00
lauriejefferson
e056ba42db added 'credit owed' label and removed red styling when balance <= 0 2023-10-10 17:14:16 -04:00
lauriejefferson
0cda8d7d4c removed paid styling and added currency formatter to payment_total 2023-10-04 09:30:05 -04:00
lauriejefferson
7320bb5af1 removed styling for paid orders and removed row for non oustanding balance 2023-09-28 20:02:58 -04:00
David Cook
0966864589 Merge pull request #11511 from dacook/fix-update-button-11349
Fix Update button sizing
2023-09-14 13:37:19 +10:00
David Cook
2e6e083667 [fixup] Fix Update button sizing
By disabling line wrap we can consistently predict how it will appear. The longest translation we currently have is 14 characters so this should be fine.
2023-09-14 09:37:10 +10:00
David Cook
99da60921f Fix Update button sizing
This was broken when upgrading [Foundation](https://github.com/openfoodfoundation/openfoodnetwork/pull/11349). For some reason the button.expand class now sets larger font size and padding, which overrides the button.small class. It's probably a bug but we'll have to work around it.
2023-09-08 10:20:26 +10:00
Neal Chambers
b1e40ed605 Fix Rails/HelperInstanceVariable 2023-09-06 22:36:46 +09:00
Matt-Yorkley
28795effc3 Clarify named vouchers in UI 2023-07-04 13:13:05 +01:00
lauriejefferson
3039ef5535 updated order partials and locales 2023-06-23 12:06:45 -04:00
lauriejefferson
d3dba87ca1 added styling and table rows for 'Not Paid' order confirmation' 2023-06-21 17:22:12 -04:00
Matt-Yorkley
b9431cd121 Remove data-hook attributes 2023-04-28 13:03:13 +01:00
Jean-Baptiste Bellet
b559171d0e Put order summary footer into its own file _totals_footer.html.haml 2023-01-20 11:20:35 +01:00
Jean-Baptiste Bellet
c99ec38c85 By default, we reject all adjustements with amount equal to 0 2023-01-20 11:20:35 +01:00
Jean-Baptiste Bellet
99fcbad0f0 On split checkout, do not display footer on order summary
introduced via `display_footer` which is by default `true`
2023-01-20 11:20:34 +01:00
binarygit
3b179e75a4 Stop horizontal scroll on body in cart page 2022-12-19 21:30:31 +05:45
Jean-Baptiste Bellet
8b89c901ef Do not display "Admin and Handling" ie. fees total 2022-10-08 10:00:57 +02:00
Jean-Baptiste Bellet
72df2867d4 Remove admin_and_handling merging
+ update specs as well
2022-10-08 10:00:57 +02:00
Jean-Baptiste Bellet
bf40e59bec Should link to order.distributor website
- order: the order summary the customer is seeing on this page
 - current_order: the order is the customer is check-outing

+ add specs
2022-06-13 14:52:20 +02:00
Filipe
6ff2d4a9d5 Merge pull request #9109 from apricot12/8917-Link-to-enterprise-site
Adding a link to enterprise's own site from Order confirmation page.
2022-06-02 17:59:03 +01:00
Nihal Mohammed
f5ecc6ffe4 Change gap between columns to fit new button 2022-05-09 23:29:40 +05:30
Nihal Mohammed
af58ba523c Renamed groups_helper to link_helper and removed strip_url method, as well as updated specs and ApplicationHelper. Added "Back To Website" button and i18n. 2022-04-26 01:38:25 +05:30
Jean-Baptiste Bellet
9306e054b8 Unless order is complete, /cart could be updated
Split_checkout introduced new state for an order

Update specs as well

Follow up #8944
2022-04-21 14:22:39 +02:00
Jean-Baptiste Bellet
2976b0717c Display "Update" button on the order table page unless order is complete
With the split checkout, we can access this page between the different steps: for this cases, cart actions should be displayed
2022-03-01 10:11:27 +01:00
Matt-Yorkley
f4c86a1b51 Merge pull request #8061 from Matt-Yorkley/turbo-checkout
Split Checkout new toys
2021-09-17 10:48:59 +02:00
Matt-Yorkley
1d5077061e Remove andand
This old gem implemented some functionality for handling nils which is no longer needed, as it's provided natively by Ruby with the &. operator.
2021-09-08 14:28:31 +01:00
Matt-Yorkley
086c5ab264 Replace directive with data-confirm 2021-09-08 10:34:34 +01:00
Matt-Yorkley
03863d2bb2 Delete some other dead frontend code 2021-07-18 11:25:01 +01:00
Jean-Baptiste Bellet
e3f56556cf Remove feature toggle around unit_price and enable it 2021-06-07 20:53:45 +02:00
Matt-Yorkley
ecb4cb31ad Merge pull request #7599 from Matt-Yorkley/cart-rendering
Move line item rendering to a collection in cart page
2021-05-25 13:37:50 +02:00
Luis Ramos
90db52e5f5 Fix route 2021-05-14 00:14:02 +01:00
Matt-Yorkley
122ba385f7 Move line item rendering to collection in cart page
Improvement from upstream Spree commit. Brings a big performance boost to rendering, especially with larger numbers of items in the cart. 50%+ reduction in rendering times reported.
2021-05-10 11:50:31 +01:00