Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 111
  • Last Modified:

removed code now no email are being produced(web Order Confirmatoin)

I have a small script that was wriiten before I arrived and have been asked to remove some information from our order confirmation.
I found that if I comment out certain line it will change the order confirmation, but when I remove almost all the line, for some reason the email seems to stop being genereated.

here is a piece of the code:

 public function getContactStringPlain() {
        $str = "  ";
        //"BIOTONE Professional Massage and Spa Therapy Products\n".
          //  "4757 Old Cliffs Rd,\r".
           // "San Diego, CA 92120, USA\r\n";
            //"Monday - Friday, 8:00 am - 4:30 pm, PST\r\n\r\n".
            //"Toll Free: 800.445.6457\n".
            //"Local: (619) 582-0027\r".
            //"Email: customerservice@biotone.com\r\n\r\n".
            //"Online: www.biotone.com";
        return $str;
    } //end function getContactStringPlain

Will commenting this out change how a email is generated, I may have a situation that is just slow...I just received a email order confirmation and it looks as if the coding is working.
How ever please verify if I commented this code out correctly?
0
Scott Johnston
Asked:
Scott Johnston
  • 5
  • 4
1 Solution
 
Jason C. LevineNo oneCommented:
How ever please verify if I commented this code out correctly? 

Open in new window


More or less.
0
 
Scott JohnstonSystems ConsultantAuthor Commented:
OK, it works....I tried to remove the entire statement and the coding will fail.

here is more coding...but it all seems  to be working correctly.
Thank you any more coments will be appreciated..

  * @return <String> String
     */
    public function getContactStringPlain() {
        $str = "  ";
        //"BIOTONE Professional Massage and Spa Therapy Products\n".
          //  "4757 Old Cliffs Rd,\r".
           // "San Diego, CA 92120, USA\r\n";
            //"Monday - Friday, 8:00 am - 4:30 pm, PST\r\n\r\n".
            //"Toll Free: 800.445.6457\n".
            //"Local: (619) 582-0027\r".
            //"Email: customerservice@biotone.com\r\n\r\n".
            //"Online: www.biotone.com";
        return $str;
    } //end function getContactStringPlain

    /**
     * Returns a string of contact information to be placed into an email
     * with the content-type of text/html
     * @return <String> String
     */
    public function getContactStringHTML() {
        $str = $this->getContactStringPlain();
        $str = str_replace("\r\n","<br/>",$str);
        $str = str_replace("customerservice@biotone.com","<a href=\"mailto:customerservice@biotone.com\">customerservice@biotone.com</a>",$str);
        $str = str_replace("www.biotone.com","<a href=\"http://www.biotone.com\" target=\"_blank\">www.biotone.com</a>",$str);
        //$str .= "<br/><a href=\"http://messenger.providesupport.com/messenger/biotone.html\" target=\"_blank\">Live Chat Support</a>";
        return $str;
    } //end function getContactStringHTML

    /**
     * Loads default mail message information based on the provide 'code'
     * Returns true only if the default mail message can be found and
     * defaults are loaded.
     * 
     * @param <string> $code
     * @param <Connection> $cnx
     * @return <boolean>
     */
    public function loadDefaults($code, Connection $cnx = NULL) {
        if(is_null($cnx))
            $cnx = new Connection();
        $cnx->execute("SELECT MailID FROM ".$cnx->MarketDB.".MailMessageAssign WHERE Code = '".$cnx->adjust($code)."'");
        if($cnx->AffectedRows == 1) {
            $result = $cnx->getResults(1);
            $cnx->execute("SELECT DefaultSubject, ReplyTo, Message, ".
                "RecordToLog, MimeType, BackupTo, BackupSubject FROM ".$cnx->MarketDB.".MailMessages WHERE ID = ".$cnx->adjust($result['MailID']));
            if($cnx->AffectedRows == 1) {
                $mail = $cnx->getResults(1);
                $this->Subject = $mail['DefaultSubject'];
                $this->ReturnTo = $mail['ReplyTo'];
                $this->Message = $mail['Message'];
                if($mail['RecordToLog'] == "Y")
                    $this->RecordRequest = true;
                else
                    $this->RecordRequest = false;
                if($mail['MimeType'] == "H")
                    $this->setHtmlHeaders();
                else if($mail['MimeType'] == "P")
                    $this->setPlainHeaders();
                if(trim($mail['BackupTo']) != "") {
                    $this->BackupTo = $mail['BackupTo'];
                    $this->BackupSubject = $mail['BackupSubject'];
                } //end if
                return true;
            } //end if
        } //end if
        return false;
    } //end function loadDefaults
} //end class Email

Open in new window

0
 
Scott JohnstonSystems ConsultantAuthor Commented:
More or Less works, that means yes...There is more than one way to skin a cat...
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
Jason C. LevineNo oneCommented:
OK, it works....I tried to remove the entire statement and the coding will fail.

Because it's a function, it's being called elsewhere in the code so if you just delete it without also deleting the call to it, the whole script will die.  Commenting out the output of the function gets you to where you want to be, albeit in a less-than-graceful fashion.  

I placed your code in a code block above.  Look at line 22.

       $str = $this->getContactStringPlain();

That's the call to the function you want to remove.  If you remove that, you don't need to comment out the function itself...it just never gets used.
0
 
Scott JohnstonSystems ConsultantAuthor Commented:
Greeeeat!!!
 I learned again something new...I appreciated you showing me.  This is very helpful in helping me to work on coding.  I am a 1 man shop and do everything from Network, to coding, to database admin, to telephones, business application solution provider and a lot more.  
Sometime all I need is pointed in the right direction!
I've be doing this a long time(25 years) and technology changes, all I try to do is keep up as a  ADMIN who wears just about any type of hat!
0
 
Scott JohnstonSystems ConsultantAuthor Commented:
Just verify I understand this correctly, when I see a URL...
..https://www.biotone.com/checkout.php?proc=billing
in this statement I am looking for a Procedure call "Billing" that is in the Checkuot.php program?
0
 
Jason C. LevineNo oneCommented:
Not necessararily.

That's called a query string the (?proc=billing part).  In your code, you want to look for something that handles the $_GET array, specifically the proc part.  Will look like this:

$_GET['proc']

And be part of a conditional (if) statement.  The code in the conditional will point you to the functions.
0
 
Scott JohnstonSystems ConsultantAuthor Commented:
Thank you again, I have a better understanding of the use.  All I see is this used as a HREF, I am unable to find a GET statement.
it is used in a html statment in the program.
html.= "<a  href=\"/checkout.php?proc=billing/">change billing address</a<br/>".
Thi sis in the Checkout.php program.
0
 
Jason C. LevineNo oneCommented:
You will find it in checkout.php
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now