This module is under development, please do not try to use it.
thelia-modules / openapi Goto Github PK
View Code? Open in Web Editor NEWA modern and documented open api for Thelia
A modern and documented open api for Thelia
A l'heure actuelle on a aucun moyen d'afficher/sélectionner les horaires de retrait pour les points-relais et local-pickup/click&collect.
Vincent et moi proposons de rajouter sur le model PickupLocation de l'API ainsi que l'event PickupLocationEvent du core, une propriété "openingHours" basé sur le schéma suivant:
{
"openingHours": [
{
"day": "1977-04-22T01:00:00-05:00",
"open": true,
"timeSlots": [
{
"slot": "8h-12h",
"open": true
}
]
}
]
}
Ainsi que l'ajout de deux nouveaux paramètres sur la route /delivery/pickup-locations, pour borner la recherche entre deux jours particuliers pour les entités qui possèdent des horaires d'ouvertures (par défaut: une semaine à partir du jour courant).
Franck a une problématique supplémentaire lié au choix d'un slot pour un retrait sur une tranche horaire précise, je le laisse préciser son besoin ici pour qu'on en discute avant de commencer toute implémentation.
Lorqu'un event est réutilisé pour faire plusieurs dispatch, par exemple pour réaliser une série d'actions, si la propagation est stoppée lors d'un des dispatch, les suivants ne seront pas réalisés.
Exemple dans CheckoutController, on utilise $orderEvent
3 fois de suite :
$dispatcher->dispatch($orderEvent, TheliaEvents::ORDER_SET_DELIVERY_ADDRESS);
$dispatcher->dispatch($orderEvent, TheliaEvents::ORDER_SET_POSTAGE);
$dispatcher->dispatch($orderEvent, TheliaEvents::ORDER_SET_DELIVERY_MODULE);
Si dans l'action réalisé par ORDER_SET_POSTAGE
la propagation est stoppée (par exemple ici : https://github.com/thelia/thelia/blob/a3519aa478c334e1b303a5e54f7a2b5c1dce341d/core/lib/Thelia/Action/Coupon.php#L259), alors ORDER_SET_DELIVERY_MODULE ne sera pas propagé.
Envoyr un clone $orderEvent
plutôt qu'un $orderEvent
résoud le problème, car seul l'objet event est cloné, les références à d'autres objets (ici l'Order) sont préservées, mais peut poser d'autres problèmes si les attributs de l'event sont modifiés mais doivent circuler.
Ou alors réinitialiser la propagation avant de re-dispatcher l'event ?
With the module CustomDelivery, we need to know the estimate postage of the state and not only the country...
In the function getEstimatePostageForCountry in the DeliveryPostageEvent we need maybe to pass the state in the parameters... If it exists in the session.
Dans CouponController, lorsqu'un coupon est consommé, les frais de port de la commande en cours ne sont pas recalculés.
En conséquence, si un coupon offre les frais de port, cette gratuité n'est pas appliquée à la commande.
Pour ce faire il faudrait dispatcher un event TheliaEvents::ORDER_SET_POSTAGE
pour que \Thelia\Action\Coupon::testFreePostage soit appelé.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.