Awocoupon: Shipping is added after using gift certificate (don't want that)


  • Default avatar
    rob650    
     4 years ago
    0

    Hello,

    I have a question about the shipping costs that are charged after using a gift certificate. I will try to explain the problem as good as possible.

    I have a gift certificate of €50. On my site you have free shipping when the total amount is €30, below that amount we charge shipping costs (€3,95).
    When the total amount of the basket is 75 euro before using the gift certificate I don't be charged with shipping costs. When I apply the gift certificate, I still need to pay €25 and then 3,95 is charged extra. I don't want that.
    I know that you can configure on the global settings when to calculate the discount code (before or after calculation taxes and shipping). But I want to keep this for "normal" discounts.

    I there a way to apply the shipping costs different only for gift certificates when they are used? So that the gift certificate code will be applied after measuring the shipping costs?

    Thanks in advance

    Rob
  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    You are using Virtuemart 1.1.x correct? In my testings I set
    - Free shipping amount to 50
    - Added an item that was 59.99
    - Used a gift certificate that gives 20 off
    And I received the free shipping, it sounds like this is the exact opposite of what you received, which is strange.

    In the post below, I give the solution of how to still require shipping after using a gift certificate/coupon code. Unfortunately the code does not track if it is a gift certificate or coupon so they are treated the same.
    http://awodev.com/forum/awocoupon/help-section/gift-certificates-and-shipping#comment-596
  • Default avatar
    rob650    
     4 years ago
    0

    Hello Seyi,

    The link you provided you is a solution for when you buy a gift certificate. This is solved for me. My problem is more when you uses the gift certificate.

    Strange that your shipping costs are measered differently. Maybe when you check out 'apply discount...' in adminstration -> configuration - Global Tab? doesn't matter (I think).
    http://www.okkie.be/fotos/example.jpg -> As you can see is the total amount before discount larger than 30 euro, so then you get free shippping. Now I used a gift card and is the total amount to pay below 30 euro, because of that shipping is charged. PS: That is what I want to keep.

    So maybe it is not possible to solve?

    I have an alternative but with another problem :-s. When I sent a gift certificate I also sent (manually) a coupon for free shipping. So the customer may have to use 2 codes to avoid shipping...
    But to allow this, I need to mark the checkbox: "activate more coupons" with a max of 2.

    Is it possible to allow only 1 coupon/gift certificate in combination with a coupon for free shipping. so it is impossible to use 2 "normal" coupon codes?

    thanks in advance

    Rob
  • Your avatar
    seyi    
     4 years ago
    0

    Hello Rob,

    I sent the wrong link, this was the link I meant to send:
    http://awodev.com/forum/awocoupon/help-section/free-shipping-and-coupons#comment-283

    This is where the calculation is done to find out if the order is worthy of free shipping. You may be right, there may be a difference if the discount is calculated before tax. In which case I would change the code to look something like this:

    <?php
    if( $vendor_freeshipping && ($vars['order_subtotal_withtax']+@$_SESSION['coupon_discount']) >= $vendor_freeshipping) {
    ?>


    For your second question about allowing only one coupon and multiple gift certificates, I recently wrote up a solution for this. Here is the forum post:
    http://awodev.com/forum/awocoupon/help-section/multiple-gift-certificate-mode-only#comment-3320
  • Default avatar
    rob650    
     4 years ago
    0

    Hello Seyi,

    Sorry for the late reply. I had some other issues :-). The code you referred to is made for awowoupon 2.0. I am running version 1.5.0 on this moment. Giving the possibility to user one coupon but multiple gift certificates is a good solution for me!

    The code is not usable for version 1.5.0, can you help where to change this?

    Thanks in advance

    Rob
  • Your avatar
    seyi    
     4 years ago
    0

    Hello Rob,

    For the one 1.5 version the code is the same, but the file is here:
    www/administrator/components/com_awocoupon/helpers/vm_coupon.php
  • Default avatar
    rob650    
     4 years ago
    0

    Hello Seyi,

    unfortunately I get an error: just above the basket after filling in a coupon code:

    Warning: implode() [function.implode]: Invalid arguments passed in /home/okkie/public_html/administrator/components/com_awocoupon/helpers/vm_coupon.php on line 59

    I can also fill in more than 1 "normal" coupon.
  • Your avatar
    seyi    
     4 years ago
    0

    by fill in,do you mean more than 1 normal coupon is discounted? What line did you add the extra code?
  • Default avatar
    rob650    
     4 years ago
    0

    No, I also get the error when I fill in the first coupon (gift or normal, doestn't matter). This is what I entered:
    <?php
            $number_of_coupon_codes 
    1;
            
    $sql 'SELECT * FROM #__awocoupon WHERE function_type="coupon" AND coupon_code IN ("'.$coupon_codes.'") ORDER BY FIELD(coupon_code, "'.$coupon_codes.'")';
            
    $db->setQuery$sql );
            
    $tests $db->loadObjectList();
            if(
    count($tests)>$number_of_coupon_codes$removecoupons array_slice($tests,0,$number_of_coupon_codes-count($tests));
            if(!empty(
    $removecoupons)) {
                foreach(
    $removecoupons as $r) if(($key array_search($r->coupon_code$coupon_awo_entered_coupon_ids)) !== false) unset($coupon_awo_entered_coupon_ids[$key]);
            }
            
    $coupon_codes implode('","',$coupon_awo_entered_coupon_ids);
    ?>


    Added this after the line:
    <?php
            $coupon_codes 
    implode('","',$coupon_awo_entered_coupon_ids);
    ?>
  • Your avatar
    seyi    
     4 years ago
    0

    so your coupons are just not working anymore?:

    If you take out the code does it work?

    think you should start with a fresh copy of vm_coupon.php
  • Default avatar
    rob650    
     4 years ago
    0

    When I take out the code the coupons are working. But even with the error the coupons are working (without limitation, so 3-4-5 coupons are possible).
    Gift certificates are also working.

    But the errorline is offcourse not so nice.
  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    I have tested the code for awocoupon 1 and it works fine for me. I do not get any errors with or without the extra code. With the extra code, it allows me to add multiple gift certificates and only 1 coupon. So I would say look at the insertion again. You are not adding the <\?php and ?> tags in the code are you?