Archived topic
Show bulk price on single product page
28 replies · Started by Michiel Lap on August 29, 2019
Hi,
I am using Booster for Woocommerce and I activated Wholesale price.
It works in the cart, but I can't find a way to show the option on the single product page.
How do I add it? It should show up with this: [wcj_product_wholesale_price_table]
Or, do you know of another plugin (free if possible) that will do this?
Thanks, Michiel
Hi there,
Can you test if you are able to add that code using one of the WooCommerce hooks using our Hooks Elements module?
https://docs.generatepress.com/article/hooks-element-overview/
https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
If not then might be worth checking with the plugin support to see if there is way to activate the feature on single products pages
Let me know :)
Hi,
I'd rather use the GP hooks than depending on another plugin.
On the page you sent me https://docs.generatepress.com/article/hooks-element-overview/ I can't find if it's possible to integrate this code, for example before the 'add to cart' button, on a single product page.
And, as described on this page, I don't see the link Elements (Appearance>Elements)?
I do see Appearance>GP Hooks though...
Sorry, I did not activate it in settings... now I see Elements.
Still, I don't see how to insert hooks before add to cart.
Thanks. (sorry for the messy messages)
Hi there,
no extra plugin required, what Leo is suggesting:
1. Create a New Hook Element.
2. Add the shortcode and check the execute shortcode check box.
3. Select from the Hook List:
woocommerce_after_add_to_cart_button
The BusinessBloomer link shows all the hooks for woos positions.
4. Set your Display Rules to Product > All Products.
Thank you David!
It worked and it is visible on for example this page >
One more thing, how do I translate:
from 3 pcs. to dutch: 'vanaf 3 stuks'.
I have tried to do this with the Loco translate plugin and then edit Booster for woocommerce, but in none of the translation files (Dutch nor English) can I find 'from' or 'pcs'.
Hopefully you can teach me where to find and edit these kind of translation issues?
Kind regards, Michiel
Might be worth checking with the Booster plugin authors - as they may have a filter for doing this. I know there plugin has modules for WPML translation and the ability to change price labels so they should be able to help.
Thanks, but am I correct I then need to buy WPML for this?
It's this label for which I can't find the tanslation: [wcj_wholesale_price_table]
Loco translate is not suitable for this?
https://booster.io/features/woocommerce-booster-wpml/
This one only works if wpml is installed.
Sorry, maybe we're off Generatepress, but I can't find the way.
I found this:
https://booster.io/shortcodes/wcj_product_wholesale_price_table/
The shortcode accepts arguments ie.
[wcj_product_wholesale_price_table heading_format="FROM %level_min_qty% PCS."]
So you should be able to use that and change the heading_format="vanaf %level_min_qty% stuks"
Yes, that did it!
Glad to be of help.
On the businessbloomer page I see the positions, but not this one:
Would it be possible to hook next to (or right below) the price?
And to align the text left?
The title and the price are hooked into the:
woocommerce_single_product_summary
You can hook the shortcode in there, and adjust the hooks Priority. Lower number moves the element up, higher numbers move it down.
To change the alignment which the plugin is adding as an inline style requires this CSS:
.wcj_product_wholesale_price_table th,
.wcj_product_wholesale_price_table td {
text-align: left !important;
padding-left: 0;
}
Thanks,
One more thing, I want to hide the original striked through price.
I found this code but it's not working:
add_filter('woocommerce_get_price_html', "xa_only_sale_price", 99, 2);
function xa_only_sale_price($price, $product)
{
if(!is_cart() && !is_checkout() && !is_ajax()){
if ($product->is_type('simple') || $product->is_type('variation')) {
return regularPriceHTML_for_simple_and_variation_product($price, $product);
}
}
return $price;
}
function regularPriceHTML_for_simple_and_variation_product($price, $product){
return wc_price($product->get_price());
}