stock

Hide out of stock products only on shop archive pages in Woocommerce

戏子无情 提交于 2019-11-27 08:10:35
问题 I am trying to hide out of stock products only from Shop page, but keep them on the separate category page. Woocommerce settings allows only to choose either to show out of stock products or to hide them completely. How to hide out of stock products only on shop archive pages in Woocommerce? 回答1: Updated: Using a custom function hooked in woocommerce_product_query_meta_query filter hook, targeting non "out of stock" products on shop archive pages only: add_filter( 'woocommerce_product_query

importXML Parse Error

牧云@^-^@ 提交于 2019-11-27 06:27:34
问题 I need to parse balance sheet data for a given set of stocks on otcmarkets.com. I'm trying to use the importXML function in Google Spreadsheet, but it is not returning any data for me. The xPath query did not return any data. Here is the function I'm using: =importxml("http://www.otcmarkets.com/stock/AAEH/financials","//*[@id=’totalCurrentLiabilities’]") Let me know what I'm doing wrong and if there is a better way to parse specific balance sheet data. 回答1: The page contents are loaded using

How to add variation stock status to Woocommerce product variation dropdown

╄→гoц情女王★ 提交于 2019-11-26 07:50:25
问题 I would like to show the stock status (eg. In Stock / Out of Stock) for each product variation shown in the drop down list of variations on the Woocommerce Product Page. I have copied the relevant function to my theme\'s functions.php file, and can edit the content, but am unsure how to pull out the required stock status for each variation. // Updated Woocommerce Product Variation Select if ( ! function_exists( \'wc_dropdown_variation_attribute_options\' ) ) { /** * Output a list of variation