[Resolved] Hello, i need help with – Display cart panel on add to cart.

Home Forums Support [Resolved] Hello, i need help with – Display cart panel on add to cart.

Home Forums Support Hello, i need help with – Display cart panel on add to cart.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #2381811
    Alon

    I have RTL woocommerce website and everything looks great except “Display cart panel on add to cart”.
    When a user add product to cart the cart panel is not RTL and in english (everything else is RTL and in my language).
    How can i change that?
    Thank you in advance.

    #2382440
    Ying
    Staff
    Customer Support

    Hi Alon,

    Would you like this layout?
    10.22.2022-11.21.42

    If so, can you try adding this CSS?

    .rtl .add-to-cart-panel .continue-shopping {
        margin-left: auto;
        margin-right: unset;
    }
    
    .rtl .add-to-cart-panel .cart-info {
        margin-right: unset;
        margin-left: 20px;
    }

    Let me know!

    #2382456
    Alon

    Thank you for your reply.
    Now… How can i change the text to my language without plugin (loco translate).
    I’ll be really happy if you can help me with this one.

    #2382471
    Ying
    Staff
    Customer Support

    Now… How can i change the text to my language without plugin (loco translate).

    It should be translated by default, is your site a multi language site?

    What’s the site default language set at settings > general > Site Language?

    Can I take a look at your site? Let me know!

    #2382473
    Alon

    My site default language is Hebrew.
    Everything in my site translated flawlessly except this cart panel.

    #2382481
    Ying
    Staff
    Customer Support

    Can you switch to a twenty twenty theme to see if the translation is correct there?

    #2382501
    Alon

    I have no idea how to do this.
    I can’t find any cart panel in twenty twenty theme.

    #2382514
    Ying
    Staff
    Customer Support

    Oops my bad, the function doesn’t exist in twenty twenty themes.

    Can you translate below English words to Hebrew so I can write the function using the Hebrew words?

    – Checkout
    – Continue shopping
    – Item added to cart

    Let me know!

    #2382535
    Alon

    Checkout – לתשלום בקופה
    Continue shopping – המשך קניות
    Item added to cart – פריט נוסף לסל קניות
    Item – פריט
    Items – פריטים

    Thank you so much.

    #2382795
    David
    Staff
    Customer Support

    Hi there,

    try this PHP snippet:

    
    function cart_panel_text_strings( $translated_text, $text, $domain ) {
        switch ( $translated_text ) {
            case 'Checkout' :
                $translated_text = 'לתשלום בקופה';
                break;
            case 'Continue shopping' :
                $translated_text = 'המשך קניות';
                break;
            case ' Item added to cart. ' :
                $translated_text = 'פריט נוסף לסל קניות';
                break;
            case 'Item' :
                $translated_text = 'פריט';
                break;
            case 'Items' :
                $translated_text = 'פריטים';
                break;
        }
        return $translated_text;
    }
    add_filter( 'gettext', 'cart_panel_text_strings', 20, 3 );
    #2382927
    Alon

    Thank you for your help.
    The code translate just the first one – לתשלום בקופה.
    The others still in Eng.

    #2383455
    Fernando
    Customer Support

    Hi Alon,

    For reference, may you provide the link to the site in question?

    You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    #2384829
    Alon

    https://wouldyoukindly.co.il/product-category/modules.
    Please click on any button (הוספה לסל).
    Thank you in advance.

    #2385174
    David
    Staff
    Customer Support

    I made a slight change to my code above, can you try that.
    If its correct then the Item added to cart. should change.
    Let me know.

    #2385339
    Alon

    Hello David.
    It doesn’t work.
    It looks to me exactly as the code before.

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.