-
pro123
Hi Team,
I would like to execute the PHP code below on the WooCommerce product and category pages and exclude this PHP code from the shopping cart.
When performing this php within the hook, the site crashes. Can you maybe advice, please?
Settings:
Hook: woocommere_before_main_content
Location: Products & Product Category
Exclude: page: cart
Php:<?php
function codeAstrology_remove_wc_currency_symbols( $currency_symbol, $currency ) {
$currency_symbol = ”;
return $currency_symbol;
}
add_filter(‘woocommerce_currency_symbol’, ‘codeAstrology_remove_wc_currency_symbols’, 10, 2); -
Hi there,
The hook element can only accommodate PHP code that run on the front end, and output content on the front end.
This kind of code runs in backend before the page load, it needs to be added to your child theme’s
functions.php
or a plugin like Code snippets. -
pro123
Okay, clear thanks!
-
You are welcome 🙂
- You must be logged in to reply to this topic.