Get variation attribute based on product ID in WooCommerce | woocommerce get product variations by product id

How to get product variations by product id woocommerce 5.x

To get Woocommerce product variations or attributes, we would have to pass product id first and a Woocommerce hook to implement. If we would call it before some actions have finished like ( woocommerce_init, woocommerce_after_register_taxonomy, and woocommerce_after_register_post_type ) then it would throw an error. Find product id in woocommerce In Woocommerce there are many ways …

How to get product variations by product id woocommerce 5.x Read More »

php if url contains | if url contains php | php check if url contains string | php check if url contains | php if url contains echo somehting

Check If URL Contains String with PHP8

Sometimes we have to redirect users based on a specific keyword in the URL. Trust me we can achieve this very easily in PHP. Here you would see the code in this post. Let’s assume the URL contains events. For example  URL: https://domain.com/events/lucknow <?php if (isset($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] === ‘on’ && $_SERVER[‘REQUEST_SCHEME’] === ‘https’ ) …

Check If URL Contains String with PHP8 Read More »