• Resolved simon_a6

    (@simon_a6)


    We are helping a client who uses this plugin.
    They are using a % for their products, rather than KG.
    We can use Loco Translate to change KG or G to %, but it doesn’t seem to affect the suffix in Total Weight in the cart with this plugin.

    While I can change Total Weight to anything within Loco Translate, I don’t seem to be able to change KG, to %.

    How do we do this, even if it is in the code itselt?

    Simon

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Marta Borówka

    (@martapaw)

    Hello @simon_a6,

    The units are from the WooCommerce settings: https://wpdesk.me/mp/whhlw.png
    Please try to find the translation for the WooCommerce plugin in the Loco Translate.

    Best regards,
    Marta

    Thread Starter simon_a6

    (@simon_a6)

    Did. It changed it in that very dropdown, but the Cart page still showed “kg”.

    Plugin Support Marta Borówka

    (@martapaw)

    @simon_a6,

    This must be a problem with Loco Translate – please contact them.

    Best regards,
    Marta

    Thread Starter simon_a6

    (@simon_a6)

    Not really. It can see only text that is in the database. It can change the KG and G etc from WooCommerce. But the text that shows in the cart from your plugin, doesn’t come from there, as it seems to affect only the dropdown.

    Plugin Support Marta Borówka

    (@martapaw)

    Hello @simon_a6,

    I discussed this with the dev team. We’ll try to take care of it. I’ll update you if something changes with this.

    Best regards,
    Marta

    Plugin Support Marta Borówka

    (@martapaw)

    Hello @simon_a6,

    Please up to date our plugin and use the filter in the functions.php in the current using theme:

    woo_cart_weight/cart_weight – your are able to modify displaying weight
    woo_cart_weight/weight_unit – your are able to modify the unit

    
    add_filter( 'woo_cart_weight/weight_unit', 'woo_cart_weight_weight_unit' );
    /**
     * @param string $weight_unit
     *
     * @retun string
     */
    function woo_cart_weight_weight_unit( $weight_unit ) {
    	return strtoupper( $weight_unit );
    }
    

    for example:

    
    add_filter( 'woo_cart_weight/weight_unit', 'woo_cart_weight_weight_unit' );
    /**
     * @param string $weight_unit
     *
     * @retun string
     */
    function woo_cart_weight_weight_unit( $weight_unit ) {
        $weight_unit = "%";
        return ( $weight_unit );
    }
    

    Best regards,
    Marta

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do we change the Weight Suffix?’ is closed to new replies.