Announcement

Collapse
No announcement yet.

adding products straight to basket

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

    adding products straight to basket

    Im looking for a way to add a product to the shopping cart from anywhere on the site.

    For example on a site homepage, rather than a component linking to an actual product page itself, can a link be coded to actually add that product straight to the shopping basket.

    The perl script in question to do such a thing seems to be ca000001.pl ... im guessing i could link to this script and supply the product reference number as a variable within the url ... my knowledge of perl is flaky so im not sure of the right variables to supply if this is at all possible

    thanks

    #2
    Can'y help you with the actual perl, but the file you want is shoppingcart.pl this file generates ca000001.pl.

    Comment


      #3
      yeah im aware shoppingcart.pl generates ca000001.pl .... but ca000001.pl is the script on the server which would need to be supplied the variables via the url

      thanks anyhow

      Comment


        #4
        The URL
        Code:
        http://localhost/cgi-bin/ca000241.pl?SID=3&PAGE=PRODUCT&Q_7=5
        works fine here.

        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 checking the HTML source of the product page (look for <INPUT TYPE=HIDDEN NAME="SID" VALUE="xxx"> where xxx will be the section ID). 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).

        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.

        I hope this helps.

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

        Comment


          #5
          thanks very much i shall give that a try

          Comment


            #6
            Further to Zoltan's post

            Is it possible to use

            --------------------------------------------------------------------------------http://localhost/cgi-bin/ca000241.pl?SID=3&PAGE=PRODUCT&Q_7=5

            with a catalog referrer url that tells catalog where to go after you have entered the goods into the cart?

            also

            From a static page in v5 we used to submit

            <form method="post" action="http://www.stuff-uk.net/cgi/ca000001.pl">
            <input type=hidden name="SID" value="35">
            <input type=hidden name="PAGE" value="PRODUCT">
            <input type="hidden" name="ACTINIC_REFERRER" VALUE="Stuff_UK_DeskJet_35.html">
            <input type="image" height=18 width=29 src="http://www.stuff-uk.net/acatalog/pmenur1_c4.gif" border="0" name="ST-C2697A">


            It doesnt seem to work in V6, I assume Referrer has been replaced by PAGEFILENAME and that you also need to pass the quantity using Q_PARTNUMBER=Quantity

            Are there any more parameters to pass as I cant seem to get it working
            Alan Stanley
            www.stuff-uk.net

            Comment


              #7
              Putting Items Into Basket Didnt want to work - What am i doing wrong ?

              Hiya i follwed zmagyar instructions on how to add products directly to the shopping cart but i got an error

              Error: Could not locate the product reference

              But the product reference is passed along in the address bar though.

              http://www.modelpower.co.uk/cgi-bin/...RODUCT&Q_132=1

              thats what the link im passing is,

              The nParentSectionID number in the database is 13 and the Product Reference is 132 in the database.

              Can someone tell me where im going wrong please ?

              James
              James
              ------------------
              ModelPower.co.uk - Quality Batteries - Affordable Prices

              Comment


                #8
                The ShoppingCart script doesn't get the Product Reference from the Quantity field. You have to add an extra parameter that simulates a Submit button or image.

                Try appending "&_132=Add" (without the quotes) to the URL you tried.

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

                Comment


                  #9
                  Re: Further to Zoltan's post

                  Originally posted by stuff-uk.net
                  Is it possible to use

                  --------------------------------------------------------------------------------http://localhost/cgi-bin/ca000241.pl?SID=3&PAGE=PRODUCT&Q_7=5

                  with a catalog referrer url that tells catalog where to go after you have entered the goods into the cart?
                  Most likely ACTINIC_REFERRER will do the trick here.

                  From a static page in v5 we used to submit

                  <form method="post" action="http://www.stuff-uk.net/cgi/ca000001.pl">
                  <input type=hidden name="SID" value="35">
                  <input type=hidden name="PAGE" value="PRODUCT">
                  <input type="hidden" name="ACTINIC_REFERRER" VALUE="Stuff_UK_DeskJet_35.html">
                  <input type="image" height=18 width=29 src="http://www.stuff-uk.net/acatalog/pmenur1_c4.gif" border="0" name="ST-C2697A">


                  It doesnt seem to work in V6, I assume Referrer has been replaced by PAGEFILENAME and that you also need to pass the quantity using Q_PARTNUMBER=Quantity

                  Are there any more parameters to pass as I cant seem to get it working
                  Lot of things have been changed on this field due to the new shopping modes. So there can be several reasons why this is not working anymore.

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

                  Comment


                    #10
                    sorry forgot to post reply

                    the reply from NormanRouxel with his mod to my code makes it work a treat and is really handy cheers guys
                    James
                    ------------------
                    ModelPower.co.uk - Quality Batteries - Affordable Prices

                    Comment

                    Working...
                    X