Hi,
I'm searching or trying to know how can I put the discount coupon for the first occurrence of each product in my cart let me explain what I want to do.
First we put
US$ 1.00 (one dollar) as the discount price in the coupon discount.
coupon discount = 1.00
And his code will be "b coupon".
In my example shop we have 3 products x, y and z, the quantity in my store of all products is the same 3, the price of
x is
US$ 3.00, of
y is
US$ 4.00 and
z is
US$5.00.
Product / Pricex = 3.00
y = 4.00
z = 5.00
Well, in my example cart I inserted some products and it brought to me this, before I have inserted the "b coupon".
Product | Quantity | Price |
x | 2 | 6.00 |
y | 2 | 8.00 |
| Total: | 14.00 |
Well, after that, I included my discount coupon in my cart and the result was:
Product | Quantity | Price |
x | 2 | US$ 6.00 |
y | 2 | US$ 8.00 |
| b coupon | US$ -2.00 |
| Total: | US$ 12.00 |
In this case my "b coupon" his value is
US$ 1.00 but it apply to each product in my cart, and because this the "b coupon" value becomes
US$ 2.00.Now I just wanted to know, is possible to do that with programing? Does anyone know an extension that make this?
Thanks.
I don't understand why a $1.00 discount coupon gives u $2 off?
what are your settings for the coupon?
What I want is a override or a plugin, something that make that.. I explained above gives me $2 because I want to create discount to the each products and not in the total value of my order.
In the virtuemart this not occurs, I need this because it's for a client.
#EDIT
The fact is that my client want to make discount for the first item of each product, in cart, so if you picked 2 products but they are the same product the discount will be only US$ 1.00 dollar, but if you picked 2 products and they are diferent products the discount will be US$ 2.00, same I having in virtuemart coupon settings this coupon value registred as US$1.00 discount for a limited day, the rule that he want is this.
Ah, so you DO want the discount off each product
VM coupons can't do this
perhaps http://awodev.com/documentation/awocoupon-pro can?
Hi,
Thank you, I installed the free version of the component and I make some adjusts, this component helped me a lot.
vm_coupon.php
foreach($coupon_row->cart_items as $product_id=>$row) {
$product_id = $row['product_id'];
if( ($coupon_row->function_type2=='product' && isset($coupon_row->productlist[$product_id]))
|| ($coupon_row->function_type2=='category' && !empty($coupon_row->cart_items_def[$product_id]['is_valid_category']))
) {
// I Changed it, to apply the percentage to do the discount off in only the first quantity of product in cart------------------------------
$coupon_value += round( $row['product_price'] * $coupon_row->coupon_value / 100, 2);
//$coupon_value += round( $row['qty'] * $row['product_price'] * $coupon_row->coupon_value / 100, 2);
}
}
if( $this->product_total < $coupon_value ) $coupon_value = (float)$this->product_total;
}
$_SESSION_coupon_discount = $coupon_value;
Thanks.