Announcement

Collapse
No announcement yet.

Modifiying shoppingcart.pl

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

    Modifiying shoppingcart.pl

    Hi all,

    I'm having a bit of trouble making changes to the ConfirmRemove function in the ShoppingCart.pl file (line 281). I need to change some of the attributes of the table that is generated on line 521. I've discovered that the file ca000001.pl seems to be a duplicate of shoppingcart.pl, and when I make IDENTICAL changes to both files, and refresh website, I get an Internal Server Error.

    Can anyone help me here. I get that impression that the ConfirmRemove function might exist in another file, and that I need to make the same change across all three files, but I am unsure which file to edit. If anyone has any ideas, I would appreciate thier feedback.

    Cheers for your time,

    Ben

    #2
    ca000001.pl is the server version of ShoppingCart.pl and is generated by Actinc, so you only need to make your changes in ShoppingCart.pl.

    I could only find 1 instance of the funtion ConfirmRemove in the Actinic scripts but I can't tell you why you are getting an internal server error.

    Regards
    Jan Strassen, Mole End Software - Plugins and Reports for Actinic V4 to V11, Sellerdeck V11 to V2018, Sellerdeck Cloud
    Visit our facebook page for the latest news and special offers from Mole End

    Top Quality Integrated label paper for Actinic and Sellerdeck
    A4 Paper with one or two peel off labels, free reports available for our customers
    Product Mash for Sellerdeck
    Link to Google Shopping and other channels, increase sales traffic, prices from £29.95
    Multichannel order processing
    Process Actinic, Sellerdeck, Amazon, Ebay, Playtrade orders with a single program, low cost lite version now available from £19.95

    Comment


      #3
      You can skip making changes to ca000001.pl or any ??000001.pl (or pm) files. These are space compressed and comment stripped versions of ShoppingCart.pl automatically generated when you update the site. Any changes made in ShoppingCart.pl (in Site1) will be enough.

      As to the details of what you're doing you'll probably find that some routines that ShoppingCart.pl calls will be in ActinicOrder.pm.

      As to Internal Server Errors. These mean that you made a mistake in the Perl. If you have access to the server's error log (logs/error.log if using Apache) you'll find details of what went wrong there.

      When I tinker with the scripts I use a local server on the same PC (as per the Advanced Guide - Standalone Demo) as this is really quick for debugging. And any crashes won't affect the real world site.

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

      Comment


        #4
        weird

        Okay, cheers for your help Jan. Something else has occured.

        I added my name to the output on ine 521 of ShoppingCart.pl, e.g

        $sLine = 'ben<table...etc

        and refreshing the site did copy the same change to ca000001.pl, so Jan is right, I only need to edit ShoppingCart.pl. The weird thing is, adding something as simple as my name to the output text causes an "Internal Server Error". I remove the change, refresh site and bang, still an Internal Server Error. I have to copy both the ca000001.pl and ShoppingCart.pl files from a previous backup and overright my current files to get the shop working again.

        Does anyone know why this should happen? Is there anything that I'm missing that I should know about when editing the Perl files?

        Cheers for your help so far Jan,

        Ben

        Comment


          #5
          Norman, cheers for the response.

          I've checked the error log as you suggested, and the error is a "Premature end of script headers" for the ca000001.pl file.

          This would make sense if I was poking around with the actual code, but as for just a dding a simple 3 letter word to the HTML output of the function ConfirmRemove, seems a little OTT.

          We run and test our shop on a dedicated live server, setup identically as our customer live server, runing Red Hat, Apache etc, etc. Everything should be groovy.

          This is very weird. Like I said, if I make a change, it throws an error. If I remove the change, and refresh, I still get the error.

          Could there be an issue with Windows character codes, or something like that, that would cause Perl to throw a wobbly?

          Cheers,

          Ben

          Comment


            #6
            Could there be an issue with Windows character codes, or something like that, that would cause Perl to throw a wobbly?
            Not really. As long as you're editing the long named files (likeShoppingCart.pl) then it all gets fixed up before uploading.

            I've got a ferocious number of patched Perl scripts and am quite used to reading the error log as it's an interpreted language so the first time you know it's wrong is when it's run for real. I've sometimes had to re-start Apache and even reboot after some of the errors so that local server with the reset switch is pretty useful.

            Make sure you are using a text editor (I use www.editpadlite.com) and not a word processor. Letting Word loose on the Perl would be a sure-fire way of killing it.

            Why not post a before-and-after example of the change you're making. Post the code inside [ code ] and [ /code ] tags (write them without the internal spaces) so that the Forum displays it exactly as written.

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

            Comment


              #7
              This may be a dumb comment, but I have made this mistake in a fog of fatigue a few times - if you are using an FTP client rather than working from the command line, you are up and downloading the perl in ascii mode not binary, aren't you?

              This error is characteristic of carriage returns being present, and if you are adding then removing the exact same characters, I'd be inclined to think it might be something in the transfer mode?

              Comment


                #8
                I'm still having the same problems.

                I'm not using an FTP client, as GFK suggested, I'm using the actinic client software to upload my site. Im also using Dreamweaver MX to edit my files.

                Here is the rather simple code I want to change (just to make sure its working):

                ShoppingCart.pl, sub ConfirmRemove, line 521

                Code:
                # build block
                $sLine = '<table border="0" cellpadding="0" cellspacing="0" align="cENTER" ...etc;
                CHANGE TO

                Code:
                # build block
                $sLine = 'ben<table border="0" cellpadding="0" cellspacing="0" align="cENTER" ...etc;
                When I refresh the site from with the actinic client, and then visti the basket (or any page that references ca00001.pl) I get an "Internal Server Error".

                As you can see from the change Ive made, adding the text 'ben'
                is all im doing, so why would this not work.

                (Incidentally, I am redesigning the shop to match the new site design, and I have modified this exact line before in the previous site design, so I know its possible

                Any suggestions would help, as the way this is going, I cant finish this job...

                ben

                Comment


                  #9
                  SOLVED IT!!!!

                  It was Dreamweaver MX. I simply opened the ShoppingCart.pl file, and did exactly the same change as specified above, and refreshed the site. It worked.

                  So, maybe there is something RE: Carrage retunrs/char codes with Dreamweaver MX? Does anyone know anything about this?

                  Comment


                    #10
                    I only ever use notepad to edit perl files!!

                    Comment


                      #11
                      So do I now...

                      Thanks for your help everyone.

                      Comment


                        #12
                        Hiya Ben
                        There is also a good free utility out there that is a bit more flexible than notepad called PFE (Programmers File Editor) - if reqd, drop me a mail and I'll send you a zip or tar as required.
                        mail me at actinic@multimit.com
                        Cheers!

                        Comment

                        Working...
                        X