Hi

I got PHP Warnings "Warning: Missing argument 2 for commerce_flat_rate_service_rate_order()" as the commerce_flat_rate_service_rate_order() function gets $order as second argument. However that is no where used and thus implementations of that function will return such warnings.

Regards,
Lachezar

Comments

lachezar.valchev’s picture

Status: Needs work » Needs review
StatusFileSize
new988 bytes

Hi,

Here is a small patch to fix that.

Regards,
Lachezar

rszrama’s picture

Category: Bug report » Support request
Status: Needs review » Closed (works as designed)

I'm not sure what code you have that's calling this function, but the code from Commerce Shipping that invokes this function definitely sends the $order object:

// If the service specifies a rate callback...
if ($callback = commerce_shipping_service_callback($shipping_service, 'rate')) {
  // Get the base rate price for the shipping service.
  $price = $callback($shipping_service, $order);
  // ...
}

Marking this "works as designed." Feel free to supply more information re: how your function gets called w/o $order.