Announcement

Collapse
No announcement yet.

Order counting script

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

    Order counting script

    I had a client who was worried about orders, visitors etc, they had converted from another solution to Actinic, and were used to being told how many orders, visitors, payments etc they had received, all without actually logging into their web based back end...

    So I knocked up a short shell script (*nix obviously - perhaps someone will convert to perl for you windows users) - anyway, I figure it might be useful to other users, so here it is...

    Code:
    #!/bin/bash
    
    echo "content-type: text/html
    
    
    `date`
    "
    WD="/home/sites/www.yoursite.com/web/acatalog/"
    ORDERS="`ls -1 *.ord 2>>/dev/null`"
    OCCSESS="`ls -1 *.occ 2>>/dev/null`"
    SESSIONS="`ls -1 *.session 2>>/dev/null`"
    
    cd $WD
    
    if [ "X" = "X$ORDERS" ]
    then
       echo '<H2>No Orders Found</H2>'
    else
       echo "<H2>Orders found: "`echo "$ORDERS" | wc -l`"</H2>"
    fi
    if [ "X" = "X$OCCSESS" ]
    then
       echo '<H2>No OCC Sessions Found</H2>'
    else
       echo "<H2>OCC Sessions found: "`echo "$OCCSESS" | wc -l`"</H2>"
    fi
    if [ "X" = "X$SESSIONS" ]
    then
       echo '<H2>No Shopping Sessions Found</H2>'
    else
       echo "<H2>Shopping Sessions found: "`echo "$SESSIONS" | wc -l`"</H2>"
    fi
    Just change the WD definition line - upload to your web server, configure as executable and you can now use a browser to find out if you have 1 order or 100... how many have already paid, and how many sessions are currently hanging around on the server - so you know you have at least had visitors!

    Hope this helps...

    regards

    Greg Hewitt-Long

    ps - don't tell anyone what your script is called when you upload it!
    Web Design & Ecommerce - Affordable Web Hosting
    Free and low cost Merchant Accounts coming soon..
    NOD32 Antivirus - Reciprocal Links for Actinic Sites ONLY

    #2
    Thanks for that Greg, I'm sure it will be useful to some of our users.
    ********************
    Tracey
    SellerDeck

    Comment


      #3
      Yep, neat.

      I'll just installed it on a couple of sites

      Thanks Greg

      Comment


        #4
        Our site is hosted on a Unix server. Do this mean we can use this script? And if so, can someone explain to a total server dunce like myself how to install it properly?

        Thanks

        Dave
        Cheers

        David
        Located in Edinburgh UK

        http://twitter.com/mcfinster

        Comment


          #5
          Originally posted by webyourbusiness
          I had a client who was worried about orders, visitors etc, they had converted from another solution to Actinic, and were used to being told how many orders, visitors, payments etc they had received, all without actually logging into their web based back end...

          So I knocked up a short shell script (*nix obviously - perhaps someone will convert to perl for you windows users) - anyway, I figure it might be useful to other users, so here it is...
          Hey Greg,

          (Betcha didn't think there would be this much traffic on this huh?) What is the possibility of running this from the site. Having a button on the Nav menu that would run the script and only available to a particular user?

          IE: login as admin, and be able to see the link.

          and along those lines, I am trying to add a product line to a clients site that she only wants visable to a select few people. Tried the product groups, but can't seem to find where you assign customers to that group and have it only available to those groups.

          Eagle
          Isaiah 40:31But they that wait upon the LORD shall renew [their] strength; they shall mount up with wings as eagles; they shall run, and not be weary; [and] they shall walk, and not faint.

          Comment


            #6
            To install the script

            1 copy the code into notepad,
            2 change the path as describe by Greg,
            3 save the file as xxx.cgi
            4 upload the script (ascii mode) to your cgi-bin
            5 type URL into browser www.domain.co.uk/cgi-bin/xxx.cgi
            6 see result in browser

            Comment


              #7
              Originally posted by dave_finlayson
              Our site is hosted on a Unix server. Do this mean we can use this script? And if so, can someone explain to a total server dunce like myself how to install it properly?

              copy the whole script into a text editor - the line with the bash on it needs to be line #1 - not 2, but the first line...

              Change the line WD="blah"

              to be the path of your site on the server...

              Your host can help with this if you don't know what it should be... or, if you are putting the script in your cgi-bin and the acatalog folder is at the same level, change WD= to

              WD="../acatalog/"

              if your site structure is such that cgi-bin OUTSIDE the web root folder, it could be something like:

              WD="../public_html/acatalog/"

              this depends on your server!

              Save the file as something like countorders.cgi...

              Using an FTP program, upload the script as ASCII

              Set execute permissions = 755 or 555 using your FTP program

              Check script using your browser...

              http://www.yourdomain.com/cgi-bin/countorders.cgi

              (or whatever you called it)

              hth

              Greg
              Web Design & Ecommerce - Affordable Web Hosting
              Free and low cost Merchant Accounts coming soon..
              NOD32 Antivirus - Reciprocal Links for Actinic Sites ONLY

              Comment


                #8
                Originally posted by EaglesNest
                (Betcha didn't think there would be this much traffic on this huh?)
                I was kind of wondering if anyone else actually understood what the script did...

                What is the possibility of running this from the site. Having a button on the Nav menu that would run the script and only available to a particular user? IE: login as admin, and be able to see the link.
                you could put it behind a .htaccess or something - sure!

                We generally build something like that for clients as a sort of control center for NON-Actinic sites...

                Button for adding links to your link manager
                Button for opening stats
                Button for email managment
                Button for manager
                Button for viewing their hosting bill
                Button for opening our helpdesk

                etc...

                It gives them ONE place to bookmark!

                [QUOTEand along those lines, I am trying to add a product line to a clients site that she only wants visable to a select few people. Tried the product groups, but can't seem to find where you assign customers to that group and have it only available to those groups. [/QUOTE]

                Business or catalog? Probably need a new thread for this one...
                Web Design & Ecommerce - Affordable Web Hosting
                Free and low cost Merchant Accounts coming soon..
                NOD32 Antivirus - Reciprocal Links for Actinic Sites ONLY

                Comment


                  #9
                  Thanks everyone, done all that but for some reason the script shows as haveing no orders etc even though I know they are there. My cgi bin is at the same level as the acatalog folder so have set that to "../acatalog/" and permissions to 755.

                  Any suggestions?

                  Dave
                  Cheers

                  David
                  Located in Edinburgh UK

                  http://twitter.com/mcfinster

                  Comment


                    #10
                    Dave,

                    did you configure the WD variable:

                    WD="/home/sites/www.yoursite.com/web/acatalog/"

                    if your cgi-bin is the same level as your acatalog folder, you can try:

                    WD="../acatalog/"

                    regards

                    Greg
                    Web Design & Ecommerce - Affordable Web Hosting
                    Free and low cost Merchant Accounts coming soon..
                    NOD32 Antivirus - Reciprocal Links for Actinic Sites ONLY

                    Comment


                      #11
                      Hi,

                      Can someone help as to how I ascertain what sort of server my sites are on? I have uploaded the script and it shows the following information, in spite of the fact that I have just placed an order on my site!

                      Thu Apr 7 11:02:28 BST 2005
                      No Orders Found
                      No OCC Sessions Found
                      No Shopping Sessions Found

                      I presume from what has been said above, I may well be on a Windows server!

                      I know the server is named 'Argos' with MyServerWorld and uses RedHat Linux, but can't go beyond that.

                      Help!

                      David
                      -----------------------------
                      www.synchronisedwebdesign.com
                      Location: North Yorkshire UK

                      Comment


                        #12
                        Red Hat Linux is Unix so that's unlikely to be the problem (and the script seems to running OK).

                        Check the comments above about the WD= statement.

                        Mike
                        -----------------------------------------

                        First Tackle - Fly Fishing and Game Angling

                        -----------------------------------------

                        Comment


                          #13
                          I too am having the same problems discussed above with the script no showing the orders.

                          I have tried the various suggestions of the WD line.

                          Any ideas on how to get this working as it seems a script to use.
                          Regards

                          Jason

                          Titan Jewellery (Swift Design)
                          Zirconium Rings
                          Damascus Steel Rings

                          Comment


                            #14
                            Originally posted by Buzby
                            I too am having the same problems discussed above with the script no showing the orders.

                            I have tried the various suggestions of the WD line.

                            Any ideas on how to get this working as it seems a script to use.

                            OK - it is possible that there are no orders on the server when you run it... if someone wants to have me debug, then pm me your login/passwd/server details and I'll have a look.

                            regards

                            Greg
                            Web Design & Ecommerce - Affordable Web Hosting
                            Free and low cost Merchant Accounts coming soon..
                            NOD32 Antivirus - Reciprocal Links for Actinic Sites ONLY

                            Comment


                              #15
                              If you're unsure about the WD="...." line then look in Actinic / Advanced / Network Setup / Path from CGI-BIN to acatalog Directory. Whatever you see there goes between the quotes. E.g. if you see ../acatalog/ then that WD line becomes

                              WD="../acatalog/"
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X