Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Latest Product - set radio button to NO


Guest

Recommended Posts

Posted

Hi Oscommerce users,

 

Contri Latest Product, you can set in categories.php to be a product "latest" or not. ( YES or NO)

 

Can anyone help me with following "problem". I want to set radio button option "NO" in de categories.php to be default.

Now default is radio button is "YES".

 

The codes in categories.php for latest products are:

 

1)

if (!isset($pInfo->latest_product)) $pInfo->latest_product = '1';

switch ($pInfo->latest_product) {

case '0': $in_status1 = false; $out_status1 = true; break;

case '1':

default: $in_status1 = true; $out_status1 = false;

}

 

 

2)

 

<tr>

<td class="main"><?php echo 'Latest Products'; ?></td>

<td>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('latest_product', '1', $in_status1) . ' Yes ' . tep_draw_radio_field('latest_product', '0', $out_status1) . ' No'; ?></td>

</td>

</tr>

 

3) I have tried in phpmyamin to set the standard value to "0" and "1" but nothing happens, the radio button keeps on "YES".

 

Is there something that i am doing wrong? Or is it a bug in the code?

 

Thank you in advance for your help.

 

Regards,

Rob Veraar

Posted

Try changing

	if (!isset($pInfo->latest_product)) $pInfo->latest_product = '1';
switch ($pInfo->latest_product) {
  case '0': $in_status1 = false; $out_status1 = true; break;
  case '1':
  default: $in_status1 = true; $out_status1 = false;
}

to

	if (!isset($pInfo->latest_product)) $pInfo->latest_product = '1';
switch ($pInfo->latest_product) {
  case '1': $in_status1 = true; $out_status1 = false; break;
  case '0':
  default: $in_status1 = false; $out_status1 = true;
}

Posted

Thank you very much!

That did the job...

 

Regards,

Rob

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...