-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOOM-5223] Carriers list to enter a tracking number shows only those enabled for visitors #9687
Comments
Hi Paolo, I did not manage to reproduce the issue with PS version 1.7.3.0. Best regards, |
Hi Khouloud. Here's my situation. Picture one shows the list of carriers we defined. As we don't want visitors to have inaccurate information about shipping cost, we have a fake courier, "No shipping cost for visitors", enabled to visitors only, with free shipping (it will show "depending on destination" as shipping cost when filling the order). Then we have "couriers" defining shipping costs for zones. These are enabled for guests and customers only. With this situation, picture 2 shows the result: when we edit tracking information, the drop down list shows only the fake courier for visitor, while it should show a list of couriers for guests or customers (this test order was created with a registered user). This comes from the use of function Carrier::getCarriersForOrder, that is called with group parameter null in function getCarrierList, module AdminOrdersController.php. As group parameter is null, getCarriersForOrder will use only PS_UNIDENTIFIED_GROUP as group, therefore visitor. I think it should use the group of the customer who placed the order, instead of being called with a null parameter. We solved this by adding a real courier definition (DHL, for example, at the bottom of picture 1) to be used just to provide tracking information upon shipment. We also defined a new group ("couriers"), enabled for this new courier definition only. Modifying getCarrierList function line from return Carrier::getCarriersForOrder(Address::getZoneById((int) $address->id), null, $cart); to return Carrier::getCarriersForOrder(Address::getZoneById((int) $address->id), array(4), $cart); (where '4' is the id of the new couriers group) it does what we need, as in picture 3. Best regards,
Paolo
|
Hi Paolo, How could you create an order with a customer in a visitor group? Best regards, Khouloud |
Hi! We can add products to the cart as visitors, but we need to checkout as guest or registered customer. No shipping cost is shown to visitors until they provide address information. Paolo |
Hi Paolo, I manage to reproduce the issue following this steps : Best regards, Khouloud |
Thank you for your time in checking on this, Khouloud. As I wrote above, the function getCarrierList may just consider in which group was the customer when he entered the order, and pass it to getCarriersForOrder instead of null (didn't test this myself...) Have a great day, Paolo |
Salut Khouloud BELGUITH Je n'arrive pas à reproduire le problème avec le scénario que tu décris https://drive.google.com/open?id=12rudDc2OHD5VPgdSVini7ggGx9eIJMTA |
Salut Marion F, Je n'ai pas utilisé les transporteurs par défaut de PrestaShop. |
I can reproduce the issue described by Paolo this way: Create a carrier with group access => Visitor |
Hi, I'm experiencing the same exact issue. |
Alright, this is the fix: AdminOrderController.php line 3019 Method should retrieve customer's groups and passing them to the getCarriersForOrder static function:
I'm going to open a merge request on that. |
Hi @manfield, Thanks for your fix. |
Hi @khouloudbelguith, this merge request: is not yet assigned. Just to make you know ;) |
Fixes error reported in #9687, regarding carrier list in the modal to ...
When modifying an order from backoffice to enter tracking information, the list of carriers shows only those enabled for visitors. Function getCarrierList() in AdminOrdersController should consider not only the country of the customer but its group too.
Configuration parameter PS_UNIDENTIFIED_GROUP can change this behavior, but what if we want to leave access to carriers only to guests and registered users?
Create a carrier with group access => Visitor
Create a carrier with group access => Guest / Customer
Go to FO => add products to the cart as a visitor => to complete the order => create a new customer => process checkout
Go to BO => edit the order created => edit the shipping details => the list of carriers show only carriers configured for visitor and not for Guest / Customer
The text was updated successfully, but these errors were encountered: