wc_get_product_terms() throws “Notice: Undefined offset: 0”
wc_get_product_terms() throws “Notice: Undefined offset: 0”
wc_get_product_terms() throws “Notice: Undefined offset: 0”
The problem with the sample code is that the query is reset before echoing the result. Instead follow the sample you linked to: $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => -1, ‘product_cat’ => ‘pyvo-v-pliashkah’ ); $products_query = new WP_Query( $args ); // output what you want wp_reset_query();
It looks like the page lives in the template parts of the theme folder. Can you locate product.page.php or content.product.php file? The easiest solution is navigate to the WordPress UI interface –> Pages –> “product page”, choose a feature image. This product image looks like a dynamic feature image you can easily change.
As LoicTheAztec commented, the post here Using custom bulk actions on admin orders list in Woocommerce 3 helped me to make the code for my plugin. Although it mentions that you should use the functions.php to make it work, I was able to implement it perfectly in my own plugin code. Thanks, Loic. I appreciate … Read more
Am I correct that you’re meaning products as in WooCommerce products? If so: Right before WooCommerce returns the related products for a current product(if you’re not on a product page you could define a post_id yourself). It uses a filter which you can hook into. $related_posts = apply_filters( ‘woocommerce_related_products’, $related_posts, $product_id, array( ‘limit’ => $limit, … Read more
There are probably print styles defined in your stylesheets. Look for @media print in your css, and write your own rules as such: @media print { img { max-width: 400px; } } etc…
Hot to edit WooCOmmerce dashboard?
As you can see from this file, find the file where your loop is defined, then create or copy over the template file for individual loop items to your theme folder. In the example from the link, this would be content-product.php, located inside the /plugins/woocommerce/templates folder. You can then fully customize the file to your … Read more
I found a solution using this plugin. It’s very easy. If you want to display the setup fee in your product description, use the following code: $id = get_the_ID(); $fee_name = get_post_meta( $id, ‘product-fee-name’, true ); $fee_amount = get_post_meta( $id, ‘product-fee-amount’, true ); echo $fee_name . ‘ – ‘ . $fee_amount;
You can create “add to cart” links for WooCommerce using this pattern on simple links: http://example.com/cart/?add-to-cart=<product ID>&quantity=<number of quantity> This example will work with simple products. If you want to use products with variations you need to add some more values to the URL like: http://example.com/cart/?add-to-cart=123&variation_id=456&attribute_pa_colour=black If you enter the slug of the cart page … Read more