Support » Plugin: Multivendor Marketplace Solution for WooCommerce - WC Marketplace » Custom shipping name needs improvement

  • Resolved meglio

    (@meglio)


    Currently, in WCMp_Frontend::woocommerce_shipping_package_name(), the vendor shipping customization code has two issues in it:

    1.Even thou it adds a space between the vendor name and the shipping name:

    return $vendor->user_data->display_name . __(' Shipping', 'dc-woocommerce-multi-vendor');

    … It gets displayed without the space in the Storefront theme.

    2. There’s no setting in admin panel to stop prefixing the “Shipping” word with the vendor name when there is only one vendor.

    3. The original shipping text has more to it than just a single “Shipping” word, but your filter eliminates it altogether:

    apply_filters( 'woocommerce_shipping_package_name', sprintf( _nx( 'Shipping', 'Shipping %d', ( $i + 1 ), 'shipping packages', 'woocommerce' ), ( $i + 1 ) ), $i, $package )

    Not sure if it’s intended or an issue that needs to be fixed. Please check.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dualcube

    (@dualcube)

    Hi @meglio

    1.Even thou it adds a space between the vendor name and the shipping name:
    … It gets displayed without the space in the Storefront theme.

    >> Did you translate the string?

    2. There’s no setting in admin panel to stop prefixing the “Shipping” word with the vendor name when there is only one vendor.

    >> Yes, there is no such settings for this. However, you can add this setting using this filter woocommerce_shipping_package_name

    3. The original shipping text has more to it than just a single “Shipping” word, but your filter eliminates it altogether:
    Not sure if it’s intended or an issue that needs to be fixed. Please check.

    >> This is not an issue.

    Let us know if you have any further query.

    Thread Starter meglio

    (@meglio)

    Oh, so in your language files, you’re using strings like Shipping instead of Shipping? This is not a good idea and not a common practice.

    What if you create a dedicated string, like %s Shipping with a note to translators that %s is for vendor name?

    While integrating your plugin into our store, I noticed there are many places like this in the code, and after applying my translations, I ended up seeing a lot of “no-space” phrases in the user interface.

    In general, it’s not good to compose sentences and phrases out of dedicated strings that are translatable on their own. This way translators cannot adapt the translation to match the sequence of words in the best possible way. For instance, in Russian I’d say “Доставка Созидора”, where the first word translates to “Shipping”, and the second word is the vendor name. So it’s basically Shipping %s, which sounds more naturally in Russian (also in Ukrainian).

    Yes, there is no such settings for this. However, you can add this setting using this filter woocommerce_shipping_package_name

    The issue is, I can’t. That’s because this is not a filter of your plugin, but rather a filter of WooCommerce plugin. This means I can REPLACE the shipping package name by my own version, but I can’t HOOK INTO the process of prefixing it. Hm?

    Plugin Author Dualcube

    (@dualcube)

    @meglio, thanks for sharing this with us. We are looking into this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom shipping name needs improvement’ is closed to new replies.