ciberdom
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Round Offer LabelsHi @lorro!
How can I add an image designed by me for the label?Forum: Plugins
In reply to: [WooCommerce] Different tax according to the User Role (Code)Hello @madeincosmos;
Thank you very much for the response and the fantastic help. Before your answer I got help from one of your colleagues through the chat. Finally I added the following code and it seems to be working correctly. I’ve been trying for a few days to see if there are no problems. I’ll tell you how things are going.
Code:
add_filter(‘pre_option_woocommerce_tax_display_shop’, ‘alter_tax_display’);
add_filter(‘pre_option_woocommerce_tax_display_cart’, ‘alter_tax_display’);function alter_tax_display( $tax_display ) {
if ( current_user_can( “partner” ) ){
return “excl”;
} else {
return “incl”;
}
}add_filter( ‘woocommerce_get_price_suffix’, ‘wc_get_price_suffix_filter’, 10, 2 );
function wc_get_price_suffix_filter( $price_display_suffix, $item ) {
// check for the user role return blank if it matches
if ( current_user_can( “partner” ) ) {
$price_display_suffix = ‘<span class=”sufijopartner”>(+ IVA)</span>’;
}return $price_display_suffix;
}Forum: Plugins
In reply to: [WooCommerce] VAT Not included for User RoleHola @nerealonela;
¿Podemos ver eso? No quiero molestar.Forum: Plugins
In reply to: [WooCommerce] VAT Not included for User RolePerdona, el último mensaje no era para este ticket, me equivoqué.
Forum: Plugins
In reply to: [WooCommerce] Hide product to a user role@mdshak;
http://vegan-tattoo.com/tienda/I copied the code to the end of the file in function.php
http://vegan-tattoo.com/wp-content/uploads/Captura-de-pantalla-2018-02-10-a-las-19.44.15.pngThe product is still visible
http://vegan-tattoo.com/wp-content/uploads/01.jpgForum: Plugins
In reply to: [WooCommerce] VAT Not included for User Rolehttp://vegan-tattoo.com/tienda/
I copied the code to the end of the file in function.php
http://vegan-tattoo.com/wp-content/uploads/Captura-de-pantalla-2018-02-10-a-las-19.44.15.pngThe product is still visible
http://vegan-tattoo.com/wp-content/uploads/01.jpgForum: Plugins
In reply to: [WooCommerce] Hide product to a user role@mdshak;
It does not work. The product is still visible to the “Guest” and “customer”Forum: Plugins
In reply to: [WooCommerce] VAT Not included for User RoleHola @nerealonela;
Acabo de ver tu mensaje, estoy disponible!!!
Forum: Plugins
In reply to: [WooCommerce] Hide product to a user role@mdshak, Neither has that code worked.
Forum: Plugins
In reply to: [WooCommerce] Hide product to a user rolehi @mdshak);
It does not work. But I do not know if I have added it correctlyfunction mdshak_exclude_product_from_wholesale( $q ){
$current_user = wp_get_current_user();
$ARRAY_OF_PRODUCT_IDS_YOU_WANT_HIDDEN = array(27721); // PUT THE IDS AS YOU WANT TO HIDDENif ( !in_array( ‘partner’, $current_user->roles ) ) {
$q->set( ‘post__not_in’, $ARRAY_OF_PRODUCT_IDS_YOU_WANT_HIDDEN );
}}
add_action( ‘woocommerce_product_query’, ‘mdshak_exclude_product_from_wholesale’ );
Forum: Plugins
In reply to: [WooCommerce] Hide product to a user roleThank you very much for the code,
Can you help me a little more please?
I do not know how to add the ID.
Product to hide:
http://vegan-tattoo.com/tienda/expositor/
ID: 27721User role for which the product should be visible:
partnerForum: Plugins
In reply to: [WooCommerce] Hide product to a user roleThanks @mdshak
Is it possible to do it without having to use a plugin?
Actually I just have to hide a product and if I can avoid having to install a plugin for something so simple would be perfect.Forum: Fixing WordPress
In reply to: Hide product to a user roleOmar, thanks for the answer but it seems that it has not worked. Did I have to add something to the code or just paste it into functions.php?
Forum: Fixing WordPress
In reply to: Hide product to a user role@tp;
Now when I publish it in the other site it tells me that the ticket is duplicated. What I can do?Forum: Fixing WordPress
In reply to: Hide product to a user roleSorry, I did not realize. My intention was to write it in the WooCommerce forum. I am so sorry.