Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Coding help: new product page


Recidivist

Recommended Posts

Hi,

 

I've added some new fields on my product entry page and have set them as radio buttons by replicating the code used for the product status:

 

if (!isset($pInfo->products_seals_buytry)) $pInfo->products_seals_buytry = '1';
switch ($pInfo->products_seals_buytry) {
  case '0': $seal_buytry_on_status = false; $seal_buytry_off_status = true; break;
  case '1':
  default: $seal_buytry_off_status = true; $seal_buytry_on_status = false;
}

 

and

 

<tr>
		<td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>
	  </tr>

 

I have added my entries into the db and am displaying the items on product_info.php using the following:

 

if ($product_info['products_seals_buytry'] != '0') {
	echo 'My Text Here';
	}

 

... where the entry in the db is either 0 (off) or 1 (on).

 

This works great. However, I am having difficulty getting the status for each new field (on or off) to show in the radio buttons when I re-edit the product. It works well for the first new field, but I have four more and as soon as I try those the status no longer shows correctly.

 

Am I assigning the status correctly in the first set of code?

 

Cheers

 

KB

Network Webcams - The IP Camera Specialists

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...