Coupon added to final price not base price


  • Default avatar
    petamazon    
     a year ago
    0

    Hello there,

    I use vm 2.6.10 with joomla 2.5.x and awo coupon pro.

    I have created a discount to a product category from inside virtuemart. Then i try to use a 2% coupon i created from your component and this discount is added to the final price not base price.

    How is that possible? How can i make the discount to apply to the base price and not already discounted price?

    Please answer me this as soon as possible because website is live!

    Thank you in advance
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    Not sure I understand.

    Firstly AwoCoupon will only discount what is there.

    So if for example a product normally costs $25 and within virtuemart you have discounted it to $10, if a customer uses a coupon that is worth $15, for that product only $10 would be discounted.

    Now I think what you are trying to say is you want the whole $15 to be discounted?
  • Default avatar
    petamazon    
     a year ago
    0

    What i say is this:

    Assume we have a product with base price: $100. Inside virtuemart calculations & taxes rules you put a 30% discount to the category that this product is in to.

    So, base price $100 and after default virtuemart calculation rules you have final price: $70.

    Now, assume that you create a coupon for 10%. At the moment, if you use the coupon, the discount is occured on $70 (final price) not $100 that is the base price
  • Your avatar
    seyi    
     a year ago
    0

    Ok, I understand now. So potentially you want to be able to discount more than is available. The above example I posted is also relevant if you created an amount discount. Here is a solution, but it would work for all coupons you create within AwoCoupon, so use it at your own risk:

    in www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php, around line 824 is this:

    <?php
                            $product_price 
    $this->vmcartPrices[$cartpricekey]['salesPrice']*(1+$billtaxrate);
                            
    $product_price_notax $this->vmcartPrices[$cartpricekey]['salesPrice']-$this->vmcartPrices[$cartpricekey]['taxAmount'];
    ?>


    Change to this:
    <?php
                            $product_price 
    = empty($this->vmcartPrices[$cartpricekey]['basePriceWithTax']) ? $this->vmcartPrices[$cartpricekey]['basePrice'] : $this->vmcartPrices[$cartpricekey]['basePriceWithTax'];
                            
    $product_price_notax $this->vmcartPrices[$cartpricekey]['basePrice'];
    ?>