WooCommerce — product Properties, how to add fields?

Hello!
How do you implement on WordPress+woocommerce this product?
5cfaabc5cbfd6760664542.jpeg
I reviewed the examples of shops on WordPress, there basically saw that the painted items below, most likely in the "Description of goods".
But editing the item because there are fields, width, height, length. Can we add more? For example, we don't need the height, better thickness. I would like to create the required items and then fill them in.

The problem is that a lot of goods, it would be possible to add all the features in the "Description", but the managers are very many errors happen. They need the points to register and characterization.
Tried plugins, but did not add items/fields in the edit product.
***
Now another question, if everything in one topic.

The greatest feature of the product:
5cfaad61e4d81303166939.jpeg
Something similar can be implemented? Again, that points to register in advance, and you only have to fill the field.
Like in two columns. But I don't know how to implement.

There is a plugin for TablePress. Works able. I think it may be used for such broad characteristics. Shortcode in the description of the product to deliver. But, paras. I would like them to register, and forget. Just fill it out and everything. To the Manager of less kosyachit. How it can be implemented? Certainly there are decisions, not all websites do with a standard width/height/length or stupid all in the description of casts and hundreds of times you write the same points.

Here, two questions. The plugin is bought Elementor, it did a product profile so as not to let WooCommerce. But there product was less and less updated. I do not ask questions about the editor extension product.

Now product a few hundred, the updates are constant.

Maybe even go for OpenCart, but there the plugins are paid, you have to know what you need for the task, otherwise will buy, will not work and what to do with it)
March 23rd 20 at 19:34
1 answer
March 23rd 20 at 19:36
Solution
well, the most simple, in the admin panel (the code) already have custom fields, just fill the key field and value
5cface54e3085086349627.jpeg

But you can handles if you love hardcore.

And you can do not to write a lot of code, it is ACF
5cfafebdcd1ab058774924.jpeg
There is no such.
Handles can if tell how. We thing to do) Hardkor will leave everything as it is and to each item to sign items, when it could be done at the site level to each item these items has been. And write less and work more interesting) - brayan9 commented on March 23rd 20 at 19:39
There is no such.
Is, just might be turned off out of sight. Check it out
5cfb822ac4018357928140.jpeg - robyn.King commented on March 23rd 20 at 19:42
Well, you can and handles if you want.
Googled these questions. Here for example how to add a new properties page, the Properties themselves remain as Metabola.

Although I would still accustomed to the ACF plugin, solves many routine tasks, for example will rid You of the admin-tion of the code, only the layout of the front.
Here's the plan:
1 - Add the desired fields, they appear in the admin interface and allow a Manager to conveniently change the values
2 - Create a plugin and in it write the layout of a new tab (how to do it can see the query above), and substitute the values of which the Manager has chosen in the fields of ACF.

Well, something like this. - robyn.King commented on March 23rd 20 at 19:45
@robyn.King, Thanks for the replies) do not know where to go, never meet)
In General, the Setup screen I immediately checked, there was nothing. Maybe some plugin is missing? Or the theme can be "break"?
here is the setup screen when editing a product:
5cfb947a88026942255865.jpeg
Setup screen when editing a page:
5cfb94f7a4f51997193605.jpeg
No. Looked everywhere in settings also did not see.

And about ACF. I have already put. But with some troubles. Namely, in the edit product field added. I wrote there what you need. But on the product page and in the store it does not display.
Here's the setup:
5cfb97a2bb6f2398582718.jpeg
YouTube looked to have done the same thing as me, thank you.
If recommend ACF, tell me one thing. We have a category of miscellaneous goods and they require radically different ready-made items to fill in. That is, the task to different categories of goods have been of your points. Using ACF, it can be implemented if you choose the type of recording "Taxonomy record" and there select the category? And then, add the desired item. Because in that case it would be a mess, for different categories of goods, a huge list of items, some of them which should not be there.
Thanks for the link. But if you earn the ACF and implement it? - brayan9 commented on March 23rd 20 at 19:48
1E - ALWAYS and EVERYWHERE in the names of slugs, use only English characters. On Your screen the name of the field "arbitrary" should be "proizvol".

ACF fields do not appear, they need to display handles, because code. For example (cast in functions.php). The hooks can be viewed here
add_action( 'woocommerce_before_add_to_cart_form', 'my_custom_action' );
my_custom_action function() {
the_field('proizvol');
}

Of course, the same field must be filled in the admin panel and the product is updated.
I had it so
5cfba09e23298295554261.jpeg
That is, the task to different categories of goods have been of your points.

Most likely it will not work. Think about it, when you edit a new product, where the admin may know to which category it belongs to. But that perhaps is the display of fields in admin interface for conditional logic. Ie create the first field (type select), fill it with types of goods and all other fields tied with conditional logic from the contents of the field. It turns out, when the Manager wants to fill in the characteristics of the product, he will first choose the type and depending on this it will seem to the ACC. fields to fill in. Well, in your code, also check that the selected and output fields respectively. - robyn.King commented on March 23rd 20 at 19:51
Cool!) Now the head is not cooking, it is necessary to cool a little. The decision sort of already clear. And if the example to show for a long time?
in your code, also check that the selected and output fields respectively

