Announcement

Collapse
No announcement yet.

Empty Coupon Code after entering

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

    Empty Coupon Code after entering

    Hi,

    I would like to have the coupon code entry form on all pages, the cart and the checkout. This is simple, however actually very confusing for a user. This is becuase if they enter the code and click go, the code is registered and the discount applied, however that form field is still empty.

    On the checkout page, the code field is filled in automatically as it should be. I had a look on order phase 1 and found this in the text box.

    value="NETQUOTEVAR:COUPONCODE"

    however this fails to work on other pages. Is there any way to access this netquotevar on all pages, or another way to do it?

    Many Thanks,

    Steve

    #2
    Anyone have any ideas / need clarification of the problem? Just not possible?

    Thanks,

    Steve

    Comment


      #3
      At least let them know it has been accepted????

      Right, I suppose this is not possible. Is there at least a way to let the user know their code has been accepted??

      It currently lets them know if they enter an incorrect code, however if they enter a correct code it simply sends them back to the shopping page with no message???

      Surely this doesn't make any sense. Any ideas?

      Thanks,

      Steve

      Comment


        #4
        Hi Steve,

        It will be quite hard to implement this as the product pages are static (not generated by the scripts).

        It's not entirely impossible to set up but it will take quite a bit of perl and java script changes.
        Regards,

        Toby Blanchard

        Comment


          #5
          Presumably:

          - Perl change to write coupon code into the actinic cookie.
          - javascript to retrieve coupon code and display on page.

          None of these sounds too complicated or daunting. Any chance of getting some code for this?

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

          First Tackle - Fly Fishing and Game Angling

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

          Comment


            #6
            Thinking about it, a great improvement would be a message indicating the code has been accepted, just like the one saying it has not.

            Which perl script needs to be patched?? Surely we just need to change the immediate redirect to display a confirmation message and redirect after x seconds.

            Then as a bonus the form fields should be filled in throughout the site.

            Comment


              #7
              Originally posted by steveoidm
              Which perl script needs to be patched?? Surely we just need to change the immediate redirect to display a confirmation message and redirect after x seconds.
              It is CartManager.pl for the cart pages and ShoppingCart.pl for the product pages. It is pretty trivial for the product pages. Just open ShoppingCart.pl and find the function RecordCouponCode. You will find the following code there
              Code:
              	if ($sErrorMessage ne "")
              		{
              		my %hErrors;
              		@Response = ReturnToLastPage(5, $sErrorMessage);
              		}
              	else
              		{
              		@Response = ReturnToLastPage(0, "");
              		}
              Just change the second ReturnToLastPage call. The first parameter should be the delay (in seconds) before the page bounces the second parameter is the message to be displayed.

              For the cart something similar may be applied. The following bit needs to be edited there
              Code:
              		@Response = ActinicDiscounts::ValidateCoupon($sCoupon);
              		if ($Response[0] == $::FAILURE)
              			{
              			$sErrorMessage .= ACTINIC::GetPhrase(-1, 1971,  $::g_sRequiredColor) . $Response[1] . ACTINIC::GetPhrase(-1, 1970);
              			}
              		else
              			{
              			if (ACTINIC::GetPhrase(-1, 2355) ne $sCoupon)
              				{
              				$::g_PaymentInfo{'COUPONCODE'} = $sCoupon;
              				$::Session->SetCoupon($::g_PaymentInfo{'COUPONCODE'});
              				}
              			}
              Unluckily the error handling is a bit different here. But modifying this code to have
              Code:
              		@Response = ActinicDiscounts::ValidateCoupon($sCoupon);
              		if ($Response[0] == $::FAILURE)
              			{
              			$sErrorMessage .= ACTINIC::GetPhrase(-1, 1971,  $::g_sRequiredColor) . $Response[1] . ACTINIC::GetPhrase(-1, 1970);
              			}
              		else
              			{
              			if (ACTINIC::GetPhrase(-1, 2355) ne $sCoupon)
              				{
                                              $ACTINIC::B2B->SetXML('CARTUPDATEERROR', "Your coupon updated message");
              				$::g_PaymentInfo{'COUPONCODE'} = $sCoupon;
              				$::Session->SetCoupon($::g_PaymentInfo{'COUPONCODE'});
              				}
              			}
              is my best guess. Sorry, but I do not have too much time now to test it. Therefore please use it only at your own risk. Obviously the usual disclaimer applies (i.e. Actinic doesn't support and script changes so it is your own risk to try and be sure you got recent backups before start it).

              I hope I could help.

              Cheers,
              Zoltan
              Actinic Software
              www.actinic.co.uk

              Comment


                #8
                Originally posted by olderscot
                Presumably:

                - Perl change to write coupon code into the actinic cookie.
                - javascript to retrieve coupon code and display on page.
                Yes, that's what I was thinking about. But I didn't feel this simple enough for support.
                None of these sounds too complicated or daunting. Any chance of getting some code for this?
                Yep, it is not complicated. Only the following needs to be done:
                • Implement Session::GetCoupon based on Session::SetCoupon
                • Modify Actinic::PrintHeader to write out the the result of the $::Session->GetCoupon function call to a new cookie
                • Create some bit of javascript which gets the value from the cookie and writes to the text box
                • Deal with all the unforeseen issues which may come up during these.
                It may take a couple of hours to implement IMO. Unluckily I can't afford that ATM. Anyway I hope I could help.

                Cheers,
                Zoltan
                Actinic Software
                www.actinic.co.uk

                Comment


                  #9
                  Hi,

                  Thanks for all your help, just the simple first edit makes the whole function 100% more usable.

                  If I have some spare time I will look at the larger edit, however as the user now knows their code has been accepted it is not that big a deal.

                  Thanks,

                  Steve

                  Comment

                  Working...
                  X