354 Commits

Author SHA1 Message Date
Valentin Lab
7a189abf0b fix: move `build directory to resources/shop` 2025-10-04 10:13:38 +02:00
Valentin Lab
34fc1c33bf fix: repair favicon links and provide one from https://www.jardinenvie.com 2025-10-04 09:41:15 +02:00
Valentin Lab
61e34b4f4e fix: finalize payments and clear cart after Paybox success
This captures the Paybox verification flow, duplicate-payment guard, and cart cleanup.
2025-10-04 09:17:53 +02:00
Valentin Lab
7fe2770d45 fix: do not call debugbar if not available (when in prod) 2025-09-29 11:32:19 +02:00
Valentin Lab
0479ae25f8 new: add docker build reproducible code 2025-09-29 11:22:02 +02:00
Valentin Lab
0a45b0c71f fix: pkg: repair grunt 2025-09-25 13:58:09 +02:00
ludo
1cc6cc879e fix: fix 2025-04-21 10:57:31 +02:00
ludo
adbba79bd2 fixes 2025-03-18 13:06:02 +01:00
ludo
592402a6c1 fixes 2025-02-15 12:12:42 +01:00
ludo
d1cc62c9b1 remove browsershot 2025-01-03 16:05:05 +01:00
ludo
a76d81c437 fix contents 2025-01-03 16:04:19 +01:00
ludo
2e71f17856 fix calculation on indirect articles by tags 2025-01-03 14:45:23 +01:00
ludo
df78126b12 refactor scopes 2025-01-03 14:09:22 +01:00
ludo
befaa40b48 fixes 2025-01-03 03:46:45 +01:00
ludo
b3fbfc38e7 fixes 2024-06-17 21:56:42 +02:00
ludo
ee60bac538 fixes on addresses 2024-04-29 22:01:45 +02:00
ludo
c63bb762ed fix on producter 2024-03-11 19:31:22 +01:00
ludo
44bfe7d09c fix on tags 2024-03-11 19:02:57 +01:00
ludo
5db7438c27 fixes on auth customers 2024-03-11 18:48:25 +01:00
ludo
2227242704 fix route 2024-03-11 18:38:23 +01:00
ludo
7b7295aed1 fixes 2024-03-03 22:52:00 +01:00
ludo
26ca3eb3ca Core classes removed by error 2024-03-03 14:53:54 +01:00
ludo
139aeb8074 fixes 2024-03-03 14:44:35 +01:00
ludo
cc411cba68 minor fixes 2024-02-23 08:35:41 +01:00
ludo
fb6da523fa cleaning day 2024-02-22 21:28:33 +01:00
ludo
64a218afc2 coding style 2024-02-22 19:35:51 +01:00
ludo
722ea43bc2 add monitoring 2024-02-22 19:33:56 +01:00
ludo
869b148e20 add seo 2024-02-19 23:51:32 +01:00
ludo
15a6621a56 add shop cart storage 2024-02-07 21:54:58 +01:00
ludo
601b758179 fixes 2024-02-07 21:11:17 +01:00
ludo
e559c785c2 add health route 2024-02-07 21:07:19 +01:00
ludo
329643ce3b add health route 2024-02-07 21:05:48 +01:00
ludo
7bb38071ef add health 2024-02-07 21:01:02 +01:00
ludo
ee9979f547 fix 2024-02-07 20:43:58 +01:00
ludo
c4fda18356 move autocomplete for customer 2024-02-07 20:41:04 +01:00
ludo
8c6e10fb3b force https on docker 2024-02-07 20:31:51 +01:00
ludo
5a400aaedd add restore backup 2024-02-05 22:36:45 +01:00
ludo
23fb8a79ac fix on worker with php 8.2 2024-02-05 22:04:17 +01:00
ludo
67e439f420 fix ports 2024-02-05 21:48:07 +01:00
ludo
df377c4f3f fix on docker 2024-02-05 21:38:40 +01:00
ludo
69264dcf80 fix on docker 2024-02-05 21:34:29 +01:00
ludo
308b6cb349 add watermark on zoom, update display of article nature on shelve (change icon to text 2024-02-04 22:09:53 +01:00
ludo
4c6f9b3b61 add datatbles for invoices, add pdf icon, refactor icons components, add autocomplete on search, adapt searching to meilisearch 2024-02-04 02:51:38 +01:00
ludo
067532b6fc add new search engine 2024-01-31 23:45:58 +01:00
ludo
8eb3104b2a add metrics 2024-01-30 23:24:00 +01:00
ludo
1bc9bf9fe9 add migration to catrt storage, update SCOUT 2024-01-29 23:45:55 +01:00
ludo
53ad10eefa add new metrics, graph metrics, prepare basket to storage 2024-01-29 23:44:49 +01:00
ludo
9fcc81f4d9 add graphs for stats 2024-01-29 22:39:57 +01:00
ludo
75107285e7 Merge branch 'master' of https://gitlab.huma.net/ludo/opensem 2024-01-28 20:28:39 +01:00
ludo
502b71617a fix articles datatables, enhance statistics 2024-01-28 19:56:13 +01:00
Ludovic CANDELLIER
ca474ddadb restrict ports to be compatible with legacy version 2024-01-23 00:01:15 +01:00
Ludovic CANDELLIER
fbe9633651 add certbot 2024-01-22 23:05:39 +01:00
Ludovic CANDELLIER
1677ec6b03 add slave1 2024-01-22 23:04:23 +01:00
Ludovic CANDELLIER
1533c18c54 remove highcharts 2024-01-22 23:01:33 +01:00
Ludovic CANDELLIER
fc5a3186bf remove old models 2024-01-22 22:52:03 +01:00
ludo
0bb75125a7 update 2024-01-22 22:50:56 +01:00
ludo
af5fc8d0ee Merge branch 'master' of https://gitlab.huma.net/ludo/opensem 2024-01-22 22:47:39 +01:00
ludo
17e322cd88 update migrations 2024-01-22 22:47:20 +01:00
Ludovic CANDELLIER
8ceab7e9f5 update docker 2024-01-22 22:14:36 +01:00
ludo
116f289285 refactoring on Articles, minor fixes 2024-01-21 11:42:42 +01:00
ludo
560ef61c9f render invoice in pdf 2024-01-07 23:16:29 +01:00
ludo
4df8628a3e fixing styles 2024-01-07 20:42:37 +01:00
ludo
5144c1f7fd fix devops error 2024-01-05 01:30:46 +01:00
ludo
90b0af5b2d coding styles 2024-01-04 15:54:18 +01:00
ludo
03027cde01 fix on payment by cb 2024-01-04 15:43:02 +01:00
ludo
8a463e7b9e update payments and vat mentions 2023-12-21 23:04:42 +01:00
ludo
643c26d549 fix parameters for invoices 2023-12-21 16:57:40 +01:00
ludo
ee64ae0be7 fix greedy replace 2023-12-12 21:40:24 +01:00
ludo
e0d8106078 minor fixes 2023-12-11 21:09:48 +01:00
ludo
df65516b36 adjust deliveries by customer 2023-12-11 21:07:49 +01:00
ludo
25b78f3380 change homepages to contents, add new methods to deliveries and sale_channels by customer 2023-12-09 23:55:50 +01:00
ludo
2a429e4163 minor fixes 2023-12-09 21:02:28 +01:00
ludo
b5da5fc881 enhance invoice display 2023-12-03 02:20:41 +01:00
ludo
ec509df665 better management of shipping and basket summary display 2023-12-03 00:40:47 +01:00
ludo
4bcfc7bc6d add basket on merchandise form 2023-11-25 20:42:15 +01:00
ludo
9949ae95cf update 2023-11-25 20:23:21 +01:00
ludo
82b864768e fix invoice payment 2023-11-25 19:33:41 +01:00
ludo
34f0b2796f add payments by invoice 2023-11-25 16:21:35 +01:00
ludo
731c31a58c fix on merchandises with validator 2023-11-25 16:21:02 +01:00
ludo
9b18531c83 try to refresh total with recalculation by delivery and delivery_type 2023-11-16 00:00:05 +01:00
ludo
2ebdc5f16b add shipping to order, methods to calculate, little refactoring 2023-11-15 23:20:42 +01:00
ludo
04df068931 fixes 2023-11-14 00:25:58 +01:00
ludo
86b8156e38 little refactoring 2023-11-14 00:11:31 +01:00
ludo
b86b043604 add validator, optimizations 2023-11-13 23:03:12 +01:00
ludo
23ac0cedad fix on weight 2023-11-13 00:40:41 +01:00
ludo
9f90f983ab Fix on addresses 2023-11-13 00:02:21 +01:00
ludo
4ce3d528dd fix on product null 2023-11-08 17:07:53 +01:00
ludo
e42ac75ff7 fix if no icon 2023-11-08 16:55:26 +01:00
ludo
746cf661ce fix basket 2023-10-31 17:05:41 +01:00
ludo
a9432bd3c1 add filter not collapsed if filter is on 2023-10-17 17:47:25 +02:00
ludo
f3b9db1a6f fix on customer auth, fix filters on shelves, refactor for article_nature, add slug 2023-10-17 17:20:30 +02:00
Ludovic CANDELLIER
50d5d6944d Supprimer le fichier .env du répertoire docker 2023-09-13 23:10:04 +02:00
Ludovic CANDELLIER
bc7880b242 add docker version 2023-09-13 23:04:55 +02:00
Ludovic CANDELLIER
5f215cef81 coding style 2023-09-13 22:53:37 +02:00
Ludovic CANDELLIER
da48f41ec0 minor fix on updating status of order, upgrade datatables 2023-09-13 22:17:49 +02:00
Ludovic CANDELLIER
eda2bbf1db adapt display of article_natures 2023-09-12 23:39:28 +02:00
Ludovic CANDELLIER
5e161745bb adapt display of article natures by disponibility of offers in shelve 2023-09-12 23:27:56 +02:00
Ludovic CANDELLIER
a29faabbf2 add methods to get icon on article natures 2023-09-12 23:00:36 +02:00
Ludovic CANDELLIER
470560efb6 refactor datatables admin 2023-08-29 23:31:15 +02:00
Ludovic CANDELLIER
b1d16a7871 refactoring of admin datatables 2023-08-29 22:56:37 +02:00
Ludovic CANDELLIER
496274b4f4 fix orders datatables on profile, fix deliveries for profile (public & active) 2023-08-29 22:15:37 +02:00
Ludovic CANDELLIER
7addea00a2 fixes on login 2023-08-28 22:58:11 +02:00
Ludovic CANDELLIER
f721422abc fixes 2023-08-28 21:48:04 +02:00
Ludovic CANDELLIER
1cba52bb6d fixes, add weight 2023-08-01 21:55:17 +02:00
Ludovic CANDELLIER
902604b9cd fixes 2023-07-16 18:09:40 +02:00
Ludovic CANDELLIER
b8c31f6049 fix shipping 2023-07-16 17:54:44 +02:00
Ludovic CANDELLIER
1675745e2a fixes on bad pint 2023-07-16 15:07:15 +02:00
Ludovic CANDELLIER
0879b0abf0 add shipping rules 2023-07-16 14:45:42 +02:00
Ludovic CANDELLIER
72a7b270f9 add mail tracker 2023-07-04 23:33:13 +02:00
Ludovic CANDELLIER
3d16580bc8 add multiple addresses on customer edition 2023-07-04 23:32:41 +02:00
Ludovic CANDELLIER
d6ab6c73e2 rollback to retrieve buttons 2023-07-04 19:24:31 +02:00
Ludovic CANDELLIER
9f9b7173d7 fixes on mail templates, change order edit layout, add DeliveryTypes, DeliveryTypeCalculations & DeliveryPackages 2023-05-24 23:30:29 +02:00
Ludovic CANDELLIER
c677dbd5fa add package to date scopes & browsershot 2023-05-09 21:51:48 +02:00
Ludovic CANDELLIER
313525a25b finish implementing mails 2023-04-17 00:27:03 +02:00
Ludovic CANDELLIER
24e518fffe add methods to detect distinct product type et article nature on shelve 2023-04-01 22:01:15 +02:00
Ludovic CANDELLIER
7d1a34a12e simplify variables names for templates, refactor to be multi-model 2023-03-28 00:17:04 +02:00
Ludovic CANDELLIER
938d6a9cbd Enhance modal 2023-03-27 23:12:57 +02:00
Ludovic CANDELLIER
0a6b90b434 fix on article based on old merchandise 2023-03-27 21:05:37 +02:00
Ludovic CANDELLIER
20b3521c72 add basket on rows, uniformize baskets 2023-03-21 23:16:47 +01:00
Ludovic CANDELLIER
06c68dd223 fix recalculation on basket, fix quick add on basket 2023-03-21 22:41:48 +01:00
Ludovic CANDELLIER
4f9f9b296d cosmetic fixes, enhance profile, fix mails, ... 2023-03-14 23:33:14 +01:00
Ludovic CANDELLIER
7454411d27 fix active hierarchy in menu and megamenu 2023-03-14 21:46:57 +01:00
Ludovic CANDELLIER
4e69399309 add datatables on orders 2023-02-28 08:42:53 +01:00
Ludovic CANDELLIER
3745abc90b remove buggy package for logging mail / incompatible with laravel 9 2023-02-27 23:16:45 +01:00
Ludovic CANDELLIER
0828ac3377 quick add to basket on shelves 2023-02-27 23:16:15 +01:00
Ludovic CANDELLIER
b3d16a06b0 adapt to laravel 9 2023-02-27 23:15:16 +01:00
Ludovic CANDELLIER
753be00a1e fix modal 2023-02-27 22:02:19 +01:00
Ludovic CANDELLIER
a63618a753 fixe menu 2023-02-27 21:45:28 +01:00
Ludovic CANDELLIER
3287caac54 fix typo 2023-02-17 22:27:07 +01:00
Ludovic CANDELLIER
312f1f4e3d fix typo on Admin 2023-02-17 22:22:04 +01:00
Ludovic CANDELLIER
39e3407ea1 fix on sale_channel get_default 2023-02-17 22:08:13 +01:00
Ludovic CANDELLIER
03a52d504b fix on sale_channel get_default 2023-02-17 22:07:43 +01:00
Ludovic CANDELLIER
c1d7f3fe10 fix if default sale channel empty 2023-02-17 21:47:36 +01:00
Ludovic CANDELLIER
8e571de523 Fix on invoices, add delivery reference, wip on dashboard concurrency requests designed on template 2023-02-17 00:05:03 +01:00
Ludovic CANDELLIER
878ec7a8f2 remove debug mode 2023-02-14 00:30:30 +01:00
Ludovic CANDELLIER
06107cb8fc Add overlay on css, adapt shelves, fix bienvenue mail on laravel 9 methods 2023-02-14 00:20:00 +01:00
Ludovic CANDELLIER
10cebd0955 upgrade to version 9 2023-02-13 23:47:01 +01:00
Ludovic CANDELLIER
0ecc7c73c7 enhance components, add mailtemplate, add traits for translations, for stats 2023-02-13 22:52:39 +01:00
Ludovic CANDELLIER
f2f4788ce1 change icons, css, add routing to merchandise, add mail templater, fixes 2023-02-12 23:34:48 +01:00
Ludovic CANDELLIER
8313e25f2e fix megamenu on hover for yellow background 2023-02-12 00:11:25 +01:00
Ludovic CANDELLIER
cafd0a49e7 change registration or connection in order page, change filter on shelve page, add new api to get article_nature by product_type, css fixes 2023-02-10 23:11:48 +01:00
Ludovic CANDELLIER
405effe43e fix on empty images on merchandise 2023-02-09 23:49:17 +01:00
Ludovic CANDELLIER
4914e0c9c9 add cookie consent, change search for product_type empty 2023-02-07 23:25:59 +01:00
Ludovic CANDELLIER
909336bb8b fix debug mode 2023-02-06 23:52:20 +01:00
Ludovic CANDELLIER
60682f2295 remove order alphabetically because is against reordering tree 2023-02-06 23:48:50 +01:00
Ludovic CANDELLIER
2fc88c6163 fix col, because bug on 2 lines for long menu 2023-02-05 23:22:44 +01:00
Ludovic CANDELLIER
6c60d9a148 fix 2023-02-05 23:16:00 +01:00
Ludovic CANDELLIER
cb488383e0 fix css and html structure 2023-02-05 22:57:47 +01:00
Ludovic CANDELLIER
32291dc44a enhance css 2023-02-05 21:40:05 +01:00
Ludovic CANDELLIER
0123885e03 enhance addresses 2023-01-01 22:45:27 +01:00
Ludovic CANDELLIER
72d989f692 fix on login 2023-01-01 21:24:40 +01:00
Ludovic CANDELLIER
66e0197b50 fix 2022-12-29 19:23:28 +01:00
Ludovic CANDELLIER
bfd30b668e fixes 2022-12-29 17:13:43 +01:00
Ludovic CANDELLIER
28c200fd9f fix design, add addresses 2022-12-29 16:16:09 +01:00
Ludovic CANDELLIER
7819a8e11b fix 2022-12-22 18:17:50 +01:00
Ludovic CANDELLIER
b6821d52a7 fix 2022-12-22 18:16:25 +01:00
Ludovic CANDELLIER
b4d8bab385 fix 2022-12-22 12:10:44 +01:00
Ludovic CANDELLIER
d72dfa5b6b fix description on shelves 2022-12-22 01:17:01 +01:00
Ludovic CANDELLIER
35fcc992ae fix cache css 2022-12-22 01:12:40 +01:00
Ludovic CANDELLIER
0feebca7e0 fixes 2022-12-22 01:09:11 +01:00
Ludovic CANDELLIER
5151f393be fix layout 2022-12-21 18:33:15 +01:00
Ludovic CANDELLIER
73ed46bc28 remove dump 2022-11-24 17:51:37 +01:00
Ludovic CANDELLIER
533b63f8fb fix routes 2022-11-24 17:48:08 +01:00
Ludovic CANDELLIER
966e687509 fix on better routes 2022-11-24 17:41:57 +01:00
Ludovic CANDELLIER
ee1511962b fix 2022-11-24 16:07:40 +01:00
Ludovic CANDELLIER
d62cad1725 fixes on invoices relations and revisions 2022-11-20 00:21:38 +01:00
Ludovic CANDELLIER
0cf5569a4c Merge branch 'master' of https://gitlab.huma.net/ludo/opensem 2022-11-19 23:43:39 +01:00
Ludovic CANDELLIER
73763bb146 fix editing orders 2022-11-19 23:43:12 +01:00
Ludovic CANDELLIER
caee665758 reorganize 2022-11-11 13:24:24 +01:00
Ludovic CANDELLIER
7df2421373 restart 2022-11-11 13:05:40 +01:00
Ludovic CANDELLIER
f89acd9399 [WIP] Working on orders & invoices 2022-08-19 22:04:44 +02:00
Ludovic CANDELLIER
c22b10dd10 [WIP] Finish the order process 2022-08-18 18:20:44 +02:00
Ludo
5cd48c03f9 Add new file 2022-08-02 14:21:10 +00:00
Ludovic CANDELLIER
d423fce4f5 fixes 2022-07-04 00:35:43 +02:00
Ludovic CANDELLIER
573e98a2ce [WIP] Order process with interactive methods 2022-07-03 23:36:33 +02:00
Ludovic CANDELLIER
06cfb92757 [WIP] Order process 2022-07-03 22:38:08 +02:00
Ludovic CANDELLIER
bcb3e15f33 fix on array 2022-07-03 10:48:42 +02:00
Ludovic CANDELLIER
b392b426d5 fix 2022-07-03 09:31:45 +02:00
Ludovic CANDELLIER
e435752484 begin order form with registration 2022-06-26 23:33:39 +02:00
Ludovic CANDELLIER
c2fd71e3d1 fix selector on filters 2022-06-22 22:40:04 +02:00
Ludovic CANDELLIER
e9ab7173f8 Refactor article getter for descriptions & tags, minor fixes on tags 2022-06-22 22:28:18 +02:00
Ludovic CANDELLIER
6b1cc0f045 change for description by level of data 2022-06-16 22:59:26 +02:00
Ludovic CANDELLIER
123b951538 missing file 2022-06-14 22:29:18 +02:00
Ludovic CANDELLIER
9710a7017a fixes 2022-06-14 22:24:24 +02:00
Ludovic CANDELLIER
32044118f3 new routes 2022-06-13 23:30:06 +02:00
Ludovic CANDELLIER
b37321daf8 [WIP] begin of new display for article, shelves 2022-06-13 23:29:05 +02:00
Ludovic CANDELLIER
e31978b1e3 change display on categories 2022-05-31 23:21:04 +02:00
Ludovic CANDELLIER
5b74c93b2e Works for friday & saturday 2022-05-29 00:46:04 +02:00
Ludovic CANDELLIER
352b109e87 Add new component, add flags on filter 2022-05-09 23:14:50 +02:00
Ludovic CANDELLIER
a70e8c39cf modify filter calculation 2022-05-09 22:33:18 +02:00
Ludovic CANDELLIER
439a339027 fixes on merchandise 2022-05-02 08:34:40 +02:00
Ludovic CANDELLIER
2ee339a022 fix on empty picture 2022-04-25 23:43:25 +02:00
Ludovic CANDELLIER
84063d2f72 Fix on merchandises 2022-04-25 23:31:24 +02:00
Ludovic CANDELLIER
61a52ef330 Fixes on available offers in category childrens for building menu 2022-04-25 22:36:43 +02:00
Ludovic CANDELLIER
c9bf18d87d fix on shelve with available offers 2022-04-25 21:59:53 +02:00
Ludovic CANDELLIER
328d791b87 fix on empty shelve 2022-04-25 20:46:18 +02:00
Ludovic CANDELLIER
e22a541342 fix 2022-04-25 20:29:50 +02:00
Ludovic CANDELLIER
d8bf91da54 Add plus on products 2022-04-25 20:02:28 +02:00
Ludovic CANDELLIER
5747b93952 Add producers 2022-04-25 11:07:02 +02:00
Ludovic CANDELLIER
570374bab7 Add new data in getBasket context 2022-04-24 23:49:28 +02:00
Ludovic CANDELLIER
416c724ad1 Add new data in getBasket context 2022-04-24 23:20:52 +02:00
Ludovic CANDELLIER
5d68e8787a 'fixes' 2022-04-24 22:07:31 +02:00
Ludovic CANDELLIER
e4672a42d7 fixes 2022-04-22 02:32:53 +02:00
Ludovic CANDELLIER
94234218d6 Filters collapsed, customer auth and register, fix on basket recalculation 2022-04-20 00:16:16 +02:00
Ludovic CANDELLIER
a12dd0c653 fix on basket 2022-04-17 00:16:36 +02:00
Ludovic CANDELLIER
fe1e14d2c0 Multi-images component, refactoring medias functions 2022-04-16 19:33:17 +02:00
Ludovic CANDELLIER
1dc815bf39 Add count function for images herited 2022-04-16 13:58:09 +02:00
Ludovic CANDELLIER
2d111605f2 Add management of merchandises, enhance imageable trait 2022-04-16 11:40:19 +02:00
Ludovic CANDELLIER
68a13b7a58 Build form for merchandise 2022-04-14 23:41:58 +02:00
Ludovic CANDELLIER
c2ef0c7b35 Add merchandise, fix articletosell with src for images 2022-04-14 23:20:09 +02:00
Ludovic CANDELLIER
9c2b9cf02e wip 3d 2022-04-13 23:49:48 +02:00
Ludovic CANDELLIER
6e133246cf enhance add to basket 2022-04-01 00:11:15 +02:00
Ludovic CANDELLIER
eff2cb21c7 Add homepage 2022-03-30 22:23:57 +02:00
Ludovic CANDELLIER
c50bd2aead fix 2022-03-30 18:02:19 +02:00
Ludovic CANDELLIER
dd0dddb1ff fix 2022-03-30 18:01:01 +02:00
Ludovic CANDELLIER
34d273e510 Fix slider 2022-03-30 17:54:50 +02:00
Ludovic CANDELLIER
f1f1a8bc70 fix 2022-03-30 16:43:10 +02:00
Ludovic CANDELLIER
c1a0d449be fix 2022-03-30 16:42:46 +02:00
Ludovic CANDELLIER
957d033e2d fix 2022-03-30 16:38:49 +02:00
Ludovic CANDELLIER
dde59a0c90 Fixes on grouping 2022-03-30 16:34:08 +02:00
Ludovic CANDELLIER
1dced19068 Fix 2022-03-30 16:03:26 +02:00
Ludovic CANDELLIER
1c5db3c654 fix 2022-03-30 16:01:12 +02:00
Ludovic CANDELLIER
c8cd3e4fa6 fix 2022-03-30 15:59:31 +02:00
Ludovic CANDELLIER
e312572bcc Fix on tarif with sale_channel 2022-03-30 15:46:10 +02:00
Ludovic CANDELLIER
c4bb4fdd59 Try to fix price_lists by sale_channel 2022-03-30 00:36:58 +02:00
Ludovic CANDELLIER
ff18a0f5bf fix empty 2022-03-24 15:07:55 +01:00
Ludovic CANDELLIER
573e4dc6cb fix empty 2022-03-24 15:06:51 +01:00
Ludovic CANDELLIER
2a98b24bc1 Add calculations on basket 2022-03-24 14:57:39 +01:00
Ludovic CANDELLIER
c357ea932a Add toggle for homepage 2022-03-24 10:08:23 +01:00
Ludovic CANDELLIER
c65056531c Manage homepage by article, modify article template, enhance basket (add selector) 2022-03-24 00:48:26 +01:00
Ludovic CANDELLIER
ddc5f2664c Add variations, slider, fix cart ... 2022-03-21 21:52:12 +01:00
Ludovic CANDELLIER
0eaa11b2a9 Fix on default sale channel 2022-03-07 22:58:40 +01:00
Ludovic CANDELLIER
aa50f908ba inherited description 2022-03-07 22:50:33 +01:00
Ludovic CANDELLIER
719f89cc50 Fix name with spaces 2022-03-07 22:19:57 +01:00
Ludovic CANDELLIER
14931bc5e6 Add method to get image with parent for article 2022-03-07 22:10:59 +01:00
Ludovic CANDELLIER
30876ba67d add constaint on stock 2022-03-07 20:17:50 +01:00
Ludovic CANDELLIER
5794cbb045 Fixes on articles by sale_channel 2022-02-22 23:03:29 +01:00
Ludovic CANDELLIER
27893eaa7e fix empty 2022-02-22 22:46:10 +01:00
Ludovic CANDELLIER
53d1307837 fix 2022-02-22 22:41:50 +01:00
Ludovic CANDELLIER
f8c686caa3 Add prices and filtering by sale_channel with default 2022-02-22 22:32:46 +01:00
Ludovic CANDELLIER
3c3481b39d Add new search of articles 2022-02-21 09:09:36 +01:00
Ludovic CANDELLIER
c75f580ad2 Add price taxed 2022-02-20 21:59:19 +01:00
Ludovic CANDELLIER
ea53cb4c8a change construction of articles/offers 2022-02-20 21:38:21 +01:00
Ludovic CANDELLIER
4b2c431ee9 fix 2022-02-18 09:48:02 +01:00
Ludovic CANDELLIER
655f502279 Fix visible 2022-02-18 09:46:20 +01:00
Ludovic CANDELLIER
6556127cc8 Fix save 2022-02-17 16:27:44 +01:00
Ludovic CANDELLIER
b3a2ad31b2 fix empty 2022-02-17 12:42:46 +01:00
Ludovic CANDELLIER
7d6c7ca36d fix empty 2022-02-17 12:30:17 +01:00
Ludovic CANDELLIER
5701985734 active visible on shelves 2022-02-17 12:27:20 +01:00
Ludovic CANDELLIER
9e064bcd74 fix 2022-02-17 12:14:22 +01:00
Ludovic CANDELLIER
f0386269e6 fix on new tariff_unities 2022-02-17 12:03:01 +01:00
Ludovic CANDELLIER
90d683f7ed Fix old methods 2022-02-17 11:52:19 +01:00
Ludovic CANDELLIER
7723b475ac change old route 2022-02-17 11:44:47 +01:00
Ludovic CANDELLIER
d8ce8f5259 Fix save 2022-02-17 11:42:11 +01:00
Ludovic CANDELLIER
48359525bf Upgrade package category and dependencies for php8.0 2022-02-17 11:38:19 +01:00
Ludovic CANDELLIER
0399d90ca7 fix unsetted 2022-02-17 09:44:30 +01:00
Ludovic CANDELLIER
32362d74dc Fix 2022-02-16 09:42:08 +01:00
Ludovic CANDELLIER
b90d3ba3f2 Fix categories & varieties 2022-02-16 09:17:51 +01:00
Ludovic CANDELLIER
642fd52d36 fix name 2022-02-15 13:55:28 +01:00
Ludovic CANDELLIER
a6a4b9e59a change template 2022-02-15 13:52:03 +01:00
Ludovic CANDELLIER
3c00452219 Fix 2022-02-15 13:19:30 +01:00
Ludovic CANDELLIER
2e14e494a1 fix search 2022-02-09 09:25:48 +01:00
Ludovic CANDELLIER
b4856266c8 Add method to get offers by articles with siblings, enhance display 2022-01-30 22:48:04 +01:00
Ludovic CANDELLIER
5e5f12ddb2 Fix bug on select2 in modal filters, add filters by tags and shelves on articles 2022-01-30 15:04:08 +01:00
Ludovic CANDELLIER
5799eb36fc fix roles 2022-01-30 00:30:21 +01:00
Ludovic CANDELLIER
b4057c28d0 fix 2022-01-25 23:32:39 +01:00
Ludovic CANDELLIER
45c7385046 fix on image 2022-01-25 23:27:55 +01:00
Ludovic CANDELLIER
fb047aa036 Add no visual 2022-01-25 22:59:17 +01:00
Ludovic CANDELLIER
ed1d87a7d1 Fixes on tag_Groups and variations, add migrations 2022-01-25 22:25:18 +01:00
Ludovic CANDELLIER
9b6bac5545 fix on empty articles 2022-01-24 00:47:45 +01:00
Ludovic CANDELLIER
1fb9319bac Fix on home 2022-01-24 00:32:46 +01:00
Ludovic CANDELLIER
30666e2931 better integration of filters 2022-01-24 00:31:23 +01:00
Ludovic CANDELLIER
3e26bf368b Add toggle by rows/by cards 2022-01-23 23:16:56 +01:00
Ludovic CANDELLIER
52019357ba Add display of shelve 2022-01-23 22:49:23 +01:00
Ludovic CANDELLIER
81b6c87d59 fixes 2022-01-23 21:48:37 +01:00
Ludovic CANDELLIER
fe759565a8 Add filter by sale_channel, add method to get prices by offer, sale_channel and quantity 2022-01-23 21:37:54 +01:00
Ludovic CANDELLIER
94a162deb7 fix 2022-01-23 09:02:43 +01:00
Ludovic CANDELLIER
f4aecc9130 fixes on tags with slug 2022-01-22 22:05:18 +01:00
Ludovic CANDELLIER
f35650b234 Add tariff unities management 2022-01-22 19:26:35 +01:00
Ludovic CANDELLIER
6f04a8e7b7 Fixes size of description on article, fix save form on Families and genres 2022-01-22 17:53:24 +01:00
Ludovic CANDELLIER
2912dc6794 Display filters, and fix css for article 2022-01-22 13:12:43 +01:00
Ludovic CANDELLIER
6ff65eb927 fix 2022-01-19 22:43:32 +01:00
Ludovic CANDELLIER
7ae2c4b07c Add parameters to display by rows 2022-01-18 23:46:06 +01:00
Ludovic CANDELLIER
cefe956bc4 Add display articles by rows, and display article in full mode 2022-01-18 23:39:27 +01:00
Ludovic CANDELLIER
3641bd7d68 Fix on data for article, problem with id on polymorphic 2022-01-18 00:08:04 +01:00
Ludovic CANDELLIER
050fd76122 Add deep relations 2022-01-14 00:03:21 +01:00
Ludovic CANDELLIER
95ca3c6404 invert query from offers->articles to articles->offers 2022-01-05 22:05:30 +01:00
Ludovic CANDELLIER
a3c6fc6ebe [WIP] Add thumb on offers, refactor categories, try to fix counter on relations polymorphic with eage loader, bad pattern ! 2021-12-17 00:30:07 +01:00
Ludovic CANDELLIER
2be07ce72c fixes 2021-11-24 23:04:13 +01:00
Ludovic CANDELLIER
2f3da7d700 Manage address and deliveries 2021-11-24 20:57:12 +01:00
Ludovic CANDELLIER
b0b1164881 Fix 2021-11-24 16:15:56 +01:00
Ludovic CANDELLIER
6439d2d4ad fix on server 2021-11-24 15:56:02 +01:00
Ludovic CANDELLIER
6f0506a71e Fix on php 7.4 2021-11-24 15:53:17 +01:00
Ludovic CANDELLIER
5b84ff74e3 Fixes for deliveries vs sale_channels 2021-11-23 23:37:47 +01:00
Ludovic CANDELLIER
323330b1a1 fixes 2021-11-07 23:41:17 +01:00
Ludovic CANDELLIER
63c6671c97 fixes 2021-11-07 19:58:38 +01:00
Ludovic CANDELLIER
c7c8e18cbc Fixes 2021-11-07 17:16:35 +01:00
Ludovic CANDELLIER
46b751c361 change last_nulls on mysql , is compatible with mariadb ? 2021-11-04 16:59:11 +01:00
Ludovic CANDELLIER
4761656405 Fix 2021-11-04 16:37:42 +01:00
Ludovic CANDELLIER
eb0c9444bc Add filters 2021-11-01 23:42:53 +01:00
Ludovic CANDELLIER
e8d503b65d Minor fixes on traits 2021-11-01 18:50:17 +01:00
Ludovic CANDELLIER
900da34b57 Add thumbs views in datatables with traits 2021-11-01 18:37:25 +01:00
Ludovic CANDELLIER
ae20643879 add offers count, & minor fixes code standards 2021-11-01 16:26:31 +01:00
Ludovic CANDELLIER
8aaab4345f Minor fixes, coding standards 2021-11-01 00:50:10 +01:00
Ludovic CANDELLIER
e356b3fcda Refactoring, change menu, add many features 2021-10-30 02:22:51 +02:00
Ludovic CANDELLIER
fae7b7897f Fix 2021-10-26 21:51:47 +02:00
Ludovic CANDELLIER
e040837ce6 Fix 2021-10-26 21:47:00 +02:00
Ludovic CANDELLIER
86f6ee9a13 Synchro back-office, fix on tariffs 2021-10-26 21:41:46 +02:00
Ludovic CANDELLIER
c150be2c3e refactor, better class namespace intergration 2021-10-04 14:09:51 +02:00
Ludovic CANDELLIER
a7f661ab10 fixes 2021-10-04 13:49:45 +02:00
Ludovic CANDELLIER
9d21f28d9e downgrade for incompatibility with depedencies 2021-09-22 22:15:38 +02:00
Ludovic CANDELLIER
95997a4a0a Saving for offers 2021-09-22 22:14:39 +02:00
Ludovic CANDELLIER
2195ca122c fix 2021-09-22 21:03:42 +02:00
Ludovic CANDELLIER
85465f67c6 Fix tags with group name 2021-09-22 21:03:19 +02:00
Ludovic CANDELLIER
c347b7fe82 Remove duplicate migrations 2021-09-22 21:02:45 +02:00
Ludovic CANDELLIER
e98266e556 Upgrade boilerplate 2021-09-22 21:01:43 +02:00
Ludovic CANDELLIER
ffb9f81353 Add relations in tables, add saving states for datatables, minor fixes 2021-09-14 23:14:03 +02:00
Ludovic CANDELLIER
1dcc3e34a9 [WIP] Tentative d'ajout des tarifs dans le tableau 2021-09-09 00:30:36 +02:00
Ludovic CANDELLIER
9cf96b7d4e fixes 2021-09-09 00:03:24 +02:00
Ludovic CANDELLIER
50d445bb3b fix filter on prices by tariff 2021-09-01 10:25:59 +02:00
Ludovic CANDELLIER
b20c32d722 add description on variations 2021-09-01 09:10:58 +02:00
Ludovic CANDELLIER
4614ea57cf fix adding price for count(prices) > 3 2021-08-31 23:33:10 +02:00
Ludovic CANDELLIER
73cfe5a42e Fix on refreshing description & images from products 2021-08-31 23:12:18 +02:00
Ludovic CANDELLIER
144532acbf Add refreshing for inherited data 2021-08-30 22:59:50 +02:00
Ludovic CANDELLIER
8d3ccbf148 Enhance categories, add tags, parent 2021-08-26 17:45:37 +02:00
Ludovic CANDELLIER
e407934e2a Fix menu catalogue, fix path for price modal 2021-08-26 15:59:56 +02:00
Ludovic CANDELLIER
5ddcebc303 Fix variation 2021-08-26 15:53:41 +02:00
Ludovic CANDELLIER
04685cc7dc Fix translation yet forced on tags 2021-08-26 13:42:58 +02:00
Ludovic CANDELLIER
32c532d49b Fixes on tag updating 2021-08-26 09:54:37 +02:00
Ludovic CANDELLIER
67f490b2fe Fixes 2021-08-24 23:41:10 +02:00
Ludovic CANDELLIER
82afe63c60 Fix translation 2021-08-24 22:50:18 +02:00
Ludovic CANDELLIER
a84955412a Fix translations typo case 2021-08-24 22:40:22 +02:00
Ludovic CANDELLIER
f32ac13f1e Fix tree 2021-08-24 22:26:37 +02:00
Ludovic CANDELLIER
8d51ced269 Fix relationship 2021-08-24 20:42:51 +02:00
Ludovic CANDELLIER
967af93f8c fix segregation of article 2021-08-24 20:28:57 +02:00
Ludovic CANDELLIER
c3f66af009 Fix admin path 2021-08-24 19:14:29 +02:00
Ludovic CANDELLIER
46316ac974 Fix css 2021-08-24 19:03:52 +02:00
Ludovic CANDELLIER
7d1b2f1273 Fix package eloquent-macro unavailable for now 2021-08-24 16:40:31 +02:00
Ludovic CANDELLIER
5d99f9a09a remove old files 2021-08-24 16:27:05 +02:00
Ludovic CANDELLIER
24fffce7a1 Fix on preview mode 2021-08-23 23:56:46 +02:00
Ludovic CANDELLIER
81fbec892c comments 2021-08-21 19:48:21 +02:00
Ludovic CANDELLIER
9a0601d473 Rename Admin views directory, add some functions on models 2021-07-27 22:12:58 +02:00
Ludovic CANDELLIER
daeece59c9 Fixes on adding price & errors 2021-07-27 17:33:18 +02:00
Ludovic CANDELLIER
b879f11c99 Add new version in repository 2021-07-25 23:19:27 +02:00
Ludovic CANDELLIER
f75632b054 MCD 2021-06-05 18:00:10 +02:00
Ludovic CANDELLIER
b50f50ea62 [WIP] Refactor project 2021-05-21 00:21:05 +02:00
Ludovic CANDELLIER
4ce0fa942d v1 2021-05-07 00:14:27 +02:00
Ludovic CANDELLIER
fd2e87aa07 Fixes 2021-04-19 21:45:17 +02:00
Ludovic CANDELLIER
ebea9844dd Fixes on article preview 2021-04-16 00:04:00 +02:00
Ludovic CANDELLIER
096351ae4e Fixes on widget uploder 2021-04-15 23:58:51 +02:00
Ludovic CANDELLIER
f5ca57fdf2 Add preview from father, add new features 2021-04-11 00:36:41 +02:00
Ludovic CANDELLIER
f781158e36 Fix typo 2021-04-08 16:59:06 +02:00
Ludovic CANDELLIER
7a9f20acb9 Fix Typo 2021-04-08 16:57:50 +02:00
Ludovic CANDELLIER
098a46f3a0 Fix 2021-04-08 16:18:21 +02:00
19 changed files with 60 additions and 2638 deletions

View File

@@ -55,7 +55,6 @@ RUN chmod +x artisan
RUN ./artisan vendor:publish --tag=public --force ## creates public/vendor/jsvalidation
RUN ./artisan vendor:publish --tag=boilerplate-public --force --ansi ## creates public/vendor/boilerplate
RUN ./artisan vendor:publish --tag=datatables-buttons --force --ansi ## creates public/vendor/datatables/buttons
## XXXvlab: 2025-09-25 these migration files are breaking first
## install, but we had to resolve to not install from scratch and use

View File

@@ -3,7 +3,6 @@
namespace App\Http\Controllers\Shop\Auth;
use App\Http\Controllers\Controller;
use App\Repositories\Core\User\ShopCart;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@@ -32,7 +31,6 @@ class LoginController extends Controller
]);
if ($this->guard()->attempt($credentials, $request->get('remember'))) {
ShopCart::migrateGuestCartToUser();
$request->session()->regenerate();
if (back()->getTargetUrl() === route('Shop.Orders.store')) {
$route = 'Shop.Orders.order';

View File

@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Shop\Auth;
use App\Http\Controllers\Controller;
use App\Http\Requests\Shop\RegisterCustomer;
use App\Repositories\Core\User\ShopCart;
use App\Repositories\Shop\CustomerSaleChannels;
use App\Repositories\Shop\CustomerAddresses;
use App\Repositories\Shop\Customers;
@@ -34,7 +33,6 @@ class RegisterController extends Controller
$user = $this->create($request->all());
$this->guard()->login($user);
ShopCart::migrateGuestCartToUser();
return $request->wantsJson()
? new JsonResponse([], 201)

View File

@@ -5,7 +5,6 @@ namespace App\Http\Controllers\Shop;
use App\Repositories\Shop\CustomerAddresses;
use App\Repositories\Shop\Customers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
class CustomerController extends Controller
{
@@ -57,89 +56,10 @@ class CustomerController extends Controller
return redirect()->route('Shop.Customers.edit');
}
public function storeAddress(Request $request)
{
if (Customers::isNotConnected()) {
return response()->json(['message' => __('Authentification requise.')], 403);
}
$prefix = $request->input('prefix');
$types = ['deliveries' => 1, 'invoices' => 2];
if (! array_key_exists($prefix, $types)) {
return response()->json(['message' => __('Type d\'adresse inconnu.')], 422);
}
$addressData = $request->input($prefix, []);
$validator = Validator::make($addressData, [
'name' => ['nullable', 'string', 'max:150'],
'address' => ['required', 'string', 'max:255'],
'address2' => ['nullable', 'string', 'max:255'],
'zipcode' => ['required', 'string', 'max:30'],
'city' => ['required', 'string', 'max:255'],
], [
'address.required' => __('Merci de renseigner l\'adresse.'),
'zipcode.required' => __('Merci de renseigner le code postal.'),
'city.required' => __('Merci de renseigner la ville.'),
]);
if ($validator->fails()) {
return response()->json([
'message' => __('Merci de vérifier les informations saisies.'),
'errors' => $validator->errors(),
], 422);
}
$data = $validator->validated();
$customerId = Customers::getId();
$data['customer_id'] = $customerId;
$data['type'] = $types[$prefix];
if (empty($data['name'])) {
$data['name'] = Customers::getName($customerId);
}
$address = CustomerAddresses::store($data);
CustomerAddresses::setDefault($customerId, $address->id, $types[$prefix]);
$html = view('Shop.Customers.partials.address_item', [
'address' => $address->toArray(),
'prefix' => $prefix,
'with_name' => true,
'selected' => $address->id,
])->render();
return response()->json([
'success' => true,
'html' => $html,
'message' => __('Adresse enregistrée.'),
'id' => $address->id,
]);
}
public function delete_address($id)
{
$address = CustomerAddresses::get($id);
$ret = CustomerAddresses::destroy($id);
if (! $address || (int) $address->customer_id !== (int) Customers::getId()) {
abort(404);
}
$remaining = CustomerAddresses::getModel()
->byCustomer($address->customer_id)
->byType($address->type)
->count();
if ($remaining <= 1) {
return redirect()->route('Shop.Customers.edit')
->with('growl', [__('Vous devez conserver au moins une adresse par type.'), 'warning']);
}
CustomerAddresses::destroy($id);
CustomerAddresses::ensureDefault($address->customer_id, $address->type);
return redirect()->route('Shop.Customers.edit')
->with('growl', [__('Adresse supprimée.'), 'success']);
return redirect()->route('Shop.Customers.edit');
}
}

View File

@@ -3,11 +3,9 @@
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class CustomerAddress extends Model
{
use SoftDeletes;
protected $guarded = ['id'];
protected $table = 'shop_customer_addresses';

View File

@@ -39,7 +39,7 @@ class Invoice extends Model
public function address(): BelongsTo
{
return $this->belongsTo(CustomerAddress::class, 'invoice_address_id')->withTrashed();
return $this->belongsTo(CustomerAddress::class, 'invoice_address_id');
}
public function scopeByCustomer($query, $customerId)

View File

@@ -29,7 +29,7 @@ class Order extends Model
public function delivery_address(): BelongsTo
{
return $this->belongsTo(CustomerAddress::class, 'delivery_address_id')->withTrashed();
return $this->belongsTo(CustomerAddress::class, 'delivery_address_id');
}
public function delivery(): BelongsTo

View File

@@ -94,106 +94,11 @@ class ShopCart
return self::get()->getContent();
}
public static function migrateGuestCartToUser($userId = null)
public static function get()
{
$userId = self::resolveUserId($userId);
$userId = Auth::guard('customer')->id();
$sessionKey = 'cart_'.sha1(static::class . ($userId ?? 'guest'));
if ($userId === null) {
return;
}
$guestSessionKey = self::sessionKey();
$guestItems = Cart::session($guestSessionKey)->getContent();
if ($guestItems->count() === 0) {
return;
}
$userSessionKey = self::sessionKey($userId);
foreach ($guestItems as $item) {
$existing = Cart::session($userSessionKey)->get($item->id);
if ($existing) {
Cart::session($userSessionKey)->update($item->id, [
'quantity' => [
'relative' => false,
'value' => $existing->quantity + $item->quantity,
],
]);
continue;
}
$itemData = [
'id' => $item->id,
'name' => $item->name,
'price' => $item->price,
'quantity' => $item->quantity,
'attributes' => self::extractAttributes($item),
];
if (isset($item->associatedModel)) {
$itemData['associatedModel'] = $item->associatedModel;
}
$conditions = self::extractConditions($item);
if (! empty($conditions)) {
$itemData['conditions'] = $conditions;
}
Cart::session($userSessionKey)->add($itemData);
}
Cart::session($guestSessionKey)->clear();
Cart::session($userSessionKey);
}
protected static function extractAttributes($item)
{
if (! isset($item->attributes)) {
return [];
}
if (is_object($item->attributes) && method_exists($item->attributes, 'toArray')) {
return $item->attributes->toArray();
}
return (array) $item->attributes;
}
protected static function extractConditions($item)
{
if (! isset($item->conditions)) {
return [];
}
if (is_object($item->conditions) && method_exists($item->conditions, 'toArray')) {
return $item->conditions->toArray();
}
return (array) $item->conditions;
}
protected static function resolveUserId($userId = null)
{
return $userId ?? Auth::guard('customer')->id();
}
protected static function sessionKey($userId = null)
{
$key = $userId ?? 'guest';
return 'cart_'.sha1(static::class.$key);
}
protected static function session($userId = null)
{
return Cart::session(self::sessionKey($userId));
}
public static function get($userId = null)
{
return self::session(self::resolveUserId($userId));
return Cart::session($sessionKey);
}
}

