I try to add a option to hide the product stock info but only on certain single product pages. We do not want to hide this info for every product. We want to have a option in the product edit view where we can select if this should be the case for that current product. Unfortunately my code below is
Tag: woocommerce
WooCommerce database query : Get product category image path+name from thumbnail_id
I am trying to list all my Woocommerce Product Categories | category name | category slug | … | … | category image path+name | Using this query below, gets me most of the way: I have: From here I can’t work out how or where to JOIN the thumbnail_id to get my image path+name. edit: I have done a
Limit number of words in Woocommerce description (using php)
I edited my Child Theme’s functions.php to display the short description of my WooCommerce products under the product title. I had this code that works fine and limits the number of characters to 165, then adds “…” at the end of the excerpt. However, I don’t want the words to break after 165 characters. Therefore, I was wondering if there
Getting Shipping Address from WooCommerce Checkout Page?
i’m a little bit stuck. I’ve figured out how to retrieve the addresses assigned to a customers profile via the follow: But I can’t for the life of me figure out what the hook or whichever is required in order to get the shipping address that is being used for the calculation of shipping on the order checkout page. My
jQuery coloring table row if quantity is same
I have a table with order items, with a quantity input box and a field with the quantity that has been ordered. If the quantity input box has the same value as the quantity that has been ordered, I want it to color green. Now I have it working a bit, but my knowledge only goes so far. Somehow it
Show JS alert on a form php
I have the following php code, which is a wordpress hook to display an address autocomplete form on my website’s cart page. The function was written in functions.php file. I dont want the customer’s to enter their unit numbers or house numbers. As such, I want to display a simple js alert if a customer enters “/” charachter in the
wordpress redirect users to the same URL they request appending parameters according to role
I am working on a Wordpress website with multiple roles. My target is to redirect user with a specific role when they request pages like orders in the admin area to go to a filtered URL having their id. example: User requests: www.site.com/wp-admin/edit.php?post_type=shop_order This Applies only to the role “tester” My Approach was: Rewriting the code now gave me error,
Close modal when class is present, stay open with another
I have a modal from W3schools with a shortcode in it from a plugin (Product page shipping calculator for WooCommerce) that is the shipping calculator form from Woocommerce. On submit It checks for shipping methods available and if there are shipping methods available, print a message in a class that says shipping available and vice versa. The PHP responsible for
How to display category thumbnail on WooCommerce category page?
I created a WooCommerce category, added description and an image to it. There are some products in the category too. Looking at the category in frontend (/product-category/mycat/) I see category description and product images – but not a category image. I tested it with all default WP themes and with Storefront too – category image is in no theme visible.
Countdown For WooCommerce Products
I create function to get the date and turn it to countdown. This my function code: And this my javascript code which is in “countdown.js” file: This code works on single product page, but when I try this in the product archive, it only works on the first product and does not work on the rest products. I want each