WP SITES

3082 Coded Tutorials & 284 Plugins

Add Fee Based on Quantity for Specific WooCommerce Products

$35.00

This PHP code targets specific products enabling the store owner to add a fee based based on quantity. In this example, the code targets a specific product and adds a fee of 3.60 to the cart totals for each item.

The fee is added to the cart totals and checkout page.

The fee is calculated using an PHP arithmetic operator * for multiplication, fee x quantity.

Code Installation

There’s only 2 steps :

1. Copy and paste the PHP code to your child themes functions file or custom functionality plugin.

2. Set your product id'(s) on line 15 and the fee per unit on line 28.

You can also modify the fee text.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Contact Us If You Have Any Questions

Go back

Your message has been sent

Warning
Warning
Warning
Warning.