Hi I am trying to create a from that will change the shipping price based on specific item quantity.
X = Product 1 = 6 books
Y = Product 2 = 1 book
Z = Product 3 = 1 book
....
How can I access the X quantity? I am trying the :
add_filter("gform_product_info_1", "add_fee", 10, 3);
function add_fee($product_info, $form, $lead){
$quantity = $product_info["products"][1]["quantity"];
but I just can't figure how to get the quantity for that specific element.
And how to get form quantity and general as well.
I am trying to create something like this:
if ( X quantity > 1 )
{ total = (total + (X quantity* shipping cost)) - shipping cost;
}else {
if ( X,Y,Z quantity of the form > 6 ) {
total = (total + (X,Y,Z quantity/6)*shipping cost)- shipping cost;
}
}
So all I really need is the ability to access X quantity, and total form quantity.
Any help will be greatly appreciated.
Thank you.