Announcement

Collapse
No announcement yet.

mini cart to external page?

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

    mini cart to external page?

    Hi

    I've got a version 6 site which I would like to bring out the quick search and mini cart into some external pages. I've sorted the quick search, and have tried to do the minicart using the getCartItem function on the cart cookie:

    <script language="JavaScript" type="text/JavaScript">
    function getCartItem(index)
    {
    var act_cart= getCookie("CART_CONTENT")
    temp =(act_cart != null) ? temp=act_cart.split("\t"):0;
    return (temp.length > 0) ? temp[index] : 0;
    }
    // -->
    </script>

    then write the value and quantity in thus:

    items ordered:
    <script language="JavaScript">
    document.write(getCartItem(3));</script>
    value:
    <script language="JavaScript">
    document.write(getCartItem(1));</script>

    but it don't work.

    the catalog is at
    www.domain/acatalog

    and I have tested the code on pages at
    www.domain/prelaunch
    www.domain/
    www.domain/acatalog/

    as I thought it might be a cookie 'availability' thing, but without success.

    Is this not possible, or have I made a boo-boo in the code?

    Many thanks, Dan
    adaptive-image.co.uk

    #2
    You also need the getCookie routine. It's in actinicextras.js

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Norman, that's working now.

      Got slightly confused though, because the comments on the GetCookie function say that the passed parameter should be ("name"), whereas is should be (name). Worked it out after a couple of minutes, but my Javascript is not that hot.

      Thanks again, Dan
      adaptive-image.co.uk

      Comment

      Working...
      X