Page 1 of 1

Desperately need PHP help Please

Posted: Mon Feb 23, 2004 1:16 am
by royally confused
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

Posted: Mon Feb 23, 2004 4:01 am
by Pills
As this has absolutely nothing to do with IRC, moved to off-topic.

Posted: Mon Feb 23, 2004 2:14 pm
by munky
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', '');
}