product

Customize add to cart message in Woocommerce 3

╄→гoц情女王★ 提交于 2019-12-24 06:40:20
问题 I would like to change the '"[product name]" has been added to your basket' prompt to say 'x item(s) has/have been added to your basket'. This thread explains how to edit the add to cart message, but I cannot find any information about the variables which can be used. How can I show the number of products added rather than the name? 回答1: Since Woocommerce 3, the filter hook wc_add_to_cart_message is obsolete and it's now replaced by wc_add_to_cart_message_html… The function usable variables

Disable backordering for a specific user role in Woocommerce

佐手、 提交于 2019-12-24 06:38:34
问题 In woocommerce,I put my products on backordering with the backorder checkbox. Now that everything is on backordering, I want to disable backordering for normal customers (and let it be for other user roles such as wholesale_customer). I have the following code but when I add it as a plugin, I am unable to add something to my cart (I can push the add to cart button, but the cart stays empty): /*Single product page: out of stock when product stock quantitiy is lower or equal to zero AND

Replace specific cart item based on product quantity in Woocommerce

霸气de小男生 提交于 2019-12-24 06:37:14
问题 I am trying to change the cart content based on the quantity of a product in the cart. I only have 5 products in the shop: Product_1 => 1 panel, Product_2 => 12 panels, Product_3 => 18 panels, Product_4 => 30 panels, Product_5 => 60 panels, They are configured as different products, so no bundles, kits or anything. More than one panel products are obviously cheaper than adding a number of single panels separately. Then I have also a custom product that calculates the number of panels needed

Make columns sortable in admin products list panel in Woocommerce

有些话、适合烂在心里 提交于 2019-12-24 05:45:14
问题 I added the column with the highest value of the offer. And then I would like to make it sortable. I've prepared this: // asl this will add extra column in the product list add_filter( 'manage_edit-product_columns', array($this,'show_product_offers_amounts'),15 ); add_action( 'manage_product_posts_custom_column', array($this,'show_product_offers_amount_max'), 10, 2 ); // asl show the column function show_product_offers_amounts($columns){ $columns['orig_offer_amount'] = 'Amount'; return

Display product attributes on specific Woocommerce product category archives page

无人久伴 提交于 2019-12-24 05:19:10
问题 I want to show two attributes on the category pages, with the attribute name and value only on specific categories. This code that I found displays the labels of the attributes, but is duplicating the value and I am really struggling with a show if categories variable. Any help is greatly appreciated. The code: add_action('woocommerce_after_shop_loop_item','add_attribute'); function add_attribute() { global $product; $product_attributes = array( 'pa_set', 'pa_team'); $attr_output = array(); /

Add the discounted percentage to variable product price range in Woocommerce

人走茶凉 提交于 2019-12-24 05:10:39
问题 Using Woocommerce, I have successively removed sale badges and prices from product archives pages with the following code: // Remove Sales Flash add_filter('woocommerce_sale_flash', 'woo_custom_hide_sales_flash'); function woo_custom_hide_sales_flash() { return false; } // Remove prices on archives pages remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); All the products are variable products and all variations have the same prices. Also actually

getChildHtml(‘media’) returning blank in view.phtml magento

…衆ロ難τιáo~ 提交于 2019-12-24 03:25:59
问题 Till yesterday all was fine, all of sudden <?php getChildHtml(‘media’) ?> is not returning any html just blank in view.phtml. I checked catalog.xml file: <reference name="content"> <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml"> <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml" /> </block> </reference> Where else I need to check to make it run again? 回答1: Praveen,Please try

WooCommerce displaying variable description after variable price

半世苍凉 提交于 2019-12-24 01:09:51
问题 I'm trying to display the variable description into a woocommerce product page. I installed a plugin named woocommerce radio buttons, for displaying my variable products and prices as a radio button instead of a select. I am editing the variable.php file, in this plugin (then I will transfer it to my child theme once finished) and basically I need to show the variable description into a label, as a variable named $variable_description. printf( '<div> <input type="radio" name="%1$s" value="%2

Display parent grouped product name in Woocommerce orders details

岁酱吖の 提交于 2019-12-24 01:06:13
问题 For Woocommerce grouped products I am displaying parent product name in cart and checkout pages using the code bellow: // Adding the grouped product ID custom hidden field data in Cart object add_action( 'woocommerce_add_cart_item_data', 'save_custom_fields_data_to_cart', 10, 2 ); function save_custom_fields_data_to_cart( $cart_item_data, $product_id ) { if( ! empty( $_REQUEST['add-to-cart'] ) && $product_id != $_REQUEST['add-to-cart'] ) { $cart_item_data['custom_data']['grouped_product_id']

Odoo overwrite inherited method

半城伤御伤魂 提交于 2019-12-24 00:54:55
问题 Hi I'd like to overwrite the unlink() method from product_template which already has been inherited by the module point_of_sale. Now whenever I inherit this method I need to call the super function (so that the original unlink method within the Odoo ORM is called). But if I do this the unlink within point_of_sale is called first (inheritance chain). Any idea too interupt this inheritance chain and place my custom method instead of the point_of_sale > unlink method? I need this to ignore the