10 Replies Latest reply on Mar 24, 2009 10:02 AM by SeanWoods

    Can't get price to show up in checkout page.

    SeanWoods
      On my website's checkout page, I have the cost calculated by charging customers per word at: http://www.grammarperfection.com/cost.html. After they get their estimate and click "Quick Checkout," the number of words does not transfer to the next checkout page: http://www.grammarperfection.com/checkout.php?serv=1&words=120. Note, at the end of this url is 120, which shows that the word count feature is getting sent to this page, but that number (or whatever the word count currently is) does not transfer to the "Number of Words" box.

      Lastly, the info also will not populate on the final page: http://www.grammarperfection.com/confirmorder.php

      Please let me know what I am doing wrong.
        • 1. Re: Can't get price to show up in checkout page.
          bregent Most Valuable Participant
          The problem is with the server side script http://www.grammarperfection.com/checkout.php.
          In order to be of any help, you would need to provide the code for that page. The easiest way is to copy the page to a new page with a .txt extension and provide the url. Make sure you remove any confidential information.
          • 2. Can't get price to show up in checkout page.
            SeanWoods Level 1
            Bregent,

            Here is the complete HTML code for this page. The URL is http://www.grammarperfection.com/checkout.php?serv=1&words=

            Thanks for offering to help.
            • 3. Re: Can't get price to show up in checkout page.
              bregent Most Valuable Participant
              >Here is the complete HTML code for this page.

              How are you populating the values in that page that were passed from the form? Since this is a php page, I assumed you are using php, yet there is no php script in the code you pasted. There is also no client side scripting to populate the values. In other words, there is nothing in your code that would allow this to work. Values from forms are passed to the page specified in the form's action, but it is up to you to write a script that processes those values. Please correct me if I have missed something obvious in your code.
              • 4. Can't get price to show up in checkout page.
                SeanWoods Level 1
                I am using the code from another website which I will be modifying later on after I get it working for my use. Looking at this code, do you see what you the php script, or the client side scripting to populate the values?

                I'm sorry if I am asking for a lot, but I am fairly new to this.
                • 5. Re: Can't get price to show up in checkout page.
                  bregent Most Valuable Participant
                  >I am using the code from another website which I will be modifying later on after I get it working for my use.

                  That code also does not contain anything that would populate the fields with values from another page. How are you getting the source code you are using? Do you have access to the files? If these are dynamic pages and you are copying the source code from the browser, then you will not be obtaining the script, as server side scripting is not sent to the browser. Do you have access to the source files where this is actually working?
                  • 6. Re: Can't get price to show up in checkout page.
                    SeanWoods Level 1
                    The only code I am using is the code that I copied from the browser. I changed the urls to my own. Is this source code difficult to write? Do you have any advice on where I can go to find code for my use?

                    Again, thanks for your advice. It has been invaluable as most of this has been like Egyptian to me, but I have been working on my site almost daily for a while now.
                    • 7. Re: Can't get price to show up in checkout page.
                      bregent Most Valuable Participant
                      >The only code I am using is the code that I copied from the browser.

                      Where did you get the code from? Do you have a url?
                      • 8. Can't get price to show up in checkout page.
                        SeanWoods Level 1
                        The code came from http://www.proofmydoc.com/proofmydoc.php. So far the only things I have changed are to replace my own urls in the code to make the pages change to my own when clicking "proceed with order." Once I get the basic code working properly, I will change the look and feel of the page to match my own page.

                        Here is my website with the code inputted http://www.grammarperfection.com/checkout.php

                        Note: One part of the code is working properly which put the number of words into the url. On the previous page, http://www.grammarperfection.com/cost.html, if I put in a document that is 173 words long and click "quick checkout," it puts 173 in the url ( http://www.grammarperfection.com/checkout.php?serv=1&words=173) but not on the page where I need it.
                        • 9. Re: Can't get price to show up in checkout page.
                          Level 7
                          Hello,

                          The reason the number of words is in the URL is because there is JavaScript
                          in the page code that causes that to happen.

                          function goToCheckout(serviceOption){
                          var numWords = document.quickcalculator.txtWordCount.value;
                          var checkoutUrl = "/checkout.php?";

                          window.location.href = checkoutUrl + "serv=" + serviceOption +
                          "&words=" + numWords;
                          }


                          This JavaScript is client side code. That means that it is in the page code
                          downloaded from the server and your browser makes it work.
                          More to the point, you can see it in the page code the server downloads so
                          it's included when you view source and copy.

                          PHP is a server side language.
                          There is PHP code in the checkout page that the owner uploaded to the
                          server.
                          That code is what takes the URL parameter (the 173 in your example) and uses
                          it.
                          The trouble is, all of that happens on the server and not the page in your
                          browser as with the Javascript.
                          When the server downloads the checkout page to your browser, it doesn't
                          download the PHP code in it. Just the HTML.
                          You are not seeing the same code the owner has in his copy of checkout.php.


                          On the site you got the code from, it works like this:

                          When you click the "Quick Checkout" button, it triggers the Javascript in
                          the page to insert the 173 into the URL and then sends a command to the
                          server to download the checkout page to your browser.
                          However, before the server downloads the checkout page for you to see, the
                          PHP code in that page tells the server to do something.
                          It tells it to add the 173 to the HTML in the checkout page, and then it
                          downloads the page to your browser without any of the PHP code.

                          In other words, the page you copied is very different than the owner's page
                          on the server.
                          You can't get the page with the PHP in it unless you ask the owner to send
                          you a copy.
                          You'll need to insert your own PHP into the checkout page you made that will
                          tell the server to grab the 173 from the URL and insert it into the HTML
                          before sending the page to the browser for your visitors to see.

                          Take care,
                          Tim

                          "SeanWoods" <webforumsuser@macromedia.com> wrote in message
                          news:gq7sp0$ig9$1@forums.macromedia.com...
                          > The code came from http://www.proofmydoc.com/proofmydoc.php. So far the
                          > only
                          > things I have changed are to replace my own urls in the code to make the
                          > pages
                          > change to my own when clicking "proceed with order." Once I get the basic
                          > code
                          > working properly, I will change the look and feel of the page to match my
                          > own
                          > page.
                          >
                          > Here is my website with the code inputted
                          > http://www.grammarperfection.com/checkout.php
                          >
                          > Note: One part of the code is working properly which put the number of
                          > words
                          > into the url. On the previous page,
                          > http://www.grammarperfection.com/cost.html, if I put in a document that is
                          > 173
                          > words long and click "quick checkout," it puts 173 in the url
                          > ( http://www.grammarperfection.com/checkout.php?serv=1&words=173) but not
                          > on the
                          > page where I need it.
                          >


                          • 10. Re: Can't get price to show up in checkout page.
                            SeanWoods Level 1
                            Excellent explanation! Thanks for all the details. Now I am starting to get it. My target launch date for the website is June 1st. Hopefully I can get this all sorted out by then :)

                            I set up a merchant account with PayPal which will allow me to accept credit cards, that will be my next step.

                            Thanks again.