View File

@@ -12,35 +12,17 @@ class CustomerAddresses
public static function storeByCustomer($customer, $data)
{
$deliveries = $data['deliveries'] ?? false;
if ($deliveries) {
if (! empty($deliveries['address_id'])) {
self::setDefault($customer->id, (int) $deliveries['address_id'], 1);
}
if (! empty($deliveries['zipcode']) && ! empty($deliveries['city'])) {
$payload = $deliveries;
unset($payload['address_id']);
$payload['customer_id'] = $customer->id;
$payload['type'] = 1;
$newAddress = self::store($payload);
self::setDefault($customer->id, $newAddress->id, 1);
}
if ($deliveries && $deliveries['zipcode'] && $deliveries['city']) {
$deliveries['customer_id'] = $customer->id;
$deliveries['type'] = 1;
self::store($deliveries);
}
$invoices = $data['invoices'] ?? false;
if ($invoices) {
if (! empty($invoices['address_id'])) {
self::setDefault($customer->id, (int) $invoices['address_id'], 2);
}
if (! empty($invoices['zipcode']) && ! empty($invoices['city'])) {
$payload = $invoices;
unset($payload['address_id']);
$payload['customer_id'] = $customer->id;
$payload['type'] = 2;
$newAddress = self::store($payload);
self::setDefault($customer->id, $newAddress->id, 2);
}
if ($invoices && $invoices['zipcode'] && $invoices['city']) {
$invoices['customer_id'] = $customer->id;
$invoices['type'] = 2;
self::store($invoices);
}
}
@@ -88,24 +70,14 @@ class CustomerAddresses
public static function getInvoiceAddress($customerId)
{
$address = CustomerAddress::byCustomer($customerId)
->byInvoicing()
->orderByDesc('priority')
->orderBy('id')
->first();
return $address ?? self::getByCustomer($customerId);
$addresses = CustomerAddress::byCustomer($customerId)->byInvoicing()->get();
return count($addresses) ? $addresses->first() : self::getByCustomer($customerId);
}
public static function getDeliveryAddress($customerId)
{
$address = CustomerAddress::byCustomer($customerId)
->byDelivery()
->orderByDesc('priority')
->orderBy('id')
->first();
return $address ?? self::getByCustomer($customerId);
$addresses = CustomerAddress::byCustomer($customerId)->byDelivery()->get();
return count($addresses) ? $addresses->first() : self::getByCustomer($customerId);
}
public static function getByCustomer($customerId = false)
@@ -120,40 +92,6 @@ class CustomerAddresses
return ((int) $type === 1) ? '<i class="fa fa-fw fa-truck"></i>' : '<i class="fa fa-fw fa-file-invoice"></i>';
}
public static function setDefault($customerId, $addressId, $type)
{
if (! $addressId) {
return;
}
$address = self::get($addressId);
if (! $address || (int) $address->customer_id !== (int) $customerId || (int) $address->type !== (int) $type) {
return;
}
self::getModel()->byCustomer($customerId)->byType($type)->update(['priority' => null]);
$address->priority = 1;
$address->save();
}
public static function ensureDefault($customerId, $type)
{
$hasDefault = self::getModel()->byCustomer($customerId)->byType($type)->where('priority', 1)->exists();
if ($hasDefault) {
return;
}
$address = self::getModel()->byCustomer($customerId)->byType($type)->orderBy('id')->first();
if ($address) {
$address->priority = 1;
$address->save();
}
}
public static function toggleActive($id, $active)
{
return self::update(['active' => $active], $id);

View File

@@ -6,7 +6,6 @@ use App\Datatables\Shop\CustomerInvoicesDataTable;
use App\Datatables\Shop\CustomerOrdersDataTable;
use App\Models\Shop\Customer;
use App\Traits\Model\Basic;
use App\Repositories\Shop\CustomerAddresses;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
@@ -96,16 +95,6 @@ class Customers
$data = $customer->toArray();
$data['sale_channels'] = $customer->sale_channels->pluck('id')->toArray();
$data['deliveries'] = Deliveries::getBySaleChannels($data['sale_channels'])->toArray();
$data['delivery_address_id'] = optional(CustomerAddresses::getDeliveryAddress($id))->id;
$data['invoice_address_id'] = optional(CustomerAddresses::getInvoiceAddress($id))->id;
if (! $data['delivery_address_id'] && ! empty($data['delivery_addresses'])) {
$data['delivery_address_id'] = $data['delivery_addresses'][0]['id'] ?? null;
}
if (! $data['invoice_address_id'] && ! empty($data['invoice_addresses'])) {
$data['invoice_address_id'] = $data['invoice_addresses'][0]['id'] ?? null;
}
return $data;
}
@@ -113,8 +102,8 @@ class Customers
public static function storeFull($data)
{
$data2 = $data;
$saleChannels = array_key_exists('sale_channels', $data) ? $data['sale_channels'] : null;
if ($saleChannels !== null) {
if ($data['sale_channels'] ?? false) {
$saleChannels = $data['sale_channels'] ?? false;
unset($data['sale_channels']);
}
if ($data['deliveries'] ?? false) {
@@ -124,9 +113,7 @@ class Customers
unset($data['invoices']);
}
$customer = self::store($data);
if ($saleChannels !== null) {
$customer->sale_channels()->sync($saleChannels);
}
$customer->sale_channels()->sync($saleChannels);
CustomerAddresses::storeByCustomer($customer, $data2);
return $customer->id;

View File

@@ -17,15 +17,12 @@ class InvoicePDF
public static function get($id)
{
$invoice = Invoices::getFull($id);
$customFields = [];
if ($orderRef = optional($invoice->order)->ref) {
$customFields['order number'] = $orderRef;
}
$customer = new Party([
'name' => optional($invoice->customer)->name ?? __('Client inconnu'),
'name' => $invoice->customer->name,
'address' => self::makeAddress($invoice->address),
'custom_fields' => $customFields,
'custom_fields' => [
'order number' => $invoice->order->ref,
],
]);
$items = self::makeItems($invoice->order->detail);
@@ -51,17 +48,7 @@ class InvoicePDF
public static function makeAddress($address)
{
if (! $address) {
return '';
}
$lines = array_filter([
$address->address ?? '',
$address->address2 ?? '',
trim(($address->zipcode ?? '').' '.($address->city ?? '')),
]);
return implode('<br>', $lines);
return $address->address.'<br>'.$address->zipcode.' '.$address->city;
}
public static function makeItems($details)

2175
dump.sql

File diff suppressed because one or more lines are too long

View File

@@ -1,34 +1,8 @@
// Simple notification helper used by blade templates (fallback to Bootstrap alerts)
window.growl = function(message, type) {
var alertTypes = {
success: 'alert-success',
error: 'alert-danger',
warning: 'alert-warning',
info: 'alert-info'
};
var cssClass = alertTypes[type] || alertTypes.info;
var $container = $('#growl-container');
if (!$container.length) {
$container = $('<div id="growl-container" class="growl-container position-fixed w-100" style="top: 1rem; left: 0; z-index: 1080; pointer-events: none;"></div>');
$('body').append($container);
}
var $alert = $('<div class="alert ' + cssClass + ' alert-dismissible fade show mx-auto shadow" role="alert" style="max-width: 420px; pointer-events: all;"></div>');
$alert.append($('<span></span>').text(message));
$alert.append('<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>');
$container.append($alert);
setTimeout(function() {
$alert.alert('close');
}, 4000);
};
// Prevent closing from click inside dropdown
$(document).on('click', '.dropdown-menu', function (e) {
e.stopPropagation();
});
// make it as accordion for smaller screens
if ($(window).width() < 992) {
$('.dropdown-menu a').click(function(e) {

View File

@@ -24,7 +24,6 @@
'prefix' => 'deliveries',
'addresses' => $customer['delivery_addresses'],
'with_name' => true,
'selected' => $customer['delivery_address_id'] ?? null,
])
</x-card>
@@ -33,7 +32,6 @@
'prefix' => 'invoices',
'addresses' => $customer['invoice_addresses'],
'with_name' => true,
'selected' => $customer['invoice_address_id'] ?? null,
])
</x-card>

View File

@@ -1,25 +0,0 @@
<div class="row mt-3 address-row" data-address-id="{{ $address['id'] }}">
<div class="col-1">
@php
$inputName = isset($prefix) && $prefix ? $prefix.'[address_id]' : 'address_id';
$currentValue = $selected ?? null;
@endphp
<x-form.radios.icheck name="{{ $inputName }}" val="{{ $address['id'] }}"
:value="$currentValue" id="address_{{ $address['id'] }}" />
</div>
<div class="col-10">
@if ($with_name ?? false)
{{ $address['name'] ?? '' }}<br />
@endif
{{ $address['address'] }}<br />
@if (! empty($address['address2']))
{{ $address['address2'] }}<br />
@endif
{{ $address['zipcode'] }} {{ $address['city'] }}
</div>
<div class="col-1 text-right">
<a class="text-danger" href="{{ route('Shop.Customers.delete_address', ['id' => $address['id']]) }}">
<i class="fa fa-trash" data-id="{{ $address['id'] }}"></i>
</a>
</div>
</div>

View File

@@ -1,13 +1,26 @@
<div id="addresses_list_{{ $prefix }}" class="addresses-list">
@foreach ($addresses ?? [] as $address)
@include('Shop.Customers.partials.address_item', [
'address' => $address,
'prefix' => $prefix ?? null,
'with_name' => $with_name ?? false,
'selected' => $selected ?? null,
])
@endforeach
</div>
@foreach ($addresses ?? [] as $address)
<div class="row mt-3">
<div class="col-1">
<x-form.radios.icheck name="@if ($prefix ?? false) {{ $prefix }} . '[]' @endif address_id"
val="{{ $address['id'] }}" id="address_{{ $address['id'] }}" />
</div>
<div class="col-10">
@if ($with_name ?? false)
{{ $address['name'] }}<br />
@endif
{{ $address['address'] }}<br />
@if ($address['address2'])
{{ $address['address2'] }}<br />
@endif
{{ $address['zipcode'] }} {{ $address['city'] }}
</div>
<div class="col-1">
<a href="{{ route('Shop.Customers.delete_address') }}/{{ $address['id'] }}">
<i class="fa fa-trash" class="delete" data-id="{{ $address['id'] }}"></i>
</a>
</div>
</div>
@endforeach
<div id="add_address_container_{{ $prefix }}" class="green-dark d-none mb-3 mt-3">
<x-card classBody="bg-green-dark yellow" title="Nouvelle adresse" classTitle="h4">
@@ -18,18 +31,6 @@
'label' => 'Adresse',
'customer' => [],
])
<div class="row mt-3">
<div class="col-md-6 mb-2">
<x-form.button id="save_address_{{ $prefix }}" class="btn-success btn-sm btn-block"
icon="fa-save" txt="Enregistrer cette adresse"
:metadata="'data-prefix='.$prefix" />
</div>
<div class="col-md-6 mb-2">
<x-form.button id="cancel_address_{{ $prefix }}" class="btn-outline-light btn-sm btn-block"
icon="fa-times" txt="Annuler"
:metadata="'data-prefix='.$prefix" />
</div>
</div>
</x-card>
</div>
@@ -42,71 +43,8 @@
@push('js')
<script>
(function() {
var prefix = '{{ $prefix }}';
var $formContainer = $('#add_address_container_{{ $prefix }}');
var $list = $('#addresses_list_{{ $prefix }}');
var storeUrl = '{{ route('Shop.Customers.address.store') }}';
var $toggleBtn = $('#add_address_{{ $prefix }}');
$toggleBtn.on('click', function() {
var isHidden = $formContainer.hasClass('d-none');
if (isHidden) {
$formContainer.removeClass('d-none');
$toggleBtn.prop('disabled', true);
}
});
$('#cancel_address_{{ $prefix }}').on('click', function() {
$formContainer.addClass('d-none');
$formContainer.find('input[type="text"]').val('');
$toggleBtn.prop('disabled', false);
});
$('#save_address_{{ $prefix }}').on('click', function() {
const data = $formContainer.find(':input').serialize();
$.ajax({
url: storeUrl,
method: 'POST',
data: data + '&prefix=' + prefix,
success: function(response) {
if (response.html) {
$list.append(response.html);
}
$formContainer.addClass('d-none');
$formContainer.find('input[type="text"]').val('');
$toggleBtn.prop('disabled', false);
if (response.id) {
const $newRadio = $list.find('#address_' + response.id);
$list.find('input[type="radio"]').not($newRadio).prop('checked', false);
$newRadio.prop('checked', true);
}
if (typeof $.fn.iCheck === 'function') {
$list.find('input[type="radio"]').iCheck('destroy');
if (typeof initIcheck === 'function') {
initIcheck('#addresses_list_{{ $prefix }} input[type="radio"]');
if (response.id) {
$list.find('#address_' + response.id).iCheck('check');
}
}
}
const message = response.message || '{{ __('Adresse enregistrée.') }}';
if (typeof growl === 'function') {
growl(message, 'success');
}
},
error: function(xhr) {
let message = '{{ __('Une erreur est survenue lors de l\'enregistrement de l\'adresse.') }}';
if (xhr.responseJSON && xhr.responseJSON.message) {
message = xhr.responseJSON.message;
}
if (typeof growl === 'function') {
growl(message, 'error');
}
}
});
});
})();
$('#add_address_{{ $prefix }}').click(function() {
$('#add_address_container_{{ $prefix }}').toggleClass('d-none');
})
</script>
@endpush

