Conflit avec Woocommerce Subscriptions
-
Bonjour,
J’utilise le module “Woocommerce subscriptions” (qui gère les abonnements avec paiements récurrents) associé au module “Colissimo Officiel : Méthodes de livraison pour WooCommerce” tous les 2 dans leur dernière version, et il se trouve qu’il y a un bug de fonctionnement. Lorsque j’ajoute un abonnement dans le panier il est bien proposé Colissimo à domicile et Colissimo Relais, mais le système demande systématiquement de choisir un point de retrait même en cas de livraison à domicile.
J’ai identifié d’où vient le problème, il est en rapport avec une synchronisation du module Abonnement qui génère une commande automatiquement tous les 8 du mois… Car si je désactive cette option cela fonctionne normalement, mais il je me dois d’utiliser cette spécificité.
Pouvez-vous m’aider svp ?
Bien cordialement,
Bastien RAMAELThe page I need help with: [log in to see the link]
-
Bonjour,
Est-ce que vous parlez bien de l’option “Synchroniser les renouvellements => Aligner le jour de renouvellement d’abonnement” ?
Le plugin n’est en effet pas compatible avec cette option, je remonte le souci mais nous ne pourrons malheureusement pas fournir une solution à court terme.
Bonjour,
Oui c’est exactement ?a, mais cela, a fonctionné normalement pendant un certain temps avant certaines mises à jour…Bonjour,
J’ai re-testé l’intégration pour être s?r, et j’ai pu passer la commande avec signature sans avoir le message demandant de sélectionner un point de retrait.
J’ai testé avec l’ancien checkout de WooCommerce (celui que vous utilisez), ainsi que le nouveau (leur bloc Gutenberg).
Le souci ne vient donc peut-être pas d’une incompatibilité avec cette option, mais plut?t d’un autre souci. Je n’ai pas pu véritablement tester sur votre site étant donné qu’il faut entrer une carte de crédit, mais nous pouvons peut-être essayer d’ajouter des logs pour investiguer.
La vérification est faite dans le fichier
wp-content/plugins/colissimo-shipping-methods-for-woocommerce/public/pickup/lpc_pickup_selection.php
aux lignes 234 (pour changer le texte du bouton de validation) et 263 (pour empêcher la validation).à ces endroits, on vérifie quelle méthode de livraison est sélectionnée en récupérant l’information dans la session de WooCommerce. Si le bouton est toujours modifié, c’est soit que l’information récupérée dans la session est fausse, soit qu’on ne passe pas dans la vérification une fois sur la page.
Vous pouvez ajouter le code suivant juste après la ligne 194 :
LpcLogger::debug(
'Checking if the order button should be disabled',
[
'needShipping' => $needShipping,
'shippingMethod' => $shippingMethod,
]
);Une fois appliqué :
- activez temporairement les logs dans WooCommerce => Réglages => Colissimo => Support
- allez sur la page d’achat, et changez la méthode de livraison plusieurs fois (“en point relais (gratuit)” puis “à domicile”), ?a générera quelques logs
- retournez dans les réglages Colissimo et désactivez les logs
Vous pourrez alors récupérer les logs collectés dans l’option juste au-dessous, pourrez-vous me les partager ? Ce qui m’intéresse, c’est les lignes commen?ant par “Checking if the order button should be disabled”.
Bonjour,
Malheureusement ce fichier ne se présente pas comme vous l’indiquez car à la ligne 234 il y a un espace vide (https://ibb.co/PzhsmLmZ) et à la ligne 263 le symbole } (https://ibb.co/4nSV4PCn), je ne peux effectuer les manipulations que vous préconiser…
Merci,Oups, j’étais sur la version en cours de développement, voici une capture d’écran de l’endroit où ajouter ce code, ?a sera dans la fonction “preventPlaceOrderButton” :
Voici les lignes de logs après l'ajout du code envoyé :
2025-03-07 12:17:25 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":[]}
2025-03-07 12:17:30 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:17:30 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4NmZmNTk2ZDU1ZmRiNmI4MzBiOGNkZmI5YjExMjRhOSIsImlhdCI6MTc0MTM0NjI1MCwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MDUwfQ.MLlZ2yFfFbl6FbUsGw4kHVlj_AzC66jv3NFmDwIlqso"}}
2025-03-07 12:17:30 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:17:44 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:17:45 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhNzYzNDUyMTRhODc3ODgwNWQzZTRlNDAxYWNiNjM2ZSIsImlhdCI6MTc0MTM0NjI2NCwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MDY0fQ.iJsNB59XIyinpnY3ee3h89eAS2UwNOM83uKaOd9lDqs"}}
2025-03-07 12:17:45 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:17:45 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhNzYzNDUyMTRhODc3ODgwNWQzZTRlNDAxYWNiNjM2ZSIsImlhdCI6MTc0MTM0NjI2NSwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MDY1fQ.9taGhfdp0j-EBTCoyNP4fZvmyahFMf4RmJeimfxENAI"}}
2025-03-07 12:17:45 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:17:49 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:17:49 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxNzYzMTliOWNhNWM0OWMxMWJhNWU3MmZjNjNlMTQzYSIsImlhdCI6MTc0MTM0NjI2OSwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MDY5fQ.BZT2FPxcvdTXOqVfIR2YaMJ_YMs1IXLXkyrX2TyjWeo"}}
2025-03-07 12:17:49 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:17:52 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:17:52 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI1ZDM5NWQ0OTIzY2EwOWE4ZTVkYjNkMWYzODdhMTAzNiIsImlhdCI6MTc0MTM0NjI3Miwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MDcyfQ.rtx9YU7Kp9XfMupD1tyrRXXvLzsQ2KtXPozJ4AJ-0tI"}}
2025-03-07 12:17:52 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_nosign:37","0":"lpc_relay:38"}}
2025-03-07 12:17:54 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:17:54 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxNzYzMTliOWNhNWM0OWMxMWJhNWU3MmZjNjNlMTQzYSIsImlhdCI6MTc0MTM0NjI3NCwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MDc0fQ.N0JFED1rI_zeayXM2FX7KKMpQIzDZ5ATbmpHsV-NPVQ"}}
2025-03-07 12:17:54 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:20:13 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/api-ewe\/v1\/rest\/urlCboxExt"}
2025-03-07 12:21:13 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:13 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkNWMyNTRhMTBhZGMzYmU1M2U5YWRjZjFlODBhZDA1NCIsImlhdCI6MTc0MTM0NjQ3Mywic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MjczfQ.jWgcpYIiWoxtSgC_l_ZCA57x3c1O0mIbrC0RHAXifLE"}}
2025-03-07 12:21:14 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:14 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIwZjFkZjZiNDhiNjIyNTBhNTUzOWJlZTI1YWVkOTkzZiIsImlhdCI6MTc0MTM0NjQ3NCwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4Mjc0fQ.mnvo3MebRy992rFxIwZEd30Waxyy9Fq3WrfvMFy7cr8"}}
2025-03-07 12:21:14 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:21:16 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:16 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkNTVhMGQ2MTM3ZWZiMjJhMzcxMzg0ZTBjNGVlMjEzOCIsImlhdCI6MTc0MTM0NjQ3Niwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4Mjc2fQ.kjhlq_iProzeQtwAAw5Fi6MuiPUUGmnMR6_EcwblOUM"}}
2025-03-07 12:21:16 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:21:19 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:19 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhNzYzNDUyMTRhODc3ODgwNWQzZTRlNDAxYWNiNjM2ZSIsImlhdCI6MTc0MTM0NjQ3OSwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4Mjc5fQ.CjLvnM0QaXc2rsDJuqsHtwGntMH_FTgllw35f4y1uc8"}}
2025-03-07 12:21:19 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_nosign:37","0":"lpc_relay:38"}}
2025-03-07 12:21:22 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:22 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxNzYzMTliOWNhNWM0OWMxMWJhNWU3MmZjNjNlMTQzYSIsImlhdCI6MTc0MTM0NjQ4Miwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4MjgyfQ.pNzhRYpclny0giSno62zkW5veTZTHCNfJ26or84cj8U"}}
2025-03-07 12:21:22 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:21:24 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:24 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkNWMyNTRhMTBhZGMzYmU1M2U5YWRjZjFlODBhZDA1NCIsImlhdCI6MTc0MTM0NjQ4NCwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4Mjg0fQ.5GFKVna60eo29hX2GW5i1udRe-H9XxIhnvM62mAl8No"}}
2025-03-07 12:21:24 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_nosign:37","0":"lpc_relay:38"}}
2025-03-07 12:21:26 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:26 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkNWMyNTRhMTBhZGMzYmU1M2U5YWRjZjFlODBhZDA1NCIsImlhdCI6MTc0MTM0NjQ4Niwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4Mjg2fQ._kv9qao12f9CIX7xFke6OkImHzDFtOmvtKMF1zGipW0"}}
2025-03-07 12:21:26 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_relay:38","0":"lpc_relay:38"}}
2025-03-07 12:21:28 - DEBUG : LpcRestApi::query
{"url":"https:\/\/ws.colissimo.fr\/widget-colissimo\/rest\/authenticate.rest"}
2025-03-07 12:21:28 - DEBUG : Widget authenticate response
{"method":"LpcPickUpWidgetApi::authenticate","response":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkNTVhMGQ2MTM3ZWZiMjJhMzcxMzg0ZTBjNGVlMjEzOCIsImlhdCI6MTc0MTM0NjQ4OCwic3ViIjoid2lkZ2V0IiwiaXNzIjoiODE5OTU2IiwiZXhwIjoxNzQxMzQ4Mjg4fQ.UwRHFBk5aVuGqbe8BfOsApnP26741jvTBaPvnM4sW9c"}}
2025-03-07 12:21:28 - DEBUG : Checking if the order button should be disabled
{"needShipping":true,"shippingMethod":{"2025_03_08_monthly_synced_0":"lpc_nosign:37","0":"lpc_relay:38"}}nullIl semble y avoir deux méthodes de livraison sauvegardées sur le panier, et l’une d’elles reste toujours en point de retrait (d’où le texte du bouton et le blocage de la commande).
C’est comme s’il y avait deux livraisons à paramétrer pour la commande (une initiale, et celle utilisée pour les livraisons suivantes le 8 du mois).
Si pour vous il n’y a que la livraison synchronisée au 8, j’aurais peut-être une solution.
Vous pouvez supprimer le code que je vous ai fait ajouter, puis remplacer ce code ligne 176 :foreach ($shippingMethod as $oneMethod) {
if (strpos($oneMethod, LpcRelay::ID) !== false) {
$relayMethod = true;
}
}Par :
foreach ($shippingMethod as $key => $oneMethod) {
if (strpos($key, '_synced_') !== false) {
$relayMethod = strpos($oneMethod, LpcRelay::ID) !== false;
break;
}
if (strpos($oneMethod, LpcRelay::ID) !== false) {
$relayMethod = true;
}
}Puis ce code ligne 212:
foreach ($shippingMethod as $oneMethod) {
if (strpos($oneMethod, LpcRelay::ID) !== false) {
$relayMethod = true;
}
}Par :
foreach ($shippingMethod as $key => $oneMethod) {
if (strpos($key, '_synced_') !== false) {
$relayMethod = strpos($oneMethod, LpcRelay::ID) !== false;
break;
}
if (strpos($oneMethod, LpcRelay::ID) !== false) {
$relayMethod = true;
}
}?a devrait lever la limite lorsqu’il y a une livraison synchronisée hors point de retrait.
Je ferai des tests supplémentaires pour voir si nous pouvons ajouter ces deux modifications dans la version en ligne du plugin ou s’il faut apporter des modifications supplémentaires.
Effectivement cela semble fonctionner de la sorte…
Merci,
- You must be logged in to reply to this topic.