Conditions Archives - Plugin Republic https://pluginrepublic.com/support-categories/conditions/ WooCommerce Plugins Tue, 28 Mar 2023 11:40:19 +0000 en-US hourly 1 https://pluginrepublic.com/wp-content/uploads/2020/10/cropped-favicon-1-32x32.png Conditions Archives - Plugin Republic https://pluginrepublic.com/support-categories/conditions/ 32 32 Optimising calculations and conditions https://pluginrepublic.com/documentation/optimising-calculations-and-conditions/ https://pluginrepublic.com/documentation/optimising-calculations-and-conditions/#respond Wed, 28 Apr 2021 11:35:45 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=983144 If you have a large number of calculations or conditions, you might find that page performance is affected. If you find that the product page has slowed or is unresponsive, you can enable a couple of options. Go to WooCommerce > Settings > Products Add-Ons and enable: Note that these options are still in beta […]

The post Optimising calculations and conditions appeared first on Plugin Republic.

]]>
If you have a large number of calculations or conditions, you might find that page performance is affected. If you find that the product page has slowed or is unresponsive, you can enable a couple of options.

Go to WooCommerce > Settings > Products Add-Ons and enable:

  • Optimise calculations
  • Optimise conditions

Note that these options are still in beta so you should test your product page to ensure that it’s functioning correctly.

The post Optimising calculations and conditions appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/optimising-calculations-and-conditions/feed/ 0
Allow decimal places in condition values https://pluginrepublic.com/documentation/allow-decimal-places-in-condition-values/ https://pluginrepublic.com/documentation/allow-decimal-places-in-condition-values/#respond Wed, 01 Jul 2020 11:35:39 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=492359 If you set a condition against a Number field, you can define the step value for the condition value. By default, the condition uses whole numbers. If you want to use decimals, you can use the following snippet: Here’s how to use a snippet.

The post Allow decimal places in condition values appeared first on Plugin Republic.

]]>
If you set a condition against a Number field, you can define the step value for the condition value. By default, the condition uses whole numbers. If you want to use decimals, you can use the following snippet:

View this code snippet on GitHub.

Here’s how to use a snippet.

The post Allow decimal places in condition values appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/allow-decimal-places-in-condition-values/feed/ 0
Display global groups according to attribute or taxonomy https://pluginrepublic.com/documentation/display-global-groups-according-to-attribute-or-taxonomy/ https://pluginrepublic.com/documentation/display-global-groups-according-to-attribute-or-taxonomy/#respond Wed, 04 Mar 2020 10:57:51 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=279711 By default, global groups can be displayed depending on product category (as well as universally or by specific product). If you’d prefer to display global groups depending on product attribute or an alternative taxonomy, e.g. Brand, you can use the following snippet. Just enter the slug of the taxonomy you wish to use instead of […]

The post Display global groups according to attribute or taxonomy appeared first on Plugin Republic.

]]>
By default, global groups can be displayed depending on product category (as well as universally or by specific product).

If you’d prefer to display global groups depending on product attribute or an alternative taxonomy, e.g. Brand, you can use the following snippet.

Just enter the slug of the taxonomy you wish to use instead of product category. In this example, the plugin will allow you to choose specific Colour attributes:

View this code snippet on GitHub.

This is how to add the snippet.

The post Display global groups according to attribute or taxonomy appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/display-global-groups-according-to-attribute-or-taxonomy/feed/ 0
Display hidden fields as disabled https://pluginrepublic.com/documentation/display-hidden-fields-as-disabled/ https://pluginrepublic.com/documentation/display-hidden-fields-as-disabled/#respond Sun, 26 Jan 2020 12:31:01 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=231803 Maybe you want to display fields that would otherwise be hidden (because they’re conditional on another field’s value). This code snippet keeps all fields visible, but disables and greys out fields that are unavailable: Here’s how to add a snippet.

The post Display hidden fields as disabled appeared first on Plugin Republic.

]]>
Maybe you want to display fields that would otherwise be hidden (because they’re conditional on another field’s value). This code snippet keeps all fields visible, but disables and greys out fields that are unavailable:

View this code snippet on GitHub.