View File

@@ -16,27 +16,11 @@
@push('js')
<script>
$(function() {
const articleShowUrlTemplate = "{{ route('Shop.Articles.show', ['id' => '__ARTICLE_ID__']) }}";
$('#search-general .fa-search').click(function() {
$('#search-general').submit();
});
function redirectToArticle(item, evt) {
if (!item || typeof item.value === 'undefined' || item.value === null || item.value === '') {
return;
}
if (evt) {
evt.preventDefault();
evt.stopPropagation();
}
const targetUrl = articleShowUrlTemplate.replace('__ARTICLE_ID__', item.value);
window.location.href = targetUrl;
}
initAutocomplete('#search_name', redirectToArticle);
initAutocomplete('#search_name');
});
</script>
@endpush

View File

@@ -13,10 +13,9 @@
var id = item.value;
$('#' + field).val(id);
if (typeof callback === 'function') {
callback.call(this, item, evt);
} else if (typeof callback === 'string' && callback.length && typeof window[callback] === 'function') {
window[callback].call(this, item, evt);
if (typeof(callback) != 'undefined') {
var c = callback + '(' + id + ')';
eval(c);
}
});
}

View File

@@ -7,6 +7,5 @@ Route::prefix('Clients')->name('Customers.')->group(function () {
Route::get('edit', 'CustomerController@edit')->name('edit');
Route::post('storeProfileAjax', 'CustomerController@storeProfileAjax')->name('storeProfileAjax');
Route::post('store', 'CustomerController@store')->name('store');
Route::post('address', 'CustomerController@storeAddress')->name('address.store');
Route::get('delete_address/{id}', 'CustomerController@delete_address')->name('delete_address');
Route::get('delete_address/{$id?}', 'CustomerController@delete_address')->name('delete_address');
});