This topic has 3 replies, 2 voices, and was last updated 2 years, 7 months ago ago by Ruben Budding
I use the xstore with the product builder. only now I want to add an extra hook add_action above the add cart button. But this one doesn’t show up. what am i doing wrong here?
add_action( ‘woocommerce_single_product_summary’, ‘ts_you_save’, 11 );
Hello,
If you use the single product builder instead of the built-in layout then use one of the below hooks depending on your needs instead of the default WooCommerce hook
etheme_woocommerce_template_single_excerpt
etheme_woocommerce_template_single_add_to_cart
Provide us with WP Dashboard and FTP access if you still have a problem with that.
Regards
`Thanks thats works! 🙂 If there are other users this on product page: Save now would like to have hereby the code below
//Save now: Price %Discount
function ts_you_save() {
global $product;
if( $product->is_type(‘simple’) || $product->is_type(‘external’) || $product->is_type(‘grouped’) ) {
$regular_price = get_post_meta( $product->get_id(), ‘_regular_price’, true );
$sale_price = get_post_meta( $product->get_id(), ‘_sale_price’, true );
if( !empty($sale_price) ) {
$amount_saved = $regular_price – $sale_price;
$currency_symbol = get_woocommerce_currency_symbol();
$percentage = round( ( ( $regular_price – $sale_price ) / $regular_price ) * 100 );
?>
Save now: €
Tagged: add_action, not showing up, page, product, templates, woocommerce, wordpress
The issue related to '‘add_action not showing up on product page’' has been successfully resolved, and the topic is now closed for further responses