O
O
Olivia Samokhvalova2020-07-18 17:35:05
WordPress
Olivia Samokhvalova, 2020-07-18 17:35:05

How to make labels (labels) for products in the Advanced Custom Fields plugin?

Using the "Repeater" field type, I made it look like a product catalog so that a person can add them to the site, but we also need to make it look like tags on the product page so that a person clicks on a tag and he displays all the products associated with this tag, like this implement using Advanced Custom Fields ? Displaying labels using wordpress is not an option, only using ACF

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2020-07-18
@Olivia5

Hello!
It's not a good idea to use ACF to add labels. Labels (tags) by default in VI are taxonomy. You can create your custom label taxonomy and apply it to Wooocmmerce (use for product post type) or you can apply it to any post type you specify.

Displaying labels using wordpress is not an option, only using ACF

Why not an option? Well, that's exactly what you need to do.

Using the "Repeater" field type, I made it look like a product catalog

Not the best solution. In a good way, a separate product is a separate entry in the database. For example, a custom record type stored in the database. If the user on the site will have a bunch of products, then adding and removing these products on the site will be another task. I'm not talking about the fact that sometimes after updating the ACF, the field settings can crash and it will take a long time to debug the code.
As for ACF, here's the solution... as a crutch for me, but given the question asked...
create a checkbox field type and set the desired number of labels in advance. When adding a product, the user selects a label. The label is added as a meta field and then you implement sorting on this meta field. The solution is so...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question