Probably last question, how to check?

And Yes, thank you. Hatched field!) Yay! The first victory is. Can you transfer a penny?)) Beer. - brayan9 commented on March 23rd 20 at 19:54
Watch the video for ACF. A lot of them in the net in Russian.
So offhand
add_action( 'woocommerce_before_add_to_cart_form', 'my_custom_action' );
my_custom_action function() {
 if (unit == get_the_field('type') ) {
the_field('pole_2');
}
}
- robyn.King commented on March 23rd 20 at 19:57
@robyn.King, Thank You. With the second question too. Output by type of product made.
Checking later, I will understand. I'm now not mastered.
Really appreciate it!:) - brayan9 commented on March 23rd 20 at 20:00
Please. - robyn.King commented on March 23rd 20 at 20:03
@robyn.King, There is still the question.
Write type of product:
5cfbceb8ab77b997047147.jpeg
On the page does not specify the item "View". Just impersonal "Commercial".
5cfbcf164918f025774913.jpeg
Looked in ACF. Did not see the ability to display a Label field with the data field.
It is possible to make the Label field is also mentioned?
Need
Type: Commercial - brayan9 commented on March 23rd 20 at 20:06
I don't know the answer to this question.
But, this is the field You do not have to change, and output it in the layout in plain text. Layout, You have a dynamic (well, with conditional logic) - robyn.King commented on March 23rd 20 at 20:09
print it in the layout in plain text

Have no idea how to do it. Can you give an example? Or in Google search? - brayan9 commented on March 23rd 20 at 20:12
Well, Dear, perhaps the weekend effect.
echo 'View:' . the_field('vid'); - robyn.King commented on March 23rd 20 at 20:15
@robyn.King, Oh yeah) Impact) Very tired) Need sleep already, and the problem is not solved. One thing after the second. When you will understand the mechanism and how to implement it, you can sleep) So I have done without you, I'll never know) You gave me invaluable help!:) - brayan9 commented on March 23rd 20 at 20:18
You gave me invaluable help!:)

It's like playing "hot potato". Got yourself, give to another. I try. - robyn.King commented on March 23rd 20 at 20:21
@robyn.King,
add_action( 'woocommerce_before_add_to_cart_form', 'my_custom_action' );
my_custom_action function() {
 if (unit == get_the_field('type') ) {
the_field('pole_2');
}
}

In almost all figured out, but here is the latest plugging. I hope that last)
Check that the selected and output fields on the product page for website visitors.
What should be instead of "the Second?"
Here is my code, without testing:
5cfd374cd8ccb104764563.jpeg
For each field you need to write code to check?

If the product fields in admin panel 20, and in functions.php I write for each field in your code to check?

This code validation:
add_action( 'woocommerce_product_meta_start', 'my_custom_action' );
my_custom_action function() {
 if ('Commercial' == get_the_field('type') ) {
echo 'View:' , the_field('linoleum_vid');
echo '<p>';
}
}

Not working)

If you are adding the code:
add_action( 'woocommerce_product_meta_start', 'my_custom_action' );
my_custom_action function() {
echo 'View:' , the_field('linoleum_vid');
echo '<p>';
}

And in admin panel product field "" blank, the page looks like this:
5cfd3d3755559246685908.jpeg
There's a "View".
If you write your code:
add_action( 'woocommerce_product_meta_start', 'my_custom_action' );
my_custom_action function() {
 if ('Commercial' == get_the_field('type') ) {
echo 'View:' , the_field('linoleum_vid');
echo '<p>';
}
}

Then the page "breaks".
5cfd3dc4c6bff701732700.jpeg
The whole bottom of the site disappears.

And if I understand correctly, we check if there is a "Commercial", the item is displayed. But if the Manager made a mistake or decided to write something new? It may be better to check the field on the filling at all? There's something there, output. Ideally would.

But while the verification code is not working. How to check the occupancy sales do not know. Probably check for an empty value. If empty - do not show. - brayan9 commented on March 23rd 20 at 20:24
Page break because You have all the examples with an error. After 'the View:' there should be a dot and not a comma. There conciencia lines. You have the logs to view , would have quickly put this syntax error.
The condition You have is correct. I checked the code before You write it. In this condition, and output all fields for type "Commercial" - robyn.King commented on March 23rd 20 at 20:27
After 'the View:' there should be a dot and not a comma.

Good day)
I put a comma, because then on the product page looks correct.
Type: Commercial
And if there is a point, then it will be so
Kommercheskie:

And check that I have not yet obtained. Little knowledge of code) I Think, maybe to create a separate topic? The initial question on the topic solved. Now the question is slightly different.

I have a detailed explanation of what it takes washes so it will be easier to understand me) Or I understand. - brayan9 commented on March 23rd 20 at 20:30
This is true if the answer to the main question received, the subject must be closed - robyn.King commented on March 23rd 20 at 20:33

Find more questions by tags WooCommerceWordPress