variations

Add and save admin product variations custom field in Woocommerce

丶灬走出姿态 提交于 2019-11-29 15:57:08
So I've got the following code which makes me add a Barcode field to the Inventory Options of a product. Now I also want to add this to each variations so I can easily add Variation Products when I scan the Barcode of the product via the WooCommerce Point of Sale plugin. Here is what I got currently: // Add Barcode field in simple product inventory options add_action('woocommerce_product_options_sku','add_barcode',10,0); function add_barcode(){ global $woocommerce,$post; woocommerce_wp_text_input( array( 'id' => '_barcode', 'label' => __('Barcode','woocommerce'), 'placeholder' => 'Scan Barcode

Replace default “Select Option” text in Woocommerce variation attribute dropdowns by different custom ones

别说谁变了你拦得住时间么 提交于 2019-11-29 13:04:43
I am just starting out with Woocommerce and have a question about drop down select field for variable products. In woocommerce when nothing is selected on this dropdowns, "Select Option" text is displayed. I need each dropdown select field option to display a different text when nothing has been selected yet. I found this code which replaces the standard "Select Option" text with what ever I want, but it does to all dropdowns select fields. function custom_woocommerce_product_add_to_cart_text($args){ $args['show_option_none'] = __( 'Select Framed or Unframed Sizes', 'woocommerce' ); return

Add and save admin product variations custom field in Woocommerce

醉酒当歌 提交于 2019-11-28 09:47:03
问题 So I've got the following code which makes me add a Barcode field to the Inventory Options of a product. Now I also want to add this to each variations so I can easily add Variation Products when I scan the Barcode of the product via the WooCommerce Point of Sale plugin. Here is what I got currently: // Add Barcode field in simple product inventory options add_action('woocommerce_product_options_sku','add_barcode',10,0); function add_barcode(){ global $woocommerce,$post; woocommerce_wp_text

More efficient weighted Gini coefficient in Python

为君一笑 提交于 2019-11-28 03:49:32
问题 Per https://stackoverflow.com/a/48981834/1840471, this is an implementation of the weighted Gini coefficient in Python: import numpy as np def gini(x, weights=None): if weights is None: weights = np.ones_like(x) # Calculate mean absolute deviation in two steps, for weights. count = np.multiply.outer(weights, weights) mad = np.abs(np.subtract.outer(x, x) * count).sum() / count.sum() rmad = mad / np.average(x, weights=weights) # Gini equals half the relative mean absolute deviation. return 0.5

WooCommerce: trigger event after change of variation

戏子无情 提交于 2019-11-27 17:54:20
We use Woocommerce to sell colorboxes. Mostly the variable-product option is chosen. We added a modal dialog with a color palette, where the customer can chose a color from. This is next to the common dropdown of woocommerce. Problem is, when I pass the right SlugValue to the dropdown (after it gets chosen from palette) then the value in the dropdown is correct, but the event that need to be fired to publish the price doens't works. I already tried to fire the onchange event of the dropdown, but nothing happend. Can anybody tell me, which event needs to be triggered, and how? aprec any help!

Hide variation info from cart item title in WooCommerce 3+

試著忘記壹切 提交于 2019-11-27 15:47:45
Ever since we upgraded to Woocommerce version 3 our order confirmations are showing huge titles that include the variation detail. I don't like how it looks and it breaks some important functionalities in some custom-made plugins. Reference: Order Name Showing Variations since update to WC version 3 There is a filter that can be used to disable this data displaying in the title called woocommerce_product_variation_title_include_attribute_name from what I understand. But I have no idea where to apply the filter. Is there a quick way to apply the filter to change it back to display as it did

Move the variation price location in WooCommerce

被刻印的时光 ゝ 提交于 2019-11-27 09:38:35
I'm have started building an e-shop in Wordepress with WooCommerce plugin. I added some products with variations and I noticed that the price is displayed after attributes select fields. Is it possible to move the price between Title and short description as for simple products? The url of one product is: http://www.roubinisideas.com/test2/product/uncategorized/vintage/ Update (on January 2018) : avoiding availability repetitions (bug solved) This is possible and it's is based on this answer that I have maid: Here I have updated the jQuery code to take into account when a variation is set by

Replace price range handling default variation displayed price in Woocommerce 3

二次信任 提交于 2019-11-27 09:23:06
On our woocommerce website I am trying to update the displayed price based on the variations the customer selects from dropdown menus as shown here: I used a php function that had been submitted in another answer by LoictheAztec: Replace the Variable Price range by the chosen variation price in WooCommerce 3 add_action( 'woocommerce_before_single_product', 'move_variations_single_price', 1 ); function move_variations_single_price(){ global $product, $post; if ( $product->is_type( 'variable' ) ) { // removing the variations price for variable products remove_action( 'woocommerce_single_product

Pass the chosen product variations data into Contact Form 7 enquiry form

五迷三道 提交于 2019-11-27 07:03:43
问题 With WooCommerce, I use Contact Form 7 and Product Info Request plugins to add a form inside a single product pages, because I need a functionality that allow users to send an enquiry request about products (thought simple contact form). You can understand seeing this screenshot: All my product are variable product with variations (from attributes) . Is there any way to retrieve the selected variations by the customer and send it via contact form 7? For example : User select the color black

List of known “Safari on iPad” differences over “Desktop Safari”

我与影子孤独终老i 提交于 2019-11-27 06:03:54
In recently testing a web application on Windows/Mac desktop browsers - and then on an iPad I noticed various differences in Safari that I wasn't expecting. even though the version # is the same. I'd like to compose a list of those differences (for myself and others) to have as a developer reference. e.g. in Safari on the iPad iPad Safari takes full control of Select list/option styling iPad opens the onscreen keyboard when an input element receives focus, thus inline floating calendar widgets (and the like) may not work as expected (or need to be altered) iPad Safari doesn't support position