Hi Alon,
Can you try the below code instead:
function generatepress_custom_add_to_cart_panel_fragments( $fragments ) {
if ( isset( WC()->cart ) ) {
$fragments['.add-to-cart-panel .cart-data'] = '<div class="cart-data">' . sprintf( _n( '%d פריט', '%d פריטים', WC()->cart->get_cart_contents_count(), 'gp-premium' ), WC()->cart->get_cart_contents_count() ) . ' - ' . WC()->cart->get_cart_total() . '</div>';
}
return $fragments;
}
function cart_panel_text_strings( $translated_text, $text, $domain ) {
$domain ='gp-premium';
switch ( $translated_text ) {
case 'Checkout' :
$translated_text = 'לתשלום בקופה';
break;
case 'Continue Shopping' :
$translated_text = 'המשך קניות';
break;
case 'Item added to cart.' :
$translated_text = 'פריט נוסף לסל קניות';
break;
}
return $translated_text;
}
add_filter( 'gettext', 'cart_panel_text_strings', 20, 3 );
add_filter( 'woocommerce_add_to_cart_fragments', 'generatepress_custom_add_to_cart_panel_fragments', 10, 1 );
Let me know if it works 🙂