# Rounding up Order total using X-Feepro

If you want to round up the final using X-Feepro, you have to do following:

1. You must set the `Sort Order` value to X-Feepro to a value that is closer to `Total` so that X-Feepro displays just before the final Total

2. Now Create a Fee/Discount and name it whatever you want e.g. Rounding Up

3. In the `Price-Setting` tab, On the Final Equation Field, Enter following Equation:

{roundedGrandTotal} – {grandTotal} > 0 ? {roundedGrandTotal} – {grandTotal} : ({grandTotal} – {roundedGrandTotal}) * -1

# Creating Complex Discount using X-Feepro Equation

### Buy two and get third one free.

• In the price-setting tab, Select the `Fee/Discount By` to `Quantity`
• Now add a quantity range as like the screenshot

• On the `Final Equation` field, please enter one of the following equations

If you want to apply the discount to the least expensive product,

-{priceAscByNoOfBlock}

If you want to apply the discount to the average price of the products,

-({subTotalAsPerProductRule}/{quantityAsPerProductRule}) * {noOfBlock}

If you want to apply a discount equal to the lowest product price,

-{lowest} * {noOfBlock}

That’s all

### Buy two at a fixed cost of \$100

• In the price-setting tab, Select the `Fee/Discount By` to `Quantity`
• Now add a quantity range as follows as like the screenshot
• On the `Final Equation` field, please enter the following equation

{noOfBlock} * 100 – {blockPriceAsc}

That’s all

• In the price-setting tab, Select the `Fee/Discount By` to `Flat Amount`
• On the `Final Equation` field, please enter the following equation

@{anyProductQuantity} >= 2 ? -{anyProductPrice} * {anyProductQuantity} * 0.1 : 0

That’s all

(P.S: if you find any problem, please replace the dash with a minus sign in the equation as HTML replaces the minus sign to a dash that may cause a problem)

# Using of AND group mode in xfeepro

I do not know how to configure it.
What I need is below:
If shopping cart include any product in category A, a discount is based on percentage of  all  Category A products.
For example:
Category A include Product I of \$10, product II of \$5.
Category B include product III of \$30
If shopping cart include
2 Product I (category A):   2*10
1 Product III (category B): 1*30
Then discount= percentage of 2*10
Could you explain to me how to setup this rule?
Thanks for contacting and using xfeepro.
Configuring conditional logic is bit complex. But this can be achieved by Group mode option. Group mode option can be found under general setting tab. Fee having same Sort order  value will consider as a group. Sort order field can be found under general tab of each method.
For conditional mode, you will have to choose Group mode is AND. Now if you create two methods and assign same sort order value, those two methods will act as a group and one method won’t be appeared unless other method become valid. Noted that in group mode AND, price will be calculated from first fee, remain fees will be used just for other condition validation.
Lets start configuration:
First, under General Setting tab, Select Group mode is AND
Since you need to calculate cost based on category A, so we will create that fee first and then will create the other fee that will be just used for validating category condition.
First fee for category A
———–
1. Create a new fee and enter a name
2.  Under General tab, enter sort order value is 1  [Or whatever but need to be entered same value into the the fee so grouping can work]
3. Under Product/Category Tab, select Category Rule is “Any of the selected categories with other”. Then choose your applicable categories for which you want to offer discount. In your case these are Category A
4. Under Price setting tab, Select Rate type is Flat and enter your discount percentile into fee cost. For example: 5%
5. Now in the same tab, Select “Percentage related to” is “Sub-total Fee specific” .   [Sub-total Fee specific ensure that xfeepro would consider the products of chosen categories only]
First fee for category B
———–
1. Create a new fee and enter a name
2.  Under General tab, enter sort order value is 1  [This must be same as previous one]
3. Under Product/Category Tab, select Category Rule is “Any of the selected categories with other”. Then choose your conditional categories In your case these are Category B
Keep other setting as their default. Since this will be used just for category conditioning thing.

# Fee is not appearing in spite of correct setting in xfeepro

Cause 1 –  Ordering of xfeepro is not correct

Xfeepro is an order total module.  Opencart calculate fee/cost of the order total module based on their ordering  defined in Admin ->Extensions -> Order Totals. Ordering number of the xfeepro should be in between Sub-Total and Total for appearing correctly.

Cause 2:  Custom checkout module

Xfeepro has been tested with quick checkout, one page checkout module. However, it might not work due to custom works or other checkout module.  This issue can not be solved without checking. It might be needed ftp or store admin login to resolve. Please contact at opencartmart@gmail.com for free support.