Announcement

Collapse
No announcement yet.

Showing Cart Items and Value on pages external to the Catalogue

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

    Showing Cart Items and Value on pages external to the Catalogue

    Hi,

    The code to show the value and subtotal within actinic is

    document.write(getCartItem(3));

    document.write(getCartItem(1));

    Can this code be used on pages outwith the actalog dir?

    #2
    From the v9 AUG (Page 94/95):

    Viewing the Shopping Cart from Anywhere on the Internet

    The page that shows a summary of the shopping cart details is actually displayed as a result of a call to an online Perl script in the cgi-bin directory.
    Go to your online website and click the 'view cart' button on the navigation bar. Even with nothing in your shopping cart, the address of the page in the 'Address' bar of your browser will be something like:

    http://your.URL/cgi-bin/ca000001.pl?ACTION=SHOWCART

    This link will work when the call has come from inside the 'acatalog' folder online, but it might not work from outside. If it doesn't, you will need to add an 'ACTINIC_REFERRER=' parameter that tells the browser where your 'acatalog' folder is. This is the 'Catalog URL' value, which can be seen in 'Web | Network Setup'.

    If your Catalog URL is 'http://your.URL/acatalog/' then the call to the shopping cart becomes:

    http://your.URL/cgi-bin/ca000001.pl?....URL/acatalog/

    Adding to Cart from Anywhere on the Internet

    The following URL shows you the format to follow to add a product to the cart from anywhere on the Internet.

    http://your.URL/cgi-bin/ca000001.pl?...=PRODUCT&Q_7=5

    The SID parameter should be the section ID of the section where the product can be found. You can figure out the exact SID by inserting the 'SectionID' variable somewhere in your store pages and see what it becomes in the previewed page.

    The Q_ parameter informs the script about the product reference and the quantity. The product reference is the (CGI encoded) string prefixed by Q_ while the quantity is the parameter value (prod ref is 7, qty is 5 in the above example).

    If you are adding from outside the 'acatalog' folder, then ensure you add
    ACTINIC_REFERRER=http://your.URL/acatalog/
    onto the end of the URL.

    Obviously this works only for products where components, attributes, date or other info prompts are not used. However these more complex products can also be added to the cart on similar way but more parameters are required (check the HTML source of your product page for hidden input parameters to see what else required in these cases).

    The result of this script call may vary depending on the "Shopping mode" setting of the section where the product is located. E.g. if your product is located in a section where "Quantity on Product Page" shopping mode is used then using this link the product will be added to the cart and a bounce page will drop you back to the last used shop page, but if the shopping mode is "Quantity in Shopping Cart" then the cart will be displayed clicking on the link.

    Note that this solution is not supported by Actinic Software therefore you should use this at your own risk.

    Comment


      #3
      Originally posted by grantglendinnin View Post
      From the v9 AUG (Page 94/95):

      Viewing the Shopping Cart from Anywhere on the Internet

      The page that shows a summary of the shopping cart details is actually displayed as a result of a call to an online Perl script in the cgi-bin directory.
      Go to your online website and click the 'view cart' button on the navigation bar. Even with nothing in your shopping cart, the address of the page in the 'Address' bar of your browser will be something like:

      http://your.URL/cgi-bin/ca000001.pl?ACTION=SHOWCART

      This link will work when the call has come from inside the 'acatalog' folder online, but it might not work from outside. If it doesn't, you will need to add an 'ACTINIC_REFERRER=' parameter that tells the browser where your 'acatalog' folder is. This is the 'Catalog URL' value, which can be seen in 'Web | Network Setup'.

      If your Catalog URL is 'http://your.URL/acatalog/' then the call to the shopping cart becomes:

      http://your.URL/cgi-bin/ca000001.pl?....URL/acatalog/

      Adding to Cart from Anywhere on the Internet

      The following URL shows you the format to follow to add a product to the cart from anywhere on the Internet.

      http://your.URL/cgi-bin/ca000001.pl?...=PRODUCT&Q_7=5

      The SID parameter should be the section ID of the section where the product can be found. You can figure out the exact SID by inserting the 'SectionID' variable somewhere in your store pages and see what it becomes in the previewed page.

      The Q_ parameter informs the script about the product reference and the quantity. The product reference is the (CGI encoded) string prefixed by Q_ while the quantity is the parameter value (prod ref is 7, qty is 5 in the above example).

      If you are adding from outside the 'acatalog' folder, then ensure you add
      ACTINIC_REFERRER=http://your.URL/acatalog/
      onto the end of the URL.

      Obviously this works only for products where components, attributes, date or other info prompts are not used. However these more complex products can also be added to the cart on similar way but more parameters are required (check the HTML source of your product page for hidden input parameters to see what else required in these cases).

      The result of this script call may vary depending on the "Shopping mode" setting of the section where the product is located. E.g. if your product is located in a section where "Quantity on Product Page" shopping mode is used then using this link the product will be added to the cart and a bounce page will drop you back to the last used shop page, but if the shopping mode is "Quantity in Shopping Cart" then the cart will be displayed clicking on the link.

      Note that this solution is not supported by Actinic Software therefore you should use this at your own risk.
      Hi, thats not really what I meant, but thank you for the reply.

      Its this part I mean.. the part I have circled in red, (taken from an Actinic example site)



      As I originally said its a javascript thats used in Actinic..

      document.write(getCartItem(3));

      document.write(getCartItem(1));

      I would not have thought it the code would work outside the acatalog dir..

      This part is interesting...

      If you are adding from outside the 'acatalog' folder, then ensure you add
      ACTINIC_REFERRER=http://your.URL/acatalog/
      onto the end of the URL.

      But I don't see how that would work with the javascript function

      Comment


        #4
        Heres the post you are after:-

        http://community.actinic.com/showthr...(3))%3B+basket

        Remember you also need to include the actinic scripts in the head area of the page.
        Cheers

        David
        Located in Edinburgh UK

        http://twitter.com/mcfinster

        Comment


          #5
          For that, I'd assume on your other (non-actinic) site/directory, you'd need to call the cookie generator in the <head> section of the page:

          <script language="javascript" type="text/javascript" src="http://FULLURLTOACTINICSITE.com/acatalog/actiniccore.js"></script>
          <script language="javascript" type="text/javascript" src="http://FULLURLTOACTINICSITE.com/acatalog/actinicextras.js"></script>

          I'd be tempted to place the following line directly below the lines shown above, still within the <head> area:

          <Actinic:COOKIECHECK />


          Now try placing this somewhere in the (non-actinic) site/directory page:

          Code:
             <script language="javascript" type="text/javascript">
          	   <!--
          	   document.write(getCartItem(3));
          	   // -->
             </script>,
          Value:
             <script language="javascript" type="text/javascript">
          	   <!--
          	   document.write(getCartItem(1));
          	   // -->
             </script>
          I haven't personally tried this before, but am currently doing it as we speak, will get back to you shortly.

          Comment


            #6
            Originally posted by grantglendinnin View Post
            For that, I'd assume on your other (non-actinic) site/directory, you'd need to call the cookie generator in the <head> section of the page:

            <script language="javascript" type="text/javascript" src="http://FULLURLTOACTINICSITE.com/acatalog/actiniccore.js"></script>
            <script language="javascript" type="text/javascript" src="http://FULLURLTOACTINICSITE.com/acatalog/actinicextras.js"></script>

            I'd be tempted to place the following line directly below the lines shown above, still within the <head> area:

            <Actinic:COOKIECHECK />


            Now try placing this somewhere in the (non-actinic) site/directory page:

            Code:
               <script language="javascript" type="text/javascript">
            	   <!--
            	   document.write(getCartItem(3));
            	   // -->
               </script>,
            Value:
               <script language="javascript" type="text/javascript">
            	   <!--
            	   document.write(getCartItem(1));
            	   // -->
               </script>
            I haven't personally tried this before, but am currently doing it as we speak, will get back to you shortly.
            That looks like it will work, thank you very much, will give it a try this evening.

            Comment


              #7
              Originally posted by dave_finlayson View Post
              Heres the post you are after:-

              http://community.actinic.com/showthr...(3))%3B+basket

              Remember you also need to include the actinic scripts in the head area of the page.
              Thank you

              Comment


                #8
                Originally posted by grantglendinnin View Post
                For that, I'd assume on your other (non-actinic) site/directory, you'd need to call the cookie generator in the <head> section of the page:

                <script language="javascript" type="text/javascript" src="http://FULLURLTOACTINICSITE.com/acatalog/actiniccore.js"></script>
                <script language="javascript" type="text/javascript" src="http://FULLURLTOACTINICSITE.com/acatalog/actinicextras.js"></script>

                I'd be tempted to place the following line directly below the lines shown above, still within the <head> area:

                <Actinic:COOKIECHECK />


                Now try placing this somewhere in the (non-actinic) site/directory page:

                Code:
                   <script language="javascript" type="text/javascript">
                	   <!--
                	   document.write(getCartItem(3));
                	   // -->
                   </script>,
                Value:
                   <script language="javascript" type="text/javascript">
                	   <!--
                	   document.write(getCartItem(1));
                	   // -->
                   </script>
                I haven't personally tried this before, but am currently doing it as we speak, will get back to you shortly.
                Did you have any success? I could not get the values to echo to the external pages at all

                Comment


                  #9
                  Can we see the page where you've added the code please?

                  Comment


                    #10
                    Originally posted by cdicken View Post
                    Can we see the page where you've added the code please?
                    I will update the thread this evening as the work is on my home pc.

                    Comment


                      #11
                      Originally posted by cdicken View Post
                      Can we see the page where you've added the code please?

                      Hi Chris

                      I did a quick test page for you to look at.

                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      <html xmlns="http://www.w3.org/1999/xhtml">
                      <head>
                      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                      <title>Untitled Document</title>


                      <script language="javascript" type="text/javascript" src="http://mydomain/acatalog/actiniccore.js"></script>
                      <script language="javascript" type="text/javascript" src="http://mydomain/acatalog/actinicextras.js"></script>


                      <Actinic:COOKIECHECK />


                      </head>

                      <body>
                      Item,
                      <script language="javascript" type="text/javascript">
                      <!--
                      document.write(getCartItem(3));
                      // -->
                      </script>,
                      Value:
                      <script language="javascript" type="text/javascript">
                      <!--
                      document.write(getCartItem(1));
                      // -->
                      </script>

                      </body>
                      </html>

                      Comment


                        #12
                        Cookies are site specific. You'll only be able to use them if your external page is in the same domain as the Actinic ones.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #13
                          That worked within the same domain.

                          Thanks for the help guys

                          Comment


                            #14
                            Ok this is not working properly for me.

                            I have around 20 external pages which I have added the code as described above. So, I add to the cart..then click on an external page.. the values echo no problem on that external page. If I click on another external page, they are reset to 0, I then click back into the cart and they appear again and so on.

                            I checked the browser and the cookies exist. Anyone able to help?

                            Comment


                              #15
                              Gordon,

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

                              Comment

                              Working...
                              X