Exclude a Gift certificate from shipping rates


  • Default avatar
    ashcraft    
     a year ago
    0

    Any ideas how to exclude a Gift certificate from shipping rates? Im using a value based shipping module. Ive juts bought AWO Coupon Pro so am only just figuring this out so must have missed something? Right now if somebody buys a gift certificate product for say £20 postage is added to it in the checkout., postage must not be added to gift certificates. Joomla 1.5, Virtuemart 1.1.

    www.ashcraftframing.co.uk

    Thanks
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    If I understand correctly what you are saying, the gift certificates are being charged for shipping? If so, you should look into the shipping method to see if you can exclude products. Maybe setting the weight of the product to 0 might do it?
  • Default avatar
    ashcraft    
     a year ago
    0

    The shipping method is using price based shipping as all my items sold have variable weights depending on the length ordered and there is no (easy way) to predict the weight of an order. I'd like a way of flagging a coupon or gift certificate "exclude from shipping charges" . Right now I can't see away of getting round this to enable me to use gift coupons.
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    The only way is to code it. I assume you are using shipvalue which comes with Virtuemart 1.1.x? Since you provided ftp access, I have added some code that should do what you want.

    in www/administrator/components/com_virtuemart/classes/shipping/shipvalue.php, around line 35 is this:
    <?php
            
    if ( $_SESSION['auth']['show_price_including_tax'] != ) {
                
    $taxrate 1;
                
    $order_total $total $tax_total;
            }
            else {
                
    $taxrate $this->get_tax_rate() + 1;
                
    $order_total $total;
            }
    ?>


    Right after that, I added this:
    <?php
            
    # seyi_code
            
                
    $jdb JFactory::getDBO();
                
    $jdb->setQuery('SELECT product_id FROM #__awocoupon_giftcert_product WHERE published=1');
                
    $giftcert_product_ids $db->loadObjectList('product_id');
                
                require_once(
    CLASSPATH'ps_product.php' );
                
    $ps_product = new ps_product;
                require_once(
    CLASSPATH 'ps_shipping_method.php' );
                
    $cart $_SESSION['cart'];
                for(
    $i 0$i $cart['idx']; $i++) {
                    if(!isset(
    $giftcert_product_ids[$cart[$i]['product_id']])) continue;
                    
                    { 
    # get price

                        
    $my_taxrate $ps_product->get_product_taxrate($cart[$i]["product_id"], ps_shipping_method::get_weight($cart[$i]["product_id"]) * $cart[$i]['quantity']);
                        
    $price $ps_product->get_adjusted_attribute_price($cart[$i]["product_id"], $cart[$i]["description"]);
                        
    $price["product_price"] = $GLOBALS['CURRENCY']->convert$price["product_price"], $price["product_currency"] );
            
                        
    $product_price $price["product_price"];
                        if( 
    $auth["show_price_including_tax"] == $product_price *= ($my_taxrate+1);

                        
    $product_price round$product_price);
                        
    $subtotal $product_price $cart[$i]["quantity"];
                    }
                    
                    
    $order_total -= $subtotal// subtract it from the order total
                
    }


            }
    ?>
  • Default avatar
    ashcraft    
     a year ago
    0

    Wow!What can I say but Thankyou!!! I'll test it out later to make sure it works the way I need but I've had a quick play and yes, it does. That is really very generous and allows me to continue with implementing a marketing ide I have. Thank you again!
  • Default avatar
    ashcraft    
     a year ago
    0

    Unfortunately it doesn't appear to be working after all. I don't know if I have done something incorrectly in setting up the gift certificate but it's still adding postage. I'm sure it worked once when I tried it yesterday but since then I have deleted the original gift certificate and product and made new once, which now attract postage.

    Any ideas?
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    Can you pm me temp admin access to have a look?
  • Default avatar
    ashcraft    
     a year ago
    0

    Pm'd
  • Default avatar
    ashcraft    
     a year ago
    0

    nearly working for me. The only issue I see now is that when I create a gift card in awo I have to specify a value, I have specified 5. My product in virtue mart called gift certificate has options for 5, 10, 15 and 20 so if a visitor chooses the £20 option and pays £20 what the recipient gets is an image which say/ £5. I haven't tested any further ie to see how much is actually on the card.
  • Default avatar
    ashcraft    
     a year ago
    0

    5 on the card despite the sale value of the product being 20, so I guess Ill have to go for individual products for the different values of cards I want. That throws up another issue for me in that when I have attributes ( in this case the email, name, and message) my product is displayed as having a price of 'From nnnnn'. Instead of just 'Price'. This works ok thought the rest of the store where I need this as I have a lot of products where user selected attributes change the value of the product, however I'm dammed if I can recall where I can change that just for this product! it's not an AWO problem , but one I need to fix somehow.
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    When setting up the gift certificate in AwoCoupon, there is the option 'Price calculation type'. If you set this to base price or base price with tax, then the cost of the product will be used in the template.