THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Bonjour,

Sur une 2.0.4, j'ai l'impression d'avoir un pbm avec le nombre d'utilisation d'un coupon 'Remise d'un montant fixe" avec une utilisation limitée:

- si je mets "1" utilisation, page blanche à la première utilisation du coupon (avec 1 en théorie je devrais pouvoir l'utiliser au moins 1 fois)

CouponNoUsageLeftException: Le nombre maximum d'utilisation pour le coupon PROMO2-JAN2015 est dépassé.

    in /home/alafabhand/public_html/core/lib/Thelia/Coupon/CouponFactory.php line 73
    at CouponFactory->buildCouponFromCode('PROMO2-JAN2015') in /home/alafabhand/public_html/core/lib/Thelia/Coupon/BaseFacade.php line 197
    at BaseFacade->getCurrentCoupons() in /home/alafabhand/public_html/core/lib/Thelia/Coupon/CouponManager.php line 279
    at CouponManager->clear() in /home/alafabhand/public_html/core/lib/Thelia/Action/Coupon.php line 118
    at Coupon->clearAllCoupons(object(Event))
    at call_user_func(array(object(Coupon), 'clearAllCoupons'), object(Event)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 164
    at EventDispatcher->doDispatch(array(array(object(Coupon), 'clearAllCoupons')), 'action.clear_all_coupon', object(Event)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 53
    at EventDispatcher->dispatch('action.clear_all_coupon', null) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php line 167
    at ContainerAwareEventDispatcher->dispatch('action.clear_all_coupon') in /home/alafabhand/public_html/core/lib/Thelia/Action/Coupon.php line 357
    at Coupon->afterOrder(object(OrderEvent))
    at call_user_func(array(object(Coupon), 'afterOrder'), object(OrderEvent)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 164
    at EventDispatcher->doDispatch(array(array(object(OnEventListener), 'sendOrderConfirmationEmail'), array(object(Order), 'sendOrderEmail'), array(object(Coupon), 'afterOrder')), 'action.order.beforePayment', object(OrderEvent)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 53
    at EventDispatcher->dispatch('action.order.beforePayment', object(OrderEvent)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php line 167
    at ContainerAwareEventDispatcher->dispatch('action.order.beforePayment', object(OrderEvent)) in /home/alafabhand/public_html/core/lib/Thelia/Action/Order.php line 344
    at Order->create(object(OrderEvent))
    at call_user_func(array(object(Order), 'create'), object(OrderEvent)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 164
    at EventDispatcher->doDispatch(array(array(object(Order), 'create')), 'action.order.pay', object(OrderEvent)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php line 53
    at EventDispatcher->dispatch('action.order.pay', object(OrderEvent)) in /home/alafabhand/public_html/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php line 167
    at ContainerAwareEventDispatcher->dispatch('action.order.pay', object(OrderEvent)) in /home/alafabhand/public_html/local/modules/Front/Controller/OrderController.php line 199
    at OrderController->pay()
    at call_user_func_array(array(object(OrderController), 'pay'), array()) in /home/alafabhand/public_html/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 129
    at HttpKernel->handleRaw(object(Request), '1') in /home/alafabhand/public_html/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php line 73
    at HttpKernel->handle(object(Request), '1', true) in /home/alafabhand/public_html/core/lib/Thelia/Core/TheliaHttpKernel.php line 81
    at TheliaHttpKernel->handle(object(Request), '1', true) in /home/alafabhand/public_html/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php line 197
    at Kernel->handle(object(Request)) in /home/alafabhand/public_html/web/index_dev.php line 37

- si je met une autre valeur à partir de 3, je peux utiliser le coupon un nombre illimité de fois ... Si je mets 2, j'ai une erreur du même genre que ci-dessus .

A noter que ça n'est pas très facile à tester, quand j'ai la page (blanche) d'erreur je suis coincé car il enregistre ça comme une utilisation du coupon, il faut que j'efface les cookies ... donc je ne suis pas sûr à 100% si le pbm se passe aussi pour 2 ou juste pour une utilisation (pour 1, je comprendrai mieux un bug informatique, pour 2 mais pas pour 3 me semblerait plus bizarre).

Pierre

Last edited by pierrot (20-01-2015 18:59:14)

Offline


Si je fait le même test sur la version 2.1.1 que je suis en train de mettre en place sur mon serveur local, je constate que pour un code promo marqué 1 utilisation, qui a marché apparemment la première fois, j'ai des problèmes la seconde fois. Aucune alerte au moment ou je saisi le code promo, par contre quand je choisi un mode de paiement, erreur. Je me retrouve avec un écran Oops du back-office (alors que j'étais dans le front signé comme un client, mais aussi dans le back dans un autre onglet) avec une erreur "Le message d'erreur suivant a été trouvé : Le nombre maximum d'utilisation pour le coupon PROMO-JAN2015 est dépassé. ".
Donc ça marche sauf qu'il serait mieux d'avoir le rejet du code promo au moment ou on le saisit ... sans retour dans le back-office (mais ça c'est peut-être parce que je suis aussi dans le back-office dans le même navigateur).
Et si je tente sur un autre navigateur je reste dans le front avec une erreur peu explicative "Désolé. Une erreur s'est produite : %s"

Pierre

Offline


Bonjour Pierrot,
As-tu trouvé une solution à ton problème ?
As-tu posté une « issue » sur Github ?

Car il me semble avoir eu le même soucis.
Merci