tiwelle
Forum Replies Created
-
You’re like a code god ! Thank you !
I do have another question for you.
Let’s say we have 4 lines in 1 order (3 products and 1 extra cost). Is it possible to get this twice, with in 1 block price without tax, and 1 block price with tax (so we have 8 lines) ?It’s done.
I hope you’ll find a solution ??
Thank you,
ManueForum: Plugins
In reply to: [YITH WooCommerce Multi Vendor] Email Order NotificationsYou can also add a filter in your functions file (or in a separate plugin) with this code, but it sends the entire order to all of the vendors, so there is some modifications to add :
/** function sv_conditional_email_recipient( $recipient, $order ) { $page = $_GET['page'] = isset( $_GET['page'] ) ? $_GET['page'] : ''; if ( 'wc-settings' === $page ) { return $recipient; } if ( ! $order instanceof WC_Order ) { return $recipient; } $items = $order->get_items(); foreach ( $items as $item ) { $product = $order->get_product_from_item( $item ); $id = $product->id; $vendor = yith_get_vendor( $id, 'product' ); if ( $vendor->is_valid() ) { $iduser = $vendor->get_owner(); $user_info = get_userdata($iduser); $useremail = $user_info ->user_email ; $recipient .= ', '.$useremail ; return $recipient; } } return $recipient; } add_filter( 'woocommerce_email_recipient_new_order', 'sv_conditional_email_recipient', 10, 2 );
I used and modify a code I found here https://www.skyverge.com/blog/add-woocommerce-email-recipients-conditionally/
Hello,
Is there any news on this subject ?
Thank you,
ManueForum: Plugins
In reply to: [WooCommerce] Restrict payment options based on productHello,
Thank you for the snippet, it’s really helpful.
I’m trying to achieve the same results, but with the following : if and only if there is only 1 category type in the cart, I want to disable on payment.
I tried :function filter_gateways($gateways){ $payment_NAME = 'cheque'; // <--------------- change this $category_ID1 = '13'; // <----------- and this $category_ID2 = '14'; // <----------- and this $category_ID3 = '15'; // <----------- and this global $woocommerce; foreach ($woocommerce->cart->cart_contents as $key => $values ) { // Get the terms, i.e. category list using the ID of the product $terms = get_the_terms( $values['product_id'], 'product_cat' ); // Because a product can have multiple categories, we need to iterate through the list of the products category for a match foreach ($terms as $term) { // 20 is the ID of the category for which we want to remove the payment gateway if(($term->term_id != $category_ID1) AND ($term->term_id != $category_ID2) AND ($term->term_id != $category_ID3) ){ unset($gateways[$payment_NAME]); // If you want to remove another payment gateway, add it here i.e. unset($gateways['cod']); break; } break; } } return $gateways; } add_filter('woocommerce_available_payment_gateways','filter_gateways');
Because I thought that checking if products are not in all category except the one I’m trying to isolate, I would be able to de activate the check method, but it’s not working.
What do you think ?
Thank you,
ManueForum: Plugins
In reply to: [Posts 2 Posts] Connexions don't showFYI, connections are showing on auteur single.php, but not in my product-single.php
It’s a mystery, I really don’t understand… Please help…Forum: Plugins
In reply to: [Background Manager] Have css max-widthok I did it
I changed.myatu_bgm_fs { width:1500px; min-height:100%; max-width:initial!important; max-height:initial!important; margin:0 auto; padding:0; border:0; position:absolute; top:0; /*left:0*/ }
on pub.css and then on my own style.css a width for html and page elements.
Hope it’ll help you.Forum: Plugins
In reply to: [Background Manager] Problem with Safarinevermind, it was an accent problem. Img files with accent didn’t show up. I took off the accent and it works like a charm.
Hello,
Do you have any news on this ? I would like to use this functionality.
Thank you,
Emmanuelle