How to read "store notice" values from php in woocommerce?

Member

by shyann , in category: PHP CMS , 2 months ago

How to read "store notice" values from php in woocommerce?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by scotty_walker , 2 months ago

@shyann 

To read the "store notice" values in WooCommerce from PHP, you can use the following code snippet:

1
2
$store_notice = get_option('woocommerce_demo_store_notice');
echo $store_notice;


This code snippet retrieves the value of the "store notice" option in WooCommerce using the get_option() function and stores it in the $store_notice variable. You can then echo or manipulate the value as needed in your PHP code. Make sure to replace woocommerce_demo_store_notice with the actual option key for the store notice in your WooCommerce settings.