Tuesday, October 11, 2022
HomeWordPress Developmentplugins - Cart Merchandise Doubling When Translating to Arabic

plugins – Cart Merchandise Doubling When Translating to Arabic


I am having hassle sustaining the variety of gadgets when going to the Arabic Web page.

  • Woocommerce doubles the merchandise :
    Ex : In English web page I added 1 merchandise, after I click on the Arabic translation of the web page it robotically turns into 2 gadgets with out manually including any merchandise.
    ( picture under for reference – 1 turned to 2 within the Arabic Web page)

I’ve tried inserting ( code under ) however did not work. I’d respect any assist…


// Add Shortcode [cart_count]
perform get_cart_count() {

// Code
/**

  • Examine if WooCommerce is lively
    **/
    if ( in_array( ‘woocommerce/woocommerce.php’, apply_filters( ‘active_plugins’, get_option( ‘active_plugins’ ) ) ) ) {
    world $woocommerce;
    $lang = get_bloginfo(“language”);
    $merchandise = ”;
    if($lang == ‘ar’) {
    $merchandise = ‘ العنصر ‘;
    }else {
    $merchandise = ‘ merchandise’;
    }

if($woocommerce->cart->cart_contents_count == 1)
return $woocommerce->cart->cart_contents_count.$merchandise;
else
return $woocommerce->cart->cart_contents_count.$merchandise;

}
}
add_shortcode( ‘cart_count’, ‘get_cart_count’ );

enter image description here

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments