Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › B2B Price problem
- This topic has 3 replies, 2 voices, and was last updated 5 years, 4 months ago by
Ernest Marcinko.
-
AuthorPosts
-
January 27, 2021 at 6:25 pm #31319
iGianni8495
ParticipantHi, 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 customersScreen -> 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/January 28, 2021 at 11:24 am #31325Ernest Marcinko
KeymasterHi,
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.
February 1, 2021 at 8:42 am #31370iGianni8495
ParticipantHi, 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 🙁
February 1, 2021 at 2:03 pm #31377Ernest Marcinko
KeymasterHi,
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 🙂 -
AuthorPosts
- You must be logged in to reply to this topic.