Announcement

Collapse
No announcement yet.

Free Carriage with Coupon

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Free Carriage with Coupon

    I am failure sure you cannot trigger free carriage based on a coupon.
    Can anyone confirm I am right -
    OR
    Tell me how to do it.
    Been here before with earlier versions and don't believe things have changed - currently using V10 - plan to upgrade in new year.

    Thanks
    David Cunningham

    www.truska.com
    -----------------------------
    ECommerce (SellerDeck) & Web Design, Hosting, Search Engine Optimisation, Social Media and Remote Backup (Truska Backup)

    #2
    I have had off-line confirmation this can not be done
    Have added to the Wish list - if your site/clients would benefit from this why not add to or support the wish list post. I know quite a few of my clinets would use the feature - http://community.actinic.com/showthread.php?t=51872
    Regards
    David Cunningham

    www.truska.com
    -----------------------------
    ECommerce (SellerDeck) & Web Design, Hosting, Search Engine Optimisation, Social Media and Remote Backup (Truska Backup)

    Comment


      #3
      *raises hand*

      I would appreciate this too, although adding a further request that it would be possible to limit the coupon by region / delivery zone as well.
      www.kustompcs.co.uk

      Comment


        #4
        A little bit of Hactinic

        I have found a solution to this, it is certainly early days, probably full of issues but something for the community to work with.

        1. Create a Cart Based Discount called 'Free Delivery'

        2. Set it to be based on a COUPON CODE of 'FREEDELIV' (i guess anything else here should still work but just set a trigger)

        3. Open up ShippingTemplate.pl from the shipping control folder and search for 'return(SetDefaultCharge());'

        You should see the following function

        Code:
        if($::s_sDeliveryCountryCode eq $ActinicOrder::REGION_NOT_SUPPLIED)
        		{
        		return(SetDefaultCharge());
        		}
        immediately after this function paste the following

        Code:
        # Trying for freedelivery off coupon
        	if($::g_PaymentInfo{'COUPONCODE'} eq 'FREEDELIV')
        	{
        		my @Response = ActinicDiscounts::ValidateCoupon($::g_PaymentInfo{'COUPONCODE'});
        		if ($Response[0] != $::FAILURE)
        			{
        				return(SetFreeShipping());
        			}
        	}
        4: Save the ShippingTemplate.pl, Upload and apply the coupon within your Cart

        Fingers Crossed. Seemed to work for me
        Last edited by mediacat; 13-Dec-2011, 01:11 PM. Reason: Needed to Change Code as Coupon didnt need to be enabled
        Ben Adcock
        Caged Fish Web Design

        Comment


          #5
          That looks like a very clean solution. Thanks.

          Mike
          -----------------------------------------

          First Tackle - Fly Fishing and Game Angling

          -----------------------------------------

          Comment


            #6
            The original code i posted above would work even if the coupon was disabled. Have ammended it now to validate the coupon before applying the free delivery
            Ben Adcock
            Caged Fish Web Design

            Comment


              #7
              Nice work!

              I'll be trying this soon too
              www.kustompcs.co.uk

              Comment


                #8
                This is one for the KB I think.

                Comment


                  #9
                  Great stuff mediacat; works a treat.

                  Quick question - as we will be using different codes for each mag we advertise in (Vogue would have one code and Instyle another etc) how would I enter an array of coupon codes to test against?

                  Appreciate any help!
                  The Pretty Dress Company

                  Comment


                    #10
                    Meden

                    Simplest(laziest) way is to repeat my code for each coupon.
                    However, i'll try and modify this today to work with an array for you.
                    Ben Adcock
                    Caged Fish Web Design

                    Comment


                      #11
                      Thanks Ben - sorry it took me so long to get back to you! I'm quite happy to use the cut and paste option anyway (that should've occurred to me as well) so please don't go to any trouble on my account
                      The Pretty Dress Company

                      Comment


                        #12
                        If you have more than one coupon

                        If you have more than one coupon that you want to apply freedelivery too use the following code

                        Code:
                        # FREE DELIVERY COUPONS
                        	my @freedeliverycoupons = ('Freedeliv1','Freedeliv2','Freedeliv3','Freedelivetc');
                        
                        	sub in_array
                        	{
                        	my ($freedeliverycoupons,$search_for) = @_;
                        	my %items = map {$_ => 1} @$freedeliverycoupons;
                        	return (exists($items{$search_for}))?1:0;
                        	} 
                        	
                        	if(in_array(\@freedeliverycoupons,$::g_PaymentInfo{'COUPONCODE'}))
                        	{
                        		my @Response = ActinicDiscounts::ValidateCoupon($::g_PaymentInfo{'COUPONCODE'});
                        		if ($Response[0] != $::FAILURE)
                        			{
                        				return(SetFreeShipping());
                        			}
                        	}
                        You can place it in exactly the same place as the other code above.
                        Note make sure you have all the discount codes set up in actinic before trying this. I forgot and almost pulled my hair out.
                        Ben Adcock
                        Caged Fish Web Design

                        Comment


                          #13
                          Brilliant! - thanks for that
                          The Pretty Dress Company

                          Comment


                            #14
                            Note that you can use Site level Variables in the Actinic Perl scripts.

                            So

                            'Freedeliv1'

                            Could be:

                            '<actinic:variable name="Freedeliv1" encoding="perl" />'

                            etc.

                            So the coupon codes could be changed via Settings / Site Options.
                            Norman - www.drillpine.biz
                            Edinburgh, U K / Bitez, Turkey

                            Comment


                              #15
                              Cheers norman, now theres something i didnt know.
                              Im guessing the comma delimited array could be controlled by one variable?
                              Ben Adcock
                              Caged Fish Web Design

                              Comment

                              Working...
                              X