woocommerce: how to add new fields to variations form and show them on frontend - woocommerce

using last versions of wordpress, woocommerce and cheope (theme).
the question: how to
add some extra fields in variations form (text and image field types)
show them on frontend so that their values change accordingly on changing of attributes-select values.
e.g.: the site sells candles and uses variable products, for each kind of candle has several dimensions (with specific different prices), each of which has different duration.
The duration is an important element that I want the user to be informed about.
The same to show the available colors all together.
Unluckily in the standard variation form there is no field where I can insert these or other features.
some help please?
updated 07-August-2013
I succeeded in adding to variations form a new field displayed on back-end, as you can see here, by inserting the code you can find here (please see the comments too) in the function.php file of the theme.
Now, what I’m not able to do is get this field to display with each proper value on front-end (please take a look to the last comment in the above linked page).
Any tip or trick?
thanks

1)Add product attribute and check checkbox Used for variations and Visible on the product page
2)go to variations and add new and fill all fields price and stock must add on them
Your producr display variations and their data

Related

Make woocommerce product attribute unremovable?

I have a problem with my Woocommerce. I use my supplier's plugin which very regularly and automatically updates the stock and price of my products. I can, on my supplier's site, request that the product updates of their API linked to my site via their plugin do not erase the titles and descriptions of the products (I modified some of them after adding them ).
Problem: I must add to my products an attribute (example "Color") which is not assigned to them by default (they have two but it is not "Color".)
I can add this attribute to them and define a particular color for them, but when they are updated by my supplier, it overwrites the attributes that were not on my basic products (here the "Color" attribute) .
I wish I could tell their API not to overwrite it, like title or description, but they don't know how to do that..
Do you have an idea ?
I got a start of the trail thanks to this page: https://datafeedrapi.helpscoutdocs.com/article/44-prevent-attributes-from-being-overwritten-during-product-set-updates but the code is for THEIR API and so that the value of an attribute is not erased. For me, it's the ENTIRE attribute that I want to preserve..
Thank you !

Woocommerce show product combination without selecting all combinations

I'm developing an e-commerce using Wordpress and I'm having a problem with product variations. I have about 40 photographic works
and each of them has different options:
print support
frame color
dimension
Currently only if a user selects all the choices the image is updated and a price is displayed based on the choices.
I would like a user to see the updated image and price even by selecting one or two of the options.
Is it possible to create a product variation by setting only one or two variations?
Here is a sample product that I would like to change already from the first or second choice of the user. (at the moment the image and the price are updated only by setting all three variations).
product link -> https://www.italiansummer.it/product/addaura/
Thanks in advance for any help
Try using the gravatar form plugin.

How to change display of variable products on Woocommerce archive-product page

I am using the Storefront theme (downloaded a few days ago so newest version) and I want to do something quite simple:
on the archive-product page I want to display the product name of a list of variable products (all shoes) , along with two custom fields that I attached to the product post type.
All goes well with simple products. I can edit that which is shown through my theme-child folder/woocommerce/loop/price.php.
My issue appears as soon as I turn a product into a variable product. When I do that, the custom fields disappear, and all I see beneath the product is a button that says "select option"
I have been looking for hours to find the correct template/hook to fix this but I just cant find it...
I have no idea where to look :( Hope ome

Woocommerce: Customizing the availability of a category

I have many products nested within parent categories in WooCommerce.
I want to be able to apply a custom field where I can specify a time availability for categories as a admin feature only in Back end.
Theory:
Back end - On each parent category I will have this custom field where I can type or choose a time frame: for example 11:00-17:00.
Front end:
During this time frame, users will be able to browse all the products within that category.
Outside of this time frame all the products within that category will stay visible (but inactive) and they will be displayed greyed out or with a 'closed' banner (something like that).
Where can I start with this?
THE BEGINNING
You can start adding 2 plugins to add a custom time picker on product categories admin pages:
Advanced custom fields (ACF) plugin
Date & Time Picker for Advanced Custom Fields or also Date and Time Picker Field
This is just he beginning (and I can't confirm that is the best way). So In ACF you create a group and you name it:
Then you set the location (It's going to be a "taxonomy term" for "Product categories"):
Then In options you can chose it like a Metabox on the side (on backend):
After you add a new field and name it. You chose the field type and time only option:
[
Then now you are going to compile all the other options to fit your needs. Then you can save and add, if you need a 2nd field…
Now if you go to the WooCommerce Products Menu, under categories submenu, you will get this:
Now you can read a little the ACF documentation and also the wooThemes/woocommerce dev. documentation too.
You can customize WooCommerce overriding the templates and use hook filter and actions.
You will find in here on Stack OverFlow and over internet a lot of code, examples and tutorials, to begin and try to achieve your project. When needed you will post questions to get helped, with the code you are using telling what is working and what not…

What's the best the approach to add an extra attribute field in Drupal Commerce?

I'm using Drupal Commerce and i have a product type called "Painting" this product type does not have an attribute fields, I'm using inline_entity_form module so i can show the product add form within the node add form for my product display content type.
The product in the site is the painting itself, it may come with a frame or without a frame (the user can choose) and the price will change based on the user's choice, how can i add such field without using attributes fields? as attributes fields requires that the site admin to add many products and put them in one product display, i just want to keep it simple to the site admin, to make him add the product in the same way he adds a node.
Thank you.
This sounds like you just need two variations:
Product one, without frame
Product two, with frame
Each variation has it's own price and title.
You can get by without using an attribute field. Drupal Commerce renders a dropdown when there are no attributes and allows user's to pick from the product variation titles. Since you are using Inline Entity Form this should be seamless for the site admin.

Resources