product

Woocommerce - Remove the available product inventory number from the shop page

故事扮演 提交于 2019-12-10 10:23:11
问题 On the shop page that displays all the products in my e-commerce store, it's currently displaying the product count (inventory) number beside the name of the product as so: I found and tried to use this code: add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' ); function woo_remove_category_products_count() { return; } But it doesn't work because it removes the 'only 5 left in stock' notice on the individual product page and thats not what I need. Then I

Change default variation value for the same product according to the category woocommerce

匆匆过客 提交于 2019-12-10 09:45:41
问题 I'm working on a way to display default variations value for the SAME product according to the category he is. For example, I sell a card with option blue & red. When the user comes by the category ONE, I want the default value is blue. If he comes by the category TWO, the value will be red. I found a hook woocommerce_product_default_attributes , but I don't know how to use it . Note : It seems that woocommerce recognize only one category per product even if your product is in two category.

WooCommerce - Changing the number of product categories per row

怎甘沉沦 提交于 2019-12-10 09:44:44
问题 I'm using Woocommerce settings to show categories thumbnail on the initial shop page and then products and their thumbnails within them. I want to have that initial category page to display 3 thumbnails per row and the products page to show 5 categories per row. To display 5 products per row I've used: add_filter('loop_shop_columns', 'loop_columns'); if (!function_exists('loop_columns')) { function loop_columns() { return 5; } } This changes the thumbnails per row on the category page AND on

WooCommerce Variation Images not displaying

﹥>﹥吖頭↗ 提交于 2019-12-10 09:37:36
问题 On the single product page, when I select a color, the featured image doesn't change. WordPress has been updated to 4.6.1, WooCommerce to 2.6.2, and the Storefront theme to 2.1.2. I have deactivated all plugins except WooCommerce and am using the Storeront theme exactly as I installed it. I cleared all caches, cleared my browser cache (Chrome, latest version),and even went so far as to re-enter all variation images for a single product. Further testing hs yielded the same result. I have no

WooCommerce - Custom thumbnails and default fall back image placeholder

我的梦境 提交于 2019-12-10 09:36:51
问题 I just want to insert a wrapper to the woocommerce_get_product_thumbnail I can see that my wrapper appeared but It doesn't have a fall back image if there's no image. How do I output the default woocommerce thumbnail? This is my incomplete code: remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); if ( ! function_exists(

Dynamically calculate product price based on custom fields values when added-to-cart

大兔子大兔子 提交于 2019-12-10 06:58:14
问题 I found the code to add existing product: global $woocommerce; $woocommerce->cart->add_to_cart(16); But I need to add product, with price that determined by 2 inputs: Age Quality I calculate the product's price by the formula age*quality. I know it's possible to add product with variations, but it's so many possible variations. Is it possible to set the product price dynamically based on custom fields calculation values? Thanks 回答1: For the cart items (when product is added-to cart), is

Update all variations prices of a variable product in Woocommerce

别等时光非礼了梦想. 提交于 2019-12-10 05:03:41
问题 I need to get all variation id and update price in loop. Simple query and loop looks like: $params = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘product_variation’, ‘post_parent’ => $product->get_id() // tried $post-ID ); $variations = get_posts( $params ); foreach ( $variations as $variation ) { $variation_ID = $variation->ID; // tried $post-ID, $product->get_id() $regular_price=34; update_post_meta( $variation_ID, ‘_regular_price’, (float)$regular_price ); update_post_meta( $variation_ID

What is Scalas Product.productIterator supposed to do?

拥有回忆 提交于 2019-12-10 04:06:40
问题 Can someone tell me why I am getting different results when using Tuple2[List,List] and List[List] as my Product in the code below? Specifically I would like to know why the second value of the list of lists gets wrapped in another list? scala> val a = List(1,2,3) a: List[Int] = List(1, 2, 3) scala> val b = List(4,5,6) b: List[Int] = List(4, 5, 6) scala> val c = List(a,b) c: List[List[Int]] = List(List(1, 2, 3), List(4, 5, 6)) scala> c.productIterator.foreach( println(_) ) List(1, 2, 3) List

How to get sum of products of all combinations in an array in Python? [closed]

我的梦境 提交于 2019-12-10 00:35:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm using Python and I'm given an array like a = [1, 2, 3, 4] and I want to find sum of all possible combination multiplications like: For combinations of 1: 1 + 2 + 3 + 4 For combinations of 2: 1*2 + 2*3 + 3*4 + 4*1 . For combination of 3: 1*2*3 + 1*3*4 + 2*3*4 For combinations of 4: 1*2*3*4 And finally sum of

Magento2: REST API : Save Product Detail per store view not working

自古美人都是妖i 提交于 2019-12-09 10:40:15
问题 Using Magento2.1.0-rc1 Branch With Sample Data Using REST API catalogProductRepositoryV1 REF: http://devdocs.magento.com/swagger/index.html Get Key from Admin token API and use that key in POST /V1/products & PUT /V1/products/{sku} with parameter tried with both parameter one by one store_id=0 storeId=0 using following JSON { "saveOptions": "true", "product": { "name": "Test11_11", "sku": "TESTOPP_111", "attributeSetId": "15", "price": "10", "weight": "10", "status": "1", "visibility": "3",