Announcement

Collapse
No announcement yet.

Runnning PHP

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

    Runnning PHP

    I want to be able to run a PHP script once an order is completed.

    A couple of options which I have investigated and so far been unsucessful include;

    1. Trying to parse the Perl (.pl) pages as PHP by adding this line of code to .htaccess
    Code:
    AddType application/x-httpd-php .pl
    but this do not work.

    2. Renaming the a checkout file to .php extension, but then my guess is that it would not be able to do its thing (and I dont not know how to do this).

    3. Setting up a redirect to a PHP file during the ordering process. This to me seems like the best option currently.

    I want to manipulate the items in within the order and create a secondary output. How are items within the order stored? My first guess would be cookies, in which case I would have not thought I would have problem accessing these items using PHP code?
    Last edited by bigstylee; 08-Jul-2009, 01:35 PM. Reason: spelling mistake

    #2
    Your best bet might be to learn a bit of perl and add your script into the standard pl files. Even if it is just to call the php script from within there. With a bit of digging, you should be able to find how the order details are handled in the perl scripts and manipulate them to your own requirements.
    ActiveStock
    On-line, real-time stock control plug-in for Actinic V7, V8 and V9
    **New - Captcha plug-in for your Contact Us form**

    ActiveStock website
    Free 30 Day Trial
    ActiveStock Blog (including a new tutorial on a 'Sort By' function for long section pages)

    Comment


      #3
      Having not done Perl before this may take me some time, but I do agree this probably is going to be my best option.

      Before I spend some time learning the basics of Perl can someone tell me if what I am trying to do is possible.

      My customer has given me an ENCODED PHP file containing a number of classes. Using Perl, will I be able to include the PHP script file, create an object instances with arguments and call functions?

      If the answer is no, then I need to consider recreating the functionality of this encoded script in Perl.

      Comment


        #4
        why dont you, research ajax, and make an ajax call, via javascript, on your recepit page.

        or even simpler, use an image tag, hidden.

        <img src="http://server.com/my.php?variable=passed" style="display:none;" />

        Comment


          #5
          example of posting with jQuery:
          http://docs.jquery.com/Ajax/jQuery.post

          Comment


            #6
            I had not thought of this option, but could potentially work for me needs.

            I am thinking the easiest way for me to do this is, as you say on the recepit page. In the code where the items are looped through to display name & price I insert my code within the loop and grab the generated variables.

            My question is, which file/function am I going to find this bit of code!!!

            Thanks for all your help so far.

            Comment


              #7
              Right I believe I have the code working by modifying the "Cart Product Details" to execte the AJAX within the table rows.

              I am struggling to find the layout that corrosponds to the Reciept page. Can someone please point me in the right direction!?

              Comment


                #8
                When you are in the Design tab, "Receipt Page" is listed in the drop down box at the top (default is "Content Page").
                ActiveStock
                On-line, real-time stock control plug-in for Actinic V7, V8 and V9
                **New - Captcha plug-in for your Contact Us form**

                ActiveStock website
                Free 30 Day Trial
                ActiveStock Blog (including a new tutorial on a 'Sort By' function for long section pages)

                Comment


                  #9
                  You may find you have an issue with doing certain things with the receipt page.

                  What you see in actinic design tab is the design of the receipt page. The receipt page as viewed by a customer is generated by the scripts and so you may well have issues getting php and/or javascript to run from the receipt page itself.

                  Another solution is amending the OCC script templates for you payment service provider(s) so that instead of sending the customer to the receipt page they are sent to you .php page which then does whatever it needs to do and then forwards the customer to the receipt page.

                  Comment


                    #10
                    There is a further problem with using the Receipt page as you may find that not all your customers return to that page after completing the payment process - they may choose to end their browser session while still in the PSP's pages....
                    ActiveStock
                    On-line, real-time stock control plug-in for Actinic V7, V8 and V9
                    **New - Captcha plug-in for your Contact Us form**

                    ActiveStock website
                    Free 30 Day Trial
                    ActiveStock Blog (including a new tutorial on a 'Sort By' function for long section pages)

                    Comment

                    Working...
                    X