Add to Cart button that would call a script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • SStephenson
    Sergeant First Class

    • Feb 2007
    • 53

    Add to Cart button that would call a script

    Trying to figure how to do this:

    An Add to Cart button that would call a script that would:
    (1) Upload a file to your server
    (2) Post the other data from the form to the cart
    Scott

    Turn your Sentimental photos into Canvas Art!
    www.canvasappeal.com


  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Add to Cart button that would call a script

    Depends on many things: which cart you have, how you have created the Add to Cart. Is there a "upload" field ? where is the file supposed to be uploaded from ?
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • SStephenson
      Sergeant First Class

      • Feb 2007
      • 53

      #3
      Re: Add to Cart button that would call a script

      I'm using Mal's. My customers will make several selections during the order process, one of them will be to upload a photo to me. I would like for them to not have to click one button to upload their photo then another one to checkout. Would like to have 1 button to accomplish both tasks.

      I've received assistance from Mal's forum but not on this issue.

      Hope I have supplied you with enough information. I have not published the page but can send you the html code.

      Thanks!
      Scott

      Turn your Sentimental photos into Canvas Art!
      www.canvasappeal.com


      Comment

      • navaldesign
        General & Forum Moderator

        • Oct 2005
        • 12080

        #4
        Re: Add to Cart button that would call a script

        I don't think you can achieve this. I believe that Mal's cart uses sessions, so it is necessary to redirect the user to Mal's in order for the Add to Cart button to be effective. You CAN upload the file, and then POST the data to the cart using the CURL library, but i am not sure if Mal's uses sessions to distinguish users and their orders from each other. I think so, in which case it will not be possible. You would need to have a two step checkout (but this solution requires some scripting as well): The user selects the product, Browses to upload the file, and clicks on "Add to cart". The form submits (uploads the file) and recieves a confirmation page, with another button to proceed to checkout.
        Navaldesign
        Logger Lite: Low Cost, Customizable, multifeatured Login script
        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

        Comment

        • SStephenson
          Sergeant First Class

          • Feb 2007
          • 53

          #5
          Re: Add to Cart button that would call a script

          In your scenario "The user selects the product, Browses to upload the file, and clicks on "Add to cart". The form submits (uploads the file) and recieves a confirmation page, with another button to proceed to checkout." can these be accomplished in a pop-up type window?

          So maybe have a flash script showing the upload progress and when completed, show a continue button to checkout.

          I'm trying to make the order process a simple as possible for the customer. Do you have any other recommendations for cart options other than Mal's. I've been using them for their discount options which I could not get from PayPals cart.
          Scott

          Turn your Sentimental photos into Canvas Art!
          www.canvasappeal.com


          Comment

          • navaldesign
            General & Forum Moderator

            • Oct 2005
            • 12080

            #6
            Re: Add to Cart button that would call a script

            In your scenario "The user selects the product, Browses to upload the file, and clicks on "Add to cart". The form submits (uploads the file) and recieves a confirmation page, with another button to proceed to checkout." can these be accomplished in a pop-up type window?

            Yes


            So maybe have a flash script showing the upload progress and when completed, show a continue button to checkout.

            This is more complicated. Actually, it requires Ajax combined with Flash

            I'm trying to make the order process a simple as possible for the customer. Do you have any other recommendations for cart options other than Mal's. I've been using them for their discount options which I could not get from PayPals cart.
            Sorry, i can't help here. My own cart supports discounts etc but that's a different story as it is a in-site, paid for cart. I believe Bethers or Karen will be able to provide more help about this.
            Navaldesign
            Logger Lite: Low Cost, Customizable, multifeatured Login script
            Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
            DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
            Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

            Comment

            • SStephenson
              Sergeant First Class

              • Feb 2007
              • 53

              #7
              Re: Add to Cart button that would call a script

              In your scenario "The user selects the product, Browses to upload the file, and clicks on "Add to cart". The form submits (uploads the file) and recieves a confirmation page, with another button to proceed to checkout." can these be accomplished in a pop-up type window?

              Yes

              Suggestions on how to accomplish this? I've used your file upload php script in the past and can set it up again but not sure how to show in a pop-up something like "your photo has uploaded, please click continue to check out"

              Also, I received a post from Mal's forum with the following link.

              "You can do it (get the file and post to the cart) in one script. Here is a link that tells you how to post without a form. You would just add this type of logic to your upload file script."

              http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51

              Could you take a look at it and see what it means?


              Scott

              Turn your Sentimental photos into Canvas Art!
              www.canvasappeal.com


              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: Add to Cart button that would call a script

                It is the same that i suggested, but with another method (which, some VH servers, depending on the php.ini settings, do not support).
                The CURL llibrary will do the same.

                In BOTH cases, the problem is with the sessions. You see, both methods will perform a "silent" POST. The data IS submitted, but the user is not redirected to Mal's, so no session or cookie can be set . If no session or cookie is set, the cart can't know who the posted data belongs to. In other words, the order can not be associated to the user.
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment

                • SStephenson
                  Sergeant First Class

                  • Feb 2007
                  • 53

                  #9
                  Re: Add to Cart button that would call a script

                  I see. That makes sense. So, I'm just thinking here, could I have the user browse for a file, click an upload button, and keep them on the same page?

                  Once the file upload is completed, have it show some text that says your upload is complete. Then they can click add to cart and process through Mals.
                  Scott

                  Turn your Sentimental photos into Canvas Art!
                  www.canvasappeal.com


                  Comment

                  • navaldesign
                    General & Forum Moderator

                    • Oct 2005
                    • 12080

                    #10
                    Re: Add to Cart button that would call a script

                    Yes, you can do that with an Iframe in the same page. The script can upload thefile in the i frame. Once the upload is finished, it will display the upload complete message. At that point he can click on checkout.
                    Make sure that there are TWO forms (one for the upload, one the Add to Cart)
                    Navaldesign
                    Logger Lite: Low Cost, Customizable, multifeatured Login script
                    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                    Comment

                    • SStephenson
                      Sergeant First Class

                      • Feb 2007
                      • 53

                      #11
                      Re: Add to Cart button that would call a script

                      Thanks, I had not thought of that. I'll give it a try and let you know how it works.

                      Thanks again for your assistance!!!
                      Scott

                      Turn your Sentimental photos into Canvas Art!
                      www.canvasappeal.com


                      Comment

                      • SStephenson
                        Sergeant First Class

                        • Feb 2007
                        • 53

                        #12
                        Re: Add to Cart button that would call a script

                        One more question if I may, When I set up the file upload in an Iframe, will information, such as the file name carry over to the cart? If not, how will I be able to tell who the photo goes with?
                        Scott

                        Turn your Sentimental photos into Canvas Art!
                        www.canvasappeal.com


                        Comment

                        • navaldesign
                          General & Forum Moderator

                          • Oct 2005
                          • 12080

                          #13
                          Re: Add to Cart button that would call a script

                          You need a bit of Javascript for that. By itself it will not associate the user with the file. I mean, when the user is filling in his name etc., a piece of javascript code can populate a hidden field of the upload form, to assocuate the user name with the file.
                          However, if you have no experience at all with Javascript, that could result a bit hard to do.
                          Navaldesign
                          Logger Lite: Low Cost, Customizable, multifeatured Login script
                          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                          Comment

                          • SStephenson
                            Sergeant First Class

                            • Feb 2007
                            • 53

                            #14
                            Re: Add to Cart button that would call a script

                            True. I took your advice and added am Iframe with the browse and upload button. I also added a required text field for the customer to enter their name to certify that they own the copyrights to the photo. Once they upload the photo it also now sends me their name which I can match up with their order.

                            I also added a return page telling them that their file upload has completed. I've tested and it's working perfectly.

                            Thanks again for your help. I'm sure I will be back.
                            Scott

                            Turn your Sentimental photos into Canvas Art!
                            www.canvasappeal.com


                            Comment

                            Working...
                            X