Rollbased Prices on Whish- and Compare-List

This topic has 9 replies, 2 voices, and was last updated 6 months ago ago by Luca Rossi

  • Avatar: Snapp
    Snapp
    Participant
    December 12, 2024 at 08:47

    Hi, we would like to use your “onboard” wish- and compare-list. We are using the B2B Marketpress Plugin and display rollbased prices on the shop… We have this code in our function.php but it seems to work unfortunately not in the right way. Could you please have a look and help us with some coding or smart solution?

    Regards, snap

    ////B2B Preisberechnung
    add_action( 'init', function() {
    	if ( class_exists( 'BM_Price' ) ) {
    		$prices = BM_Price::get_instance();
    		remove_filter( 'woocommerce_product_get_price', array( $prices, 'set_price' ), $prices::$set_price_prio );
    		add_filter( 'woocommerce_product_get_price', array( $prices, 'set_price' ), 99, 2 );
    	}
    });
    Please, contact administrator
    for this information.
    8 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    December 12, 2024 at 10:43

    Dear @Snapp,

    We hope this message finds you well.

    Could you kindly provide more details regarding what you are aiming to achieve? If possible, sharing screenshots or videos would be greatly appreciated to help us better understand your requirements.

    Additionally, could you confirm if your intention is to replace the default prices of the WooCommerce plugin with the prices from the B2B Marketpress Plugin?

    We look forward to your response.

    Best regards,
    The 8Theme Team

    Avatar: Snapp
    Snapp
    Participant
    December 12, 2024 at 12:02

    Of course, here you see on first screen a product with right customer rollbased price (20%). If we put it on our compare list, somtimes the price is displayed correctly, sometimes not… on the screen-customer-compare.png the first price is right, second product has the wrong price. Some on wishlist.
    And yes, we would like to display the price that customer see on single product.

    Hope we are not confusing you…

    Please contact administrator
    for this information.
    Files is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    December 15, 2024 at 14:01

    Hi @Snapp,

    We didn’t customize the price of products on the wishlish & compare pages.

    We just get the default price from products. As you can see in this code:

    https://prnt.sc/zYqN16mIK15Q

    Can you please try updating your custom code to this?

    
    ////B2B Preisberechnung
    add_action( 'wp', function() {
    	if ( class_exists( 'BM_Price' ) ) {
    		$prices = BM_Price::get_instance();
    		remove_filter( 'woocommerce_product_get_price', array( $prices, 'set_price' ), $prices::$set_price_prio );
    		add_filter( 'woocommerce_product_get_price', array( $prices, 'set_price' ), 999, 2 );
    	}
    });
    

    Let us know how it goes!

    Avatar: Snapp
    Snapp
    Participant
    December 15, 2024 at 19:34

    Hi,
    it displays the price in the right way but the special price for customer group is missing.

    For Example
    At the moment it displays:
    UVP:36,13 €
    36,13 €

    but it has to be…
    Customer Group 1 (20% discount)
    UVP:36,13 €
    21,68 €

    On single product it works fine…

    Avatar: Justin
    Luca Rossi
    Support staff
    December 16, 2024 at 07:13

    Dear @Snappm

    Thank you for reaching out to us.

    In this particular case, we kindly recommend contacting the plugin’s author directly for further assistance with this issue. Please note that matters related to third-party plugins fall outside the scope of the standard support services we provide.

    We appreciate your understanding and are here to assist you with any other inquiries related to our products.

    Best regards,
    The 8Theme Team

    Avatar: Snapp
    Snapp
    Participant
    December 16, 2024 at 10:07

    Ok, thank you. Only one little thing, we saw that only by product variation the price doesn’t show exactly. Perhaps you got a code supplement for that?

    Regards, snap

    Avatar: Snapp
    Snapp
    Participant
    December 16, 2024 at 10:13

    I think we solved the problem…

    add_action( 'wp', function() {
    	if ( class_exists( 'BM_Price' ) ) {
    		$prices = BM_Price::get_instance();
    
    		// Entferne den vorhandenen Filter von BM_Price
    		remove_filter( 'woocommerce_product_get_price', array( $prices, 'set_price' ), $prices::$set_price_prio );
    		remove_filter( 'woocommerce_product_variation_get_price', array( $prices, 'set_price' ), $prices::$set_price_prio );
    
    		// Setze den Filter mit höherer Priorität für einfache Produkte
    		add_filter( 'woocommerce_product_get_price', array( $prices, 'set_price' ), 999, 2 );
    
    		// Setze den Filter für Variantenprodukte
    		add_filter( 'woocommerce_product_variation_get_price', array( $prices, 'set_price' ), 999, 2 );
    	}
    });
    
    Avatar: Justin
    Luca Rossi
    Support staff
    December 17, 2024 at 09:00

    Dear @Snapp,

    We hope this message finds you well.

    We would like to confirm that the hook in question is specifically designed for variation products.

    We are delighted to hear that everything is now functioning as expected. Should you have any further questions or require assistance, please do not hesitate to reach out.

    Best regards,
    The 8Theme Team

  • Viewing 9 results - 1 through 9 (of 9 total)

The issue related to '‘Rollbased Prices on Whish- and Compare-List’' has been successfully resolved, and the topic is now closed for further responses

Helpful Topics

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.