Adding custom field to product category and show it to shop/category shop page
Adding custom field to product category and show it to shop/category shop page
Adding custom field to product category and show it to shop/category shop page
How to solve `Error getting remote image` in woocommerce rest api script?
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.
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
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 found what was the problem. the code with actions were wrapped bu this following code : global pagenow; if ( $pagenow === “edit.php” && isset( $_GET[‘post_type’] ) ){} When there is an ajax call, $pagenow === admin-ajax.php and $_GET === [ [“_fs_blog_admin”]=> string(4) “true” ] so that could not be fired.
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;
The problem was the nonce, answered by @Daniel Antunes here. Let me help you! Overwrite the parent method display_tablenav of WP_List_Table class removing the wp_nonce_field execution. /** * Generates the table navigation above or bellow the table and removes the * _wp_http_referrer and _wpnonce because it generates a error about URL too large * * … Read more
OK, if any body come across this question I managed to find better and workable solution. Before querying all the categories on sidebar I check if this is brand archive page and if yes I use wp_get_object_terms function, pass all product ids from wp query to get only needed categories. 🙂 In this way I … Read more
This is not really an answer to your code question but I solved this by creating the same product with a zero price and use that version as the free gift. However, I would like to know the code you used which works (without the price to zero part) because I only have a code … Read more