Online Shop

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Atrocitas
Forum Newbie
Posts: 2
Joined: Wed Feb 25, 2009 12:28 pm

Online Shop

Post by Atrocitas »

Hello all. I am totally new to php and need a bit of advice.

I have an online shop that I am modifying from a prebuilt package.

By randomly playing with bits from the css I have managed to change the look to what I want. And likewise through some layout.html files I have adjust certain text/table properties and values.

But I am left with one problem I cant solve. I want to have cheque payments available, it has a nice option box to turn cheque payments on so no problem so far. The issue is it defaults to cheque payable to the company name, at present I have no company accounts so I want to change the company nme to my name, but if I change the company name to my name in the global variables then my name shows everywhere the company name normally would...

I found a file called payment.php.

Within this I found this code/script

Code: Select all

 
 
#CHECKING FOR CHEQUE/COD
 
            if($rsSettings[$i]->vDatatype=="cartPayMail" && $rsSettings[$i]->nNumberdata==1)
 
            {
 
                $blkactive=1;
 
                $this->obDb->query ="SELECT vAddress,vCity,vZip,vState,vStateName,vCountry FROM  ".COMPANYSETTINGS;
 
                $rsCompany=$this->obDb->fetchQuery();
 
                $this->ObTpl->set_var("TPL_VAR_COMPANY",$this->libFunc->m_displayContent(SITE_NAME));
 
                $this->ObTpl->set_var("TPL_VAR_ADDRESS",nl2br($this->libFunc->m_displayContent($rsCompany[0]->vAddress)));
 
                $this->ObTpl->set_var("TPL_VAR_CITY",$this->libFunc->m_displayContent($rsCompany[0]->vCity));
 
                $this->ObTpl->set_var("TPL_VAR_ZIP",$this->libFunc->m_displayContent($rsCompany[0]->vZip));
 
                if($rsCompany[0]->vState>1)
 
Looking at this it seems to call the variable TPL_VAR_COMPANY from SITE_NAME

How would I change that line to just make a text entry the variable ie to make TPL_VAR_COMPANY="my name"

Any help greatly appreciated
Last edited by Atrocitas on Thu Feb 26, 2009 12:57 am, edited 1 time in total.
sparrrow
Forum Commoner
Posts: 81
Joined: Mon Oct 20, 2008 12:22 pm

Re: Online Shop

Post by sparrrow »

It's hard to break down complex code written by other people without having all of the code, but from the looks of it I would change that line to:

Code: Select all

$this->ObTpl->set_var("TPL_VAR_COMPANY",$this->libFunc->m_displayContent("John Doe"));
Also, please use

Code: Select all

 tags when posting code.
Atrocitas
Forum Newbie
Posts: 2
Joined: Wed Feb 25, 2009 12:28 pm

Re: Online Shop

Post by Atrocitas »

Thank you very much. That worked perfectly.

Very much appreciated
Post Reply