Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Language Description Boxes in Tabs


Recommended Posts

<!-- BOF Separate Pricing Per Customer - QPBPP for SPPC - in tabbed menu -->
	  <tr>
		<td colspan="2">
		  <div id="qpbpp" class="cgtabs">
			<ul class="tabnav"> <?php
			  foreach ($_hide_customers_group as $key => $cust_groups) {
				echo '  <li><a href="#pricebreak-' . $cust_groups['customers_group_id'] . '">' . $cust_groups['customers_group_name'] . '</a></li>' ."\n";
			  }
			?>
			</ul>
<?php
foreach ($_hide_customers_group as $key => $cust_groups) {
  $CustGroupID = $cust_groups['customers_group_id'];
?>
			  <div id="pricebreak-<?php echo $languages[$i]['id']; ?>" class="tabdiv">
				<table border="0" width="100%">
				  <tr bgcolor="#ebebff">
					<td class="main"><?php echo ENTRY_CUSTOMERS_GROUP_NAME ?></td>
					<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $cust_groups['customers_group_name']; ?></td>
				  </tr>
				  <tr bgcolor="#fffff">
					<td class="main" colspan="2"><small><i><?php if ($CustGroupID != 0) echo TEXT_CUSTOMERS_GROUPS_NOTE; ?></i></small></td>
				  </tr>
				  <tr bgcolor="#fffff">
					<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET ?></td>
					<td class="main"><?php
					if ($CustGroupID != 0) {
					  if (isset($pInfo->sppcoption)) {
						echo tep_draw_checkbox_field('sppcoption[' . $CustGroupID . ']', 'sppcoption[' . $CustGroupID . ']', (isset($pInfo->sppcoption[$CustGroupID])) ? 1: 0);
					  } else {
						echo tep_draw_checkbox_field('sppcoption[' . $CustGroupID . ']', 'sppcoption[' . $CustGroupID . ']', true);
					  }
						if (isset($pInfo->sppcprice[$CustGroupID])) { 
						  $sppc_cg_price = $pInfo->sppcprice[$CustGroupID];
						} else { // nothing in the db, nothing in the post variables
						  $sppc_cg_price = '';
						}
						echo ' ' . tep_draw_input_field('sppcprice[' . $CustGroupID . ']', $sppc_cg_price );
					} else {
					  echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_retail_net', $pInfo->products_price, 'readonly');
					} // end if/else ($CustGroupID != 0) ?>
					</td>
				  </tr>
				  <tr bgcolor="#ebebff">
					<td class="main"><?php echo TEXT_DISCOUNT_CATEGORY ?></td>
					<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('discount_categories_id[' . $CustGroupID . ']', $discount_categories_array, $pInfo->discount_categories_id[$CustGroupID]) . tep_draw_hidden_field('current_discount_cat_id[' . $CustGroupID . ']', (isset($pInfo->current_discount_cat_id[$CustGroupID]) ? (int)$pInfo->current_discount_cat_id[$CustGroupID] : $pInfo->discount_categories_id[$CustGroupID])); ?></td>
				  </tr>
				  <tr bgcolor="#ffffff">
					<td class="main"><?php echo TEXT_PRODUCTS_QTY_BLOCKS; ?></td>
					<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_qty_blocks[' . $CustGroupID . ']', $pInfo->products_qty_blocks[$CustGroupID], 'size="10"') . " " . TEXT_PRODUCTS_QTY_BLOCKS_HELP; ?></td>
				  </tr>
				  <tr bgcolor="#ebebff">
					<td class="main"><?php echo TEXT_PRODUCTS_MIN_ORDER_QTY; ?></td>
					<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_min_order_qty[' . $CustGroupID . ']', $pInfo->products_min_order_qty[$CustGroupID], 'size="10"') . " " . TEXT_PRODUCTS_MIN_ORDER_QTY_HELP; ?></td>
				  </tr>
<?php 
$i = 0; // for alternate coloring of rows (zebra striping)
for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) {
  $bgcolor = ($i++ & 1) ? '#ebebff' : '#ffffff'; // for zebra striping
?>
				  <tr bgcolor="<?php echo $bgcolor; ?>">
					<td class="main"><?php echo TEXT_PRODUCTS_PRICE  . " " . ($count + 1); ?></td>
					<td class="main" align="left"> <?php
						if(is_array($pInfo->products_price_break[$CustGroupID]) && array_key_exists($count, $pInfo->products_price_break[$CustGroupID])) {
						  echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_break[' . $CustGroupID .'][' . $count . ']', $pInfo->products_price_break[$CustGroupID][$count], 'size="10"');
						  echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
						  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty[' . $CustGroupID .'][' . $count . ']', $pInfo->products_qty[$CustGroupID][$count], 'size="10"');
						  echo tep_draw_hidden_field('products_price_break_id[' . $CustGroupID .'][' . $count . ']', $pInfo->products_price_break_id[$CustGroupID][$count]);
// only show a delete box for a price break that has been set (needed for when the
// back button is used after a preview
						  if (isset($pInfo->products_price_break_id[$CustGroupID][$count]) && tep_not_null($pInfo->products_price_break_id[$CustGroupID][$count])) {
							echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('products_delete[' . $CustGroupID .'][' . $count . ']', 'y', (isset($pInfo->products_delete[$CustGroupID][$count]) ? 1 : 0)) . TEXT_PRODUCTS_DELETE;
						  }
						} else {
						  echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_break[' . $CustGroupID .'][' . $count . ']', '', 'size="10"');
						  echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
						  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty[' . $CustGroupID .'][' . $count . ']', '', 'size="10"');
						} ?>
					</td>
				  </tr>
<?php
  } // end for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++)
?>
				</table>
			  </div>
<?php
} // end foreach ($_hide_customers_group as $key => $cust_groups)
?>
		  </div>
		</td>
	  </tr>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
<!-- EOF  Separate Pricing Per Customer - QPBPP for SPPC - in tabbed menu -->

================================================================================

=====

How can I take the idea of the Tabs and use them for my Product Description Language Fields

 

<?php
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
	  <tr>
		<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
		<td><table border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
			<!-- <td class="main"><?php // echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td> -->
			<td class="main"><?php echo tep_draw_fckeditor('products_description[' . $languages[$i]['id'] . ']','600','300',(isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
		  </tr>
		</table></td>
	  </tr>
<?php
}
?>

 

This would save so much space on the page and make life easier for the end user. I understand how the code works, but I'm not having any luck on making it work for me on the product descriptions. . . Please note that I have FCK editor installed. . .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...