Jump to content

Edit History

Mian Waqas

Mian Waqas

15 minutes ago, ps8moduly.cz said:

As soon as you edit the carrier, its id will change and your code will not work.

Then he should simply update the code with it, because you not going to change it daily... also if somehow / someone is editing the "pick up in store" carrier every day 😀 then here is the updated code to  get the shippingMethod by name rather then by ID
 

if ($shippingMethodName === $desiredShippingMethodName) {
    // Set the exact shipping method name in above variable
    return 1;

hope this helps someone

Mian Waqas

Mian Waqas

8 minutes ago, ps8moduly.cz said:

As soon as you edit the carrier, its id will change and your code will not work.

then simply to update the code with it, because you not going to change it daily... also if somehow / someone is editing the "pick up in store" carrier every day 😀 then here is the updated code to  get the shippingMethod by name rather then by ID

if (isset($shippingMethodNameMap[$shippingMethodId]) && $shippingMethodNameMap[$shippingMethodId] === $desiredShippingMethodName) { // Set the order status to 1 (ready for pickup) return 1;

if ($shippingMethodName === $desiredShippingMethodName) {
    // Set the exact shipping method name in above variable
    return 1;

hope this helps someone

×
×
  • Create New...