Desperately need PHP help Please

Post everything else here

Moderators: Website/Forum Admins, Other/Off Topic Moderators

royally confused
Posts: 1
Joined: Mon Feb 23, 2004 1:03 am

Desperately need PHP help Please

Postby royally confused » Mon Feb 23, 2004 1:16 am

Hi,

I am tring to figure out how to change the color of the font. I have a shopping cart page that is showing the fot as white and I need it to be red. Can anyone out there help me? I have looked all over and can not get anywhere with this.

I also am trying to figure out how to program in PHP that when my inventory is gone the item is no longer available. I was given the code below to use to figure out how much was availible but I don't know how to program it to count down the inventory till it is all gone. Can anyone help me with that too? I have the partial code listed below.

$unit = article_get_field('stock');
if(article_get_field('stock') < article_get_field('count')){
article_set_field('HIDE_ORDERBUTTON', TRUE);
article_set_field('hint', 'Unfortunately at this time, the amount available is only '.$unit.' please select an amount equal to or less than '.$unit.'');
} else {
article_set_field('HIDE_ORDERBUTTON', FALSE);
article_set_field('hint', '');
}


Thank you very much
User avatar
Pills
Forum Admin
Posts: 312
Joined: Wed Jul 02, 2003 1:14 pm
Location: Long Island, NY
Contact:

Postby Pills » Mon Feb 23, 2004 4:01 am

As this has absolutely nothing to do with IRC, moved to off-topic.
admin, irc.umich.edu
oper, irc.servercentral.net
User avatar
munky
Site Admin
Posts: 826
Joined: Wed Jul 02, 2003 4:54 pm
Location: Phoenix AZ
Contact:

Postby munky » Mon Feb 23, 2004 2:14 pm

the simple way to change color is <font color=red>red text</font>
you can be fancier by using style sheets, but i'll leave that to web tutorials to teach you that

assuming this code:
$unit = article_get_field('stock');
if(article_get_field('stock') < article_get_field('count')){
article_set_field('HIDE_ORDERBUTTON', TRUE);
article_set_field('hint', 'Unfortunately at this time, the amount available is only '.$unit.' please select an amount equal to or less than '.$unit.'');
} else {
article_set_field('HIDE_ORDERBUTTON', FALSE);
article_set_field('hint', '');
}
is using pre-defined functions, you can do something like this:
$unit = article_get_field('stock');
if(article_get_field('stock') < article_get_field('count')){
article_set_field('HIDE_ORDERBUTTON', TRUE);
article_set_field('hint', 'Unfortunately at this time, the amount available is only '.$unit.' please select an amount equal to or less than '.$unit.'');
} elseif( article_get_field('stock') == 0 ) {
article_set_field('HIDE_ORDERBUTTON', TRUE);
article_set_field('hint', 'We are out of this item at this time.');
} else {
article_set_field('HIDE_ORDERBUTTON', FALSE);
article_set_field('hint', '');
}
In God we trust,
Everyone else must have an X.509 certificate.

Who is online

Users browsing this forum: No registered users and 4 guests