Free shipping and Coupons


  • Default avatar
    james_vir    
     14 years ago
    0

    Hi Again,

    More testing...My shop is set up to have free shipping on orders over $99.00. I set a coupon to 10% off the total order. Added 2 products totaling $108.00 applied the 10% discount code to get a total under 99.00...continue through the checkout and the system applies the free shipping b.c the subtotal is over 99.00 but the actual total is not. Not sure if this is something that can be resolved with the coupon system or will a hack in the vm core be needed?

    Thanks.
  • Your avatar
    seyi    
     14 years ago
    0

    how is it setup to receive free shipping? what shipping module are you using for this and what is your setup?
  • Default avatar
    james_vir    
     14 years ago
    0

    I'm using the VM store config and no shipping module. Would it be better to use a module for this?
  • Your avatar
    seyi    
     14 years ago
    0

    Then how do you charge for shipping?
  • Default avatar
    james_vir    
     14 years ago
    0

    The standard shipping module is used for a flat fee. Then in the store config I have free shipping over 99.00.
  • Your avatar
    seyi    
     14 years ago
    0

    Didn't even know virtuemart had that function. Learn something new everyday. For anybody else reading this and is as confused as I was, within Virtuemart, you can set a minimum order amount for free shipping by going into the admin section -> components -> virtuemart -> store -> "edit store" and updating the field "Minimum Amount for Free Shipping:"

    As to your specific question, you can implement the discount into free shipping check by editing
    www/administrator/components/com_virtuemart/classes/ps_checkout.php, around line 58, change
    <?php
    if( $vendor_freeshipping && $vars['order_subtotal_withtax'] >= $vendor_freeshipping) {
    ?>


    to
    <?php
    if( $vendor_freeshipping && ($vars['order_subtotal_withtax']-@$_SESSION['coupon_discount']) >= $vendor_freeshipping) {
    ?>
  • Default avatar
    james_vir    
     14 years ago
    0

    Thanks! I'll try this out now.
  • Default avatar
    james_vir    
     14 years ago
    0

    OK.

    Applied your code edit. This was the result

    Subtotal: $105.98
    Coupon Discount: - $11.98
    Shipping and Handling Fee: $8.95
    Tax Total: $12.22
    Total: $115.17

    Coupon was set for 10%. Shipping is NOT taxed. It appears the coupon worked the subtotal post coupon but also the shipping fee...

    Should be
    Subtotal 105.98
    Coupon at 10% -10.60
    Total 95.38
    Tax (13%) 12.40
    total without shipping 107.78
    plus shipping 8.95
    TOTAL 116.73
  • Your avatar
    seyi    
     14 years ago
    0

    actually the coupon discount is correct, it shows the discount including tax
    105.98 *1.13 = 119.75, 10% of that is 11.98

    even if you calculate it the other way, the discount is the same
    105.98*.90 = 95.382 * 1.13 = 107.78166; 119.7574-107.78166=11.975

    So something else is off.
    ......
    upon further research, https://awodev.com/blog/virtuemart-coupon-error-discount-before-tax is still a problem within Virtuemart 1.1.5, although it is claimed to be fixed. I installed a clean version of Joomla/Virtuemart 1.1.5 and ran a coupon through their system without installing AwoCoupon, and it is still off, although less off. Within the blog search for "On or around line 255 is this" and you need to at least run that fix. Not sure if there will be other fixes, but that one for sure.
  • Default avatar
    james_vir    
     14 years ago
    0

    Hi,

    I'm not sure i'm following you. I have set my store to apply coupon before tax and it works with your component nicely. When I apply the changes you suggest for a possible solution with the shipping the coupon value then further discounts the tax...
  • Your avatar
    seyi    
     14 years ago
    0

    the shipping discount change i posted earlier should not affect anything but free shipping. revert it back and test it some more. im pretty sure it will still be off.
  • Default avatar
    james_vir    
     14 years ago
    0

    Yeah you are right...

    Another

    Subtotal: $54.99
    Coupon Discount (10%): - $5.50
    Tax Total (13%): $6.43

    Total: $55.92

    I have tried to go throght editing the files but they 1.1.5 files appear different so I'm unsure what comment out and add and where...
  • Default avatar
    james_vir    
     14 years ago
    0

    Alright. I managed to get it the numbers to work. I have a coupon code set for 10 percent on the whole store. the coupon was being used against the shipping charge as well. So I went into the coupon, changed it to specific and hightlighted all of my products. Tested and it was alright. So it appears that a overall product coupon works against the shipping fee as well. Is this just my set up or are others finding this as well?

    Also, your change for the free shipping is now working as it should!
  • Your avatar
    seyi    
     14 years ago
    0

    Interesting fix. I dont think it is taking into account shipping for the discount because that would be 10.60+0.90=11.50. And you are getting 11.98 for the discount. Not too close. Still think the discount is as I explained above.

    I will take a look at this when i have more time, but for now, glad you got it working.
  • Default avatar
    carol8    
     14 years ago
    0

    I am having the same problem. I have setup the free shipping option in VirtueMart and AWO is providing the coupons and the free shipping is getting applied before the coupon is applied.

    Before I start editing code - exactly what did you do to fix this issue? It seems you changed the code line and did something else, but I cannot tell exactly what.

    I'm not a noobie, but I'm not fluent in PhP. Thanks for any assistance.
  • Your avatar
    seyi    
     14 years ago
    0

    me too, a little confused. I do not think I understand what your problem is. Can you be a little more specific?
  • Default avatar
    james_vir    
     14 years ago
    0

    Hi,

    I applied the fix provided by seyi...https://awodev.com/blog/virtuemart-coupon-error-discount-before-tax

    Then applied the change to the free shipping listed above. To make this work correctly with the coupon I have to make sure the option 'specific' is selected instead of overall. The overall option end up discounting the flat shipping fee.

    I have been checking orders and so far so good.