Learn about advanced integration with Advanced Custom Fields ( ACF ) plugin. Display custom fields values inside labels and use fields data as conditions for labels displaying.
Advanced Woo Labels PRO ( AWL ) comes with full support for Advanced Custom Fields ( ACF ) plugin. This means that all ACF plugin fields content can be displayed inside product labels. Also you can use any ACF field as a display condition for labels.
Plugin supports following fields types of ACF: Text, Text Area, Number, Email, URL, Password, Wysiwyg Editor, Image, File, Gallery, Link, Post Object, Page Link, Relationship, Taxonomy, User, Select, Checkbox, Radio Button, True / False, Google Map, Date Picker, Time Picker, Color Picker.
Inside any labels it is possible to set any custom text to display. Also it is possible to set some text variables that contain some information related to the current WooCommerce product. With text variables you can display inside label information like product price, stock status, discount value, etc.
Also when using ACF fields it is additionally possible to display the value of each ACF field that was created for WooCommerce products.
To display any of your ACF field value inside product labels please follow these steps:
1. Open any of your product labels edit pages.
2. Find Label text option ( available only with 'Shape with text' label type ).
3. Set text variable. For example, if you want to display the value of your ACF field with name text
, then use {ACF:text}
.
4. Done! Now inside your shop current labels will display the value of text
custom field ( it it exists ).
Note that you can use several text variables inside one label. And also combine text variables with some custom plain text.
For each AWL plugin label it is possible to set display conditions that will describe when and where these labels must be visible. For example, we can display the labels only for products that have a certain category. Or only for products that are on sale. And so one.
With ACF plugin support additionally it is possible to set display conditions based on ACF fields value for each WooCommerce product.
How to set display condition based on ACF field:
1. Open any of your product labels edit pages.
2. Find Label conditions box and inside it choose ACF fields.
3. As the second parameter choose any of the available ACF fields. For example, we can use select
field.
4. Choose operator and field value. For example, we want to display current labels only for products that have a select
field value equal to green
.
5. Done! Now this label will be shown only for products that have ACF select
field value equal to green
.
The great power of label conditions is that you can combine them in AND and OR groups. So you can create complex and flexible logic behind label showing.