in Education by
I'm using the WooCommerce Membership plugin to display member discounts on the Product page. Now I want to display the discount you could get with a membership for non member. This is what I see when I'm not a member: This is what I see when I'm a member: This is what I want to see when I'm not a member: JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I'm amazed how many times this question has been asked on the web and still no answer. Here's the solution I was able to come up with: add_action( 'woocommerce_single_product_summary', 'neonbrand_show_member_price_non_members' ); function neonbrand_show_member_price_non_members($price) { global $product; if ( $product->is_type( 'variable' ) ) { $variations = $product->WC_Product_Variable::get_available_variations(); $variations_id = wp_list_pluck( $variations, 'variation_id' ); if ( ! wc_memberships_is_user_active_member( get_current_user_id(), 'vip-membership' ) ) { $a = get_option( 'wc_memberships_rules' ); foreach($a as $value) { if(!empty(array_intersect($variations_id, $value['object_ids']))) { $discount = $value['discount_amount']; $nonmember_price = $product->get_price(); $member_price[] = $nonmember_price - $discount; } } echo '

Member Price As Low As: $'.min($member_price).'

'; } } } I have variations on most products so that's why I had to implement the "Member Price As Low As" because the variations had different discounts. Obviously the incentive for all of this is to get people to become members. This should be a feature of the plugin IMO. But ‍♂️

Related questions

0 votes
    There are ......... non-permanent members in the Security Council. (a) ten (b) five (c) fifteen (d) seven Please answer the above question....
asked Aug 10, 2022 in Education by JackTerrance
0 votes
    I have succeed implement this code to remove product from cart with Ajax. But it didn't works with ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers. URGENT! Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    write a html program to display a menu card of Hotel debri with heading with atleast 3 veg and non veg ... checkboxes and place order Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    I want to create a form that shows 2 different textboxes with a minimum and a maximum value of my ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I would Like to get a count of the number of days for which (VZ) stock return is larger than the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    I would Like to get a count of the number of days for which (VZ) stock return is larger than the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    _________ involves predicting a response with meaningful magnitude, such as quantity sold, stock price, or return on ... R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    Write a JAVA program. A computer manufacturing company offers 20% discount on laptop. If the price of any laptop ... ANY INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program. A computer manufacturing company offers 20% discount on laptop. If the price of any laptop ... discounted price. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    Consider the following relation: Product (PID, name, price, description) Now create a trigger in Product relation ... product relation Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    A customer purchased cold drinks of various brands. He purchased 5 bottles at a price of `35 per bottle and ... make him/her brainlest Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    How is the price of the Azure subscription placed?...
asked Dec 28, 2020 in Technology by JackTerrance
0 votes
    Which of this access specifies can be used for a class so that its members can be accessed by a different class ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
...