Total de Wishlist por usuario
-
Buenas tardes, ayer me puse en contacto con ustedes por medio del canal de Youtube consultando si se puede poner un subtotal en la wishlist. Me respondieron que si se podia y me pasaron este instructivo. https://support.yithemes.com/hc/en-us/articles/115000170153-Wishlist-How-to-display-for-user-the-total-price-of-all-product-in-list.
Tengo la cuenta gratis, me comentaron que no había ningún problema y que se podía hacer. Pero no se como, por eso acudo a ustedes para ver si me pueden ayudar.
Quedo a la espera des sus comentarios
Muchas gracias
Saludos
Facundo
-
In each product, in the template that I put together in the Divi Theme Builder there is the option to “Add to wish list”. On this product page after adding the product to my wish list appears “remove from wish list”. This text is the one that I want to modify “remove from wish list” to “Remove Action”. The same thing happens to me with the word Category that I want to put it in Spanish
I would like to learn how is the logic to make these combinations in text, could you give me some tip or instructions that I can see
This text is the one that I want to modify “remove from wish list” to “Remove Action”
Doesn’t the code that I sent you help change that label?
I tested it locally, and it was working just fine (check my screenshot)The same thing happens to me with the word Category that I want to put it in Spanish
Is this something from wishlist plugin? maybe you need to translate it in theme’s .po spanish file
I would like to learn how is the logic to make these combinations in text, could you give me some tip or instructions that I can see
Do you mean the action/filter logic? In this case WordPress has some amazing material ??
It’s like Christmas every time I get an email from you!
No, the last code you sent me didn’t work. I do not know why?
I don’t know how to send you a screen print. I can’t change it.
add_filter( ‘yith_wcwl_remove_from_wishlist_label’, function() {
return ‘Eliminar Accion’;
} );And if you look below in the image you send me, there is Category: Hoodies, That “category” I would like to have it in Spanish.
Thanks for the article!!!
No, the last code you sent me didn’t work. I do not know why?
I’m afraid me neither
The code that I sent you should work, as I tested on my local installation, and it worked just fine (check the screen)Unfortunately it is not easy for me to debug the issue; anyway, maybe I can help you another way
Please, note that this wouldn’t be my preferred choice, but given the limited debug possibility that we have, it could be a valid workaroundCould you please try to go to WP Dashboard -> Appearance -> Customize -> Additional CSS and append the following CSS rules?
.single-product .yith-wcwl-add-to-wishlist a.delete_item { font-size: 0; } .single-product .yith-wcwl-add-to-wishlist a.delete_item i { font-size: 35px; } .single-product .yith-wcwl-add-to-wishlist a.delete_item:after { content: 'Eliminar Accion'; font-size: 35px; }
I tested them on your installation, and this is the final result that I can see
And if you look below in the image you send me, there is Category: Hoodies, That “category” I would like to have it in Spanish.
This is not something that comes from our wishlist plugin
Anyway, WooCommerce manage that string, and you should see it translated, if you correctly selected language for your installation (you can choose site’s language under WP Dashboard -> Settings -> General -> Site Language, and once you’re done you may need to install language packs from WP Dashboard -> Dashboard -> Updates)Yes, everything worked for me !!!! You’re the best!
With CSS it will be able to modify the font size of the “Total: 250 Kg CO2 eq / year” that we add in the wish list.
I do not know if I am clear, within the wish list we add a TOTAL, can we modify the font size and center that with CSS or PHP?Hi again
please, try to add the following CSS rules at the end of Additional CSS section of theme customizer (WP Dashboard -> Appearance -> Customize)
.wishlist_table + p { text-align: center; font-size: 35px; }
This is the final result that I got on your installation
Of course you can change the font-size property as you preferwow!!! wow!!! wow!!!
you are the best!!!!It is looking great!
I am looking to be able to change CO2 to CO2 (the 2 as a subscript). So that it looks as it should.
https://es.wikipedia.org/wiki/Di%C3%B3 Oxido_de_carbono
On the right is the formula and it looks like it should be`Hi again
In order to do this, you’ll need to change two of the scripts that I previously sent, those containing “CO2” strings
I’ll attach updated code belowadd_action( 'yith_wcwl_wishlist_after_wishlist_content', function( $args ) { /** * @var $wishlist YITH_WCWL_Wishlist */ $wishlist = isset( $args['wishlist'] ) ? $args['wishlist'] : false; if ( ! $wishlist ) { return; } $total = 0; if ( $wishlist->has_items() ) { foreach ( $wishlist->get_items() as $item ) { $total += $item->get_product_price(); } } if ( $total ) { echo '<p><b>Total:</b> ' . number_format( $total, wc_get_price_decimals(), wc_get_price_decimal_separator(), wc_get_price_thousand_separator() ) . ' Kg de CO? /a?o</p>'; } }, 5 );
add_filter( 'yith_wcwl_item_formatted_price', function ( $formatted_price, $base_price ) { return number_format( (float) $base_price, wc_get_price_decimals(), wc_get_price_decimal_separator(), wc_get_price_thousand_separator() ) . ' Kg de CO? /a?o'; }, 10, 2 );
This is the result on my local installation
Hope this helpsThanks!!!
But it dosent work with the price products.
this is the old code:
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); function add_my_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case 'PGK': $currency_symbol = ' Kg CO2 eq/a?o'; break; } return $currency_symbol; }
The new CODE
add_filter( ‘yith_wcwl_item_formatted_price’, function ( $formatted_price, $base_price ) {
return number_format( (float) $base_price, wc_get_price_decimals(), wc_get_price_decimal_separator(), wc_get_price_thousand_separator() ) . ‘ Kg de CO? /a?o’;
}, 10, 2 );It change in the Wish list but not in the products
Is like a mixture of the both codes.
Thanks!
Hi again
The code that I sent you is only meant to change “currency” in wishlist, indeed
This codeadd_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); function add_my_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case 'PGK': $currency_symbol = ' Kg CO2 eq/a?o'; break; } return $currency_symbol; }
wasn’t something that I personally suggested
Anyway, I think you can keep sing it to add this new “currency” to your shop
If you want to change the symbol, just update it as followsadd_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); function add_my_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case 'PGK': $currency_symbol = ' Kg CO? eq/a?o'; break; } return $currency_symbol; }
Can I add a new “currency” to my store? for real? How can I do that?
wow! thanks!Well, actually this code
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); function add_my_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case 'PGK': $currency_symbol = ' Kg CO? eq/a?o'; break; } return $currency_symbol; }
won’t add a new currency, but will override default symbol of PGK currency (Papa New Guinea kina)
As I said, this is not something I personally suggestedAnyway, if you want to add a completely new currency to your shop, you could use this code
add_filter( 'woocommerce_currencies', function( $currencies ) { $currencies['CO2'] = 'Kg CO? eq/a?o'; return $currencies; } ); add_filter( 'woocommerce_currency_symbols', function( $symbols ) { $symbols['CO2'] = ' Kg CO? eq/a?o'; return $symbols; } );
You’ll then need to select this currency under WP Dashboard -> WooCommerce -> Settings -> General, as shown here
At this point, all prices in your shop will appear with your custom currency (check this example)Anyway, please note that this is far beyond the scope of this forum, and you should ask on WooCommerce’s one for similar topics
Thanks!!! Thank you for all of your help!
Why don’t you recommend it? What problems could I have doing this?
I am very interested in your opinion.Why don’t you recommend it?
if you refer to the first approach (overriding existing currency) I simply can’t see why doing this: once you’re going to write some code anyway, there is no reason to override existing currency, since you can simply add a new one, as I described you above ??
Thank you very much for all your advice. I learned a lot with you. I would like to leave a recommendation for all your work. How can I do it?
- The topic ‘Total de Wishlist por usuario’ is closed to new replies.