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 );
Site URL: hidden Theme version: 8.1.2Hello,
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: €
The topic ‘add_action not showing up on product page’ is closed to new replies.
One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.