Pricing & Fee Rules – WC Fields Factory

Using WC Fields Factory we can add custom fields to the Woocommerce product page, where user can provide additional details (can choose additional options) while there are buying that product. which will be be carried over to Cart, Checkout, Order and Email.

What if you wanted to change the product price (or add custom Fee) based on user’s input. Well from V2.0.0 WC Fields Factory allows you to set Pricing & Fee rules, using which you can change the product price.

Single field can have zero or more Pricing and Fee rules.

Pricing Mode

There are two modes available to change the product price.
Add : This mode will add the given amount to the product’s original price.
Change : This mode will override (replace) the original price with the given amount.

Fee Mode

There are two modes available to apply custom Fee
All : Fee will be applied only once for the concerned Cart Line Item
Per Quantity : Fee will be multiplied by the Line Item Quantity and then applied.

Pricing & Fee rules can be configured only in Field Edit mode, Meaning when you are creating a new field you won’t be shown any option for Pricing & Fee configuration.

Once you have created the field and click on edit button on the field that you wanted to configure pricing & fee. Now you can see the second tab (Pricing Rules) on the factory view.

How to Setup

  • Expected Value : Specify (or choose) the values that has to be matched against User Value.
  • Operator : Choose the compare operator
  • Title : Pricing (Fee) Title, wchich will be displayed (if the rule are succeed) on the Cart, Check Out, Order as well as Email.
  • Amount : The amount that has to be added (or replaced) with the product price.
  • Mode : Pricing (Fee) Mode (see above)

Here is the list of supported operators.

Operators Rules
Equal To (==) Expected Value and User Value has to be equal (same). Applicable for both String as well as Numeric values.
Not Equal To (!=) Expected Value and User Value has not to be equal (not same). Applicable for both String as well as Numeric values.
Greater Than (>) User Value must be Greater than the Expected Value. Applicable only for numeric values.
Greater Than or Equal To (>=) User Value must be Greater than or Equal to the Expected Value. Applicable only for numeric value.
Less Than (<) User Value must be Lesser than the Expected Value. Applicable only for numeric values.
Less Than or Equal To (<=) User Value must be Lesser than or Equal to the Expected Value. Applicable only for numeric value.
Only Has These Let’s assume the expected option is “Red”.
If a check box group has 3 options (Red, Green and Blue) and if User selected only Red option (no other option has to be selected) then this rule will succeed.
Has Also These Let’s assume the expected option is “Red”.
If a check box group has 3 options (Red, Green and Blue) and if User selected options includes Red (User can also select other options) then this rule will succeed.
Any of These Let’s assume the expected options are “Red” and “Blue”.
If a check box group has 3 options (Red, Green and Blue) and if User selected only Blue option (User has to select either “Red” or “Blue” or Both) then this rule will succeed.
Days If user selected date is a one of these spedific day (sun, mon, tue, wed, thu, fri, sat) then this rule will succeed.
Specific Dates If user selected date is a specific Date, ( eg. 07-12-1985 ) then this rule will succeed.
Weekends Weekdays If user selected date is in week ends (or week days) then this rule will succeed.
Specific Date (Each month) Expected date is 07, 08.
If user selected date is either 07 or 08 (regardless of Month & Year) this rule will succeed.

Note: Expected value is the value specified by the store admin while creating Pricing (or Fee) rules.
Note: User Value is the value given by the end user for a particular field, while adding product to the cart.

Here is the list of supported field types for Pricing & Fee rules.

Field Type Supported Operators
Text Equal To (==), Not Equal To (!=)
Text Area Equal To (==), Not Equal To (!=)
Number Equal To (==), Not Equal To (!=), Greater Than (>), Greater Than or Equal To (>=), Less Than (<), Less Than or Equal To (<=)
Select Equal To (==), Not Equal To (!=).

Following operators are applicable only if the options are numeric (which will be determined automatically based on your options)

Greater Than (>), Greater Than or Equal To (>=), Less Than (<), Less Than or Equal To (<=)

Radio Equal To (==), Not Equal To (!=).

Following operators are applicable only if the options are numeric (which will be determined automatically based on your options)

Greater Than (>), Greater Than or Equal To (>=), Less Than (<), Less Than or Equal To (<=)

Check Box Only Has These, Has Also These, Any One Of These
Date Picker Days, Specific Dates, Weekends Weekdays, Specific Date (each month)
Color Picker Equal To (==), Not Equal To (!=)

Text, Number Text Area, Check Box, Radio & Color Picker Rules Configuration

Check Box Rules Configuration

Date Picker Rules Configuration

Leave a Reply

Your email address will not be published. Required fields are marked *

 

13 Comment(s)

  1. Marco December 14, 2017

    Hi Saravana
    Did you find any solution? I worked with Pricing type Change (Pricing Rules) and I found that it’s stable,
    then the problem continues with Pricing type ADD, this doubles the product price when update the shipping form.

    Thanks

  2. Marco December 9, 2017

    Hi Saravana
    still not resolved, however with the old version of the plugin worked well,
    if this is not fixed I would have to reinstall the old version,
    the problem with the old version is that I do not know how to add the fields with price.

    1. Saravana Kumar K December 10, 2017

      If you don’t mind, mail me your site admin credentials, I will try to resolve.

  3. Marco December 8, 2017

    I believe that the pricing rulers is not working properly after the last update

    1. Saravana Kumar K December 8, 2017

      Sorry for the late response, have you managed to solve.?

  4. Marco December 8, 2017

    Hi Saravana
    Another problem has already arisen, the price of the product is multiplied when calculating the shipping cost or updating the shipment, but when you go to checkout the cost is fixed.

    thanks

  5. Marco December 6, 2017

    Hi Saravana
    After the last update wcff still does not appear on the cart page, it only appears in the checkout
    I hope you can give me some idea to solve it
    Thank you

    1. Saravana Kumar K December 6, 2017

      Please make sure that your active theme has the following filters woocommerce_get_item_data & woocommerce_cart_item_name, Also if you have chance to look into your php error_log file, that would help us to narrow down the issue.

      1. Marco December 7, 2017

        Hi Saravana

        the scrip is not showing:
        script {
        display: none;
        }

        but where can I modify this?

        thanks

  6. Marco December 6, 2017

    Hi Saravana

    After the last update the wcff still does not appear on the cart page, it only appears in the checkout,
    I hope you can give me some idea to solve it
    Thank you

  7. Marco December 4, 2017

    Hi Saravana

    Thank you very much for the contribution.

    I just did the plugin update, but the WCFF not appear in the car only at checkup. Unfortunately this WCFF became incompatible with another plugin that I already use. I want to know if the WCFF can be back compatible since in the previous version I had no problem ?

    Thanks again

    1. Saravana Kumar K December 4, 2017

      Hi, sorry for that inconvenience, this is major update, so it might have some hiccups, which I am working on the subsequent release with fixes (which will be released today or tomorrow), in the mean time please let me know the other plugin that has compatibility issue.

      1. Marco December 5, 2017

        Hi Saravana
        the WCFF plugin came into conflict with the fancy product designer a t-shirt customizer plugin.
        On the other hand I would like to know if you can create a snippet that can obtain the data of the product selected by the client. Specifically hex color codes to change them by their respective names, to be shown in the shopping cart and in the checkout.
        Thanks

        Marco