Search doesn’t return anything

Might not be the real cause, but you have a JS error due to badly formatted JS – the following lines: <script type=”text/javascript”> jQuery(document).ready(function( $ ){ jQuery(“a[href=’#aiwoosearch#’]”).attr(‘onclick’, ‘parentNode.submit();’); jQuery(“a[href=’#aiwoosearch#’]”).attr(“href”, “javascript:;”); }); </script> Those quote marks are wrong “ & ‘ try ” & ‘ instead and test again with your JS console open in inspector.

Return product list based on current product attribute

So as @shanebp suggested you have to use tax_query it would also help if you use operator in tax_query. following is your code after make some minor changes; <ul class=”products-newo”> <?php $attributes = $product->get_attributes(); $pa_brand = $attributes[“pa_brand”]; $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 4, ‘tax_query’ => array( array( ‘taxonomy’ => ‘pa_brand’, ‘field’ => … Read more

Use PHP Class in WordPress functions

If you have defined the class MyCart directly in functions.php with your hooks. I’d expect for the following to work: // add action $cart = new MyCart(); function emdr_add_to_cart(){ $items = $cartClass->get_users_cart_contents(); // process items } add_action( ‘woocommerce_add_to_cart’, ’emdr_add_to_cart’); I might also add that duplicating the “state” of the users cart in 2 places is … Read more

I want to show cart items number if any or nothing, simple CART text

You’re already on the right track. Simply add conditional if 0 <?PHP $cart_count = WC()->cart->get_cart_contents_count(); $cart_count = $cart_count ? “({$cart_count})” : ”; // if 0, become empty string $cart_link = wc_get_cart_url(); $cart_button = “<a href=”https://wordpress.stackexchange.com/questions/378487/{$cart_link}”>Cart {$cart_count}</a>”; echo $cart_button;