smartsendio / woocommerce

Smart Send module for WooCommerce
GNU General Public License v3.0
0 stars 2 forks source link

Translate shipping method shown in backend #6

Closed bilfeldt closed 5 years ago

bilfeldt commented 5 years ago

Right now, then we are showing a capitalized edition of the shipping method id:

$this->shipping_method

Instead, then we should take the name also used in the settings (dropdown).

bilfeldt commented 5 years ago

This is a Nice to have feature, so let us first find out if this can be done easily.

shadimanna commented 5 years ago

I am not clear on this requirement, can you clarify what you mean by "capitalized edition"?

bilfeldt commented 5 years ago

We are displaying the shipping method in the meta box as:

$shipping_method_carrier = ucfirst(SS_SHIPPING_WC()->get_shipping_method_carrier($ss_shipping_method_id));
$shipping_method_type = ucfirst(SS_SHIPPING_WC()->get_shipping_method_type($ss_shipping_method_id));

echo '<h3>' . __('Shipping Method', 'smart-send-logistics') . '</h3>';
echo '<p>' . $shipping_method_carrier . ' - ' . $shipping_method_type . '</p>';

See meta_box() method in smart-send-logistics/includes/class-ss-shipping-wc-order.php

Example

So an example could be that we write

<p>Postnord - Agent</p>

but it should be

<p>PostNord: Select pick-up point (MyPack Collect)</p>

which is the human readable name for the method postnord_agent as given in the array $this->shipping_method in smart-send-logistics/includes/class-ss-shipping-wc-method.php

bilfeldt commented 5 years ago

Closes PR #10 image