Community Forums 

Main Content

Mini Cart - Cookies - Different Directories

    Dec 20 2016 22:39:59

    #1

    The Activities Specialist

    Join date : 2012-01-11      Posts : 4

    I'm having a problem with setting up a Mini Cart on our site. I'm working on a testing server until I can get it to work. I'm using the http://www.malsforms.com/display-cart-new.html as a template. It works fine for the most part with the following exception.

    (Site Layout)
    domain.com/Dir1/
    domain.com/Dir2/
    domain.com/Dir3/

    The mini cart holds the correct information as long as I stay within the same directory.
    if I "Continue Shopping" and go to a different directory the cart shows "Empty" if I add something then it re populates with the missing information.
    You can find our test site here...
    http://thepanamatoursite.tcct-test.com/San_Blas_Islands/

    Any ideas would be great.
    Thanks



    Dec 21 2016 18:15:48

    #2

    GT

    Join date : 2008-09-18      Posts : 3207

    On the one page I've looked at...

    http://thepanamatoursite.tcct-test.com/San_Blas_Islands/One_Day_Tours.php

    there is no recognized value of adult for a quantity...

    <select size="1" name="qty1">
    <option value="Adult" selected>Adult $125.00</option>

    You show the price as $125, yet the form says it is $25...

    <input type="HIDDEN" name="price1" value="25.00">

    I can place an order without having to fill in any date, time or hotel name, these should be mandatory fields.

    Which are the pages with the three different forms?

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    Dec 22 2016 13:49:32

    #3

    The Activities Specialist

    Join date : 2012-01-11      Posts : 4

    The Tour price is for this one is $125.00 but we only charge a deposit of $25.00
    Date, Time and Hotel are all required fields. If left blank a popup let's you know you need to fill in the missing information.



    Dec 22 2016 19:54:12

    #4

    GT

    Join date : 2008-09-18      Posts : 3207

    The page didn't show me any popup... Nothing was passed to Mals... I didn't see any info on $25...

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    Dec 22 2016 20:30:57

    #5

    Geoff

    Join date : 2008-09-18      Posts : 415

    For a cookie to be accessible across directories you need to specify a path when the cookie is set. Find this line -

    document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();

    Append a path parameter thus -

    document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString()+";path=/";

    All your pages will of course need this amendment.



    Dec 28 2016 00:26:45

    #6

    The Activities Specialist

    Join date : 2012-01-11      Posts : 4

    That worked... Thanks