Add html link in functions.php files of the theme

You are missing a closing tag for the opening link (<a>) tag, try: function filter_woocommerce_checkout_must_be_logged_in_message( $message ) { $message=”<span>You must be <a href=”#”>logged in</a></span>”; return $message; } add_filter( ‘woocommerce_checkout_must_be_logged_in_message’, ‘filter_woocommerce_checkout_must_be_logged_in_message’, 10, 1 ); (You could also just spit out the login form right there instead of linking off, if you wanted): function filter_woocommerce_checkout_must_be_logged_in_message( $message ) … Read more

Can’t fetch Custom Post Type Data through Custom Query

Changing my query to following worked for me. I removed the product ID field & called the post taxonomy directly as I didn’t need the product Id’s. <?php $args = array( ‘post_type’ => ‘colorshades’, ‘fields’ => ‘ids’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘colors_product_id’, // ‘value’ => $product->id, // ‘compare’ => ‘=’, … Read more

Switch to user link

Here is tested code: add_action( ‘woocommerce_admin_order_data_after_billing_address’, ‘display_admin_switch_user’, 10, 1 ); function display_admin_switch_user($order){ $data = $order->get_data(); // The Order data $user = $order->get_user(); $user_id = $order->get_user_id(); if ( method_exists( ‘user_switching’, ‘maybe_switch_url’ ) ) { $url = user_switching::maybe_switch_url( $user ); if ( $url ) { printf( ‘<a href=”https://mysite.sk/plugins/user-switching/%1$s”>Switch to %2$s</a>’, esc_url( $url ), esc_html( $user->display_name ) ); … Read more

Woocommerce inventory [closed]

The woocommerce_checkout_order_processed hook is too late. The order has already been created. You’d probably want to hook into woocommerce_after_checkout_validation so that you can check for the inventory before the order is even triggered and set an error that will be displayed at checkout. By hooking in here, you will be able to short circuit the … Read more

How to replace WooCommerce Product Gallery Trigger icon using PHP/CSS? [closed]

Its more of a hack than actual solution. But, I am using it in a lot of themes without any issues. .woocommerce div.product div.images .woocommerce-product-gallery__trigger { visibility: hidden; } .woocommerce div.product div.images .woocommerce-product-gallery__trigger::before { visibility: visible; } .woocommerce div.product div.images .woocommerce-product-gallery__trigger::after { visibility: visible; } Please note I have removed the my styling from these … Read more