B2B Price problem

This topic contains 3 replies, has 2 voices, and was last updated by

 
Keymaster
11 months, 4 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31319

    Participant

    Hi, I have a serious problem with displaying prices for B2B and B2C customers.

    The price of this product https://cozz.genesistest.it/prodotto/chiffon-cangiante-elisa/ is:
    € 9.9 for all B2C customers
    € 8.9 for B2B P10 customers
    € 7.90 for B2B P7 customers

    Screen -> https://imgur.com/a/TImidRU

    What happens is that in the Ajax Search Pro shop page (as a B2C customer and / or as a visitor) the price referred to B2B customers (VAT excluded) is shown -> https://imgur.com/a/458MCaF

    If I enter the product page, however, I see the correct price -> https://imgur.com/a/cElrcFG

    Obviously the problem does NOT occur with the standard woocommerce shop page -> https://imgur.com/a/OFXy41d

    Can you give me a hand to solve the problem?

    NOTE: I use the B2BKing plugin on the site
    Website link -> https://cozz.genesistest.it/
    Ajax Search Pro page -> https://cozz.genesistest.it/shop/
    WooCommerce Sop Page -> https://cozz.genesistest.it/negozio/

    #31325

    Hi,

    The plugin requests the price from WooCommerce directly, so if anything attaches a hook to the price functions, it should be apparent on the search as well.

    Please let me know, if the B2BKing has an API request the price based on the user and product, or a hook to apply on the price itself. I can then suggest a programmatical solution if possible.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #31370

    Participant

    Hi, I asked B2BKing if they have any APIs and they replied like that:

    “The plugin doesn’t have an API request for that.

    I think Ajax Pro probably has a non-standard shop page, that is probably better/faster than others, but doesn’t use typical WooCommerce hooks that our plugin uses.

    We have the snippet above to get price programatically – if it helps we can add a class and function to do this quicker – if their dev team has any suggestions or code, we are happy to implement them in our plugin.”

    Please help me solve this 🙁

    #31377

    Hi,

    Thank you!

    “We have the snippet above to get price programatically..”

    Do you have a link to that snippet? If there is a function or anything we could use, it may help. The results are not a shop page indeed, so I am guessing they are running hooks on the shop page related hooks.

    The plugin uses the regular WooCommerce functions. In short the price is requested as:

    $p = wc_get_product( $id );
    $price = $p->get_price();
    $price = wc_price($price);

    I believe there is a hook within the get_price() (via the get_prop() inherited method) as well as the wc_price() function.
    If they don’t have any custom code to get the price via the product ID, then maybe a hook to apply on these core WooCommerce hooks? That could also work. Please let me know 🙂

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.