Here’s how to add a snippet.

The post Display hidden fields as disabled appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/display-hidden-fields-as-disabled/feed/ 0
Conditions https://pluginrepublic.com/documentation/conditions/ https://pluginrepublic.com/documentation/conditions/#respond Thu, 14 Feb 2019 15:19:57 +0000 http://localhost/pluginrepublic/?post_type=ht_kb&p=39269 WooCommerce Product Add Ons Ultimate allows you to use conditional logic to determine whether or not to display certain groups or fields. What are conditions? A simple example of a condition is to have two fields: Field A is a checkbox; Field B is a text field. You can set a condition on Field B […]

The post Conditions appeared first on Plugin Republic.

]]>
WooCommerce Product Add Ons Ultimate allows you to use conditional logic to determine whether or not to display certain groups or fields.

What are conditions?

A simple example of a condition is to have two fields: Field A is a checkbox; Field B is a text field. You can set a condition on Field B so that it only display when Field A is checked.

Group conditions and field conditions

If you apply conditions to a field, it will only affect that field.

If you apply conditions to a group, it will affect all the fields within that group.

Apply conditions to groups allows you to speed up your workflow. If you have multiple fields that will display or hide depending on the same conditions, you can place them in a single group and apply the set of conditions to the group.

Both field and group conditions are always dependent on the value of fields. You can’t set a group condition that depends on the status of another group. You can only set a condition (group and field) that is dependent on the value of a field.

Setting up a field condition

To create a field condition, you’ll need at least two Product Add Ons fields – one field that will display or not depending on the status of the other field. In the example below, we’ve created a checkbox field and a text field. We only want the text field to display if the user has selected the checkbox field.

To create a condition, click the ‘Add Condition’ button under the field that you wish to apply the condition to. We only want to display the text field if the checkbox is selected, so we create a condition under the text field.

This opens up a new set of dropdown fields. In the first field, you can choose either:

  • Hide this field if
  • Show this field if

Choose whether you’d like to hide or show the field if the condition is true.

Then, choose from:

  • All rules match
  • Any rules match

This field is only relevant if you have more than one condition.

Finally, you define the condition:

  • Choose which field will be checked as part of the condition – in our example, it’s ‘Checkbox Field’
  • Choose an operator: in this case, choose between ‘Is’ and ‘Is not’
  • Then define the value of the field that you’re testing

Types of operator

The ‘operator’ is how you connect your field with the required value. In the screenshot above, the operator is ‘Is’. In all, you can choose from the following operators:

  • Is
  • Is not
  • Contains
  • Does not contain
  • Equals
  • Greater than
  • Less than
  • >=
  • <=

Please note that only certain operators are available depending on the type of field that you are checking. So a checkbox field can only be checked or not checked. Therefore you can only choose ‘Is’ or ‘Is not’ as the operator.

Fields with numeric values can use ‘Equals’, ‘Greater than’, ‘Less than’, ‘>=’ or ‘<=’ as their operators.

Fields with multiple selections, like checkbox groups, will use ‘Contains’ or ‘Does not contain’ as their operator.

Field conditions based on quantity

You can also set field conditions based on the quantity of product. Instead of selecting a field, choose ‘Quantity’.

Field conditions based on cost

You can also set conditions based on the cost of the product. Instead of selecting a field, choose ‘Cost’.

Field conditions based on attribute

You can set conditions based on whether a certain attribute term has applied to the product. So if you have a ‘Colour’ attribute you can set a condition on a field to only display if the product has the ‘Red’ term applied for ‘Colour’.

Setting up a group condition

Group conditions are very similar to field conditions. Please note that you can’t use group conditions on global groups.

To add a group condition, click the ‘Add Condition’ in the ‘Group Conditions’ section.

You’ll see the same options as the field conditions above.

You can add as many conditions to a group as you like. You can only use fields from other groups.

Reset values for hidden fields

If you want to reset the value of a field when it is hidden by a condition, use the ‘Reset field values’ in WooCommerce > Settings > Product Add-Ons:

Conditions based on the selected variation

To set conditions based on the selected variation, please see this article: Variation-specific fields.

The post Conditions appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/conditions/feed/ 0