Announcement

Collapse
No announcement yet.

clearing cookies before checkout?

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

    clearing cookies before checkout?

    hi all...

    I have a site with only one product, a digital download. Obviously when going to the checkout the customer can only have one item in their basket, cause you can only buy one download.

    the problem i have is the following scenario.
    a customer puts the item in their basket, then chooses not to purchase for whatever reason. They then return to the site a day or two later having decided to purchase...now when they choose 'add to basket' the actinic returns an error, saying they already have one item in their basket... the customer then has to go through the hassle of removing, updating, re-ordering etc etc.

    Is there any way to stop this? ie clear the cookie (im assuming it works by cookies) before the checkout page is reached?

    long shot i know but hey...

    adi

    #2
    There is function in the file actiniccore.js called setCookie which accepts 3 parameters. If you created a button which called a javascript function, you could pass it an expiry date that is in the past which would delete the cookie.

    It might be something like:

    <input type="button" value="Clear Order" onclick="ClearCookie()" />

    (You could also call it in the body onload function).

    Then you would need some javascript:

    <script language="javascript">
    function ClearCookie {
    var Today = new Date();
    var Expiry = new Date(Today.getTime() - 28 * 24 * 60 * 60 * 1000); // minus 28 days ago so cookie expires
    setCookie("ACTINIC_CART",null,Expiry);
    }
    </script>

    You might have to test the scripts - i can't claim to have tried it as here, but I have used it similiarly for other effects in Actinic.

    Hope this helps.
    http://www.johnsons-seeds.com - Actinic plugins, remote add to cart and custom CMS
    http://www.dtbrownseeds.co.uk - More seeds and plants....
    http://www.mr-fothergills.co.uk - Well it used to be Actinic...

    Comment

    Working...
    X