Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Tab Menu Section (TMS) and Pronux TMS For Admin Support Thread


Pronux

Recommended Posts

Oups ! :blush: I no longer data ..

 

array3.png

 

Here is the code:

 

go deeper:

 

foreach($info_box_contents as $row)
{
 foreach($row as $value)
 {
    $TMS->tab[1]['content'] .= $value;  
 }
}

Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System

About Pronux | Pronux Contributions and Add-Ons

Link to comment
Share on other sites

I have more "array"

 

ArrayArrayArrayArrayArrayArrayArray

 

:huh:

 

last try:

foreach($info_box_contents as $row)
{
  foreach($row as $row2)
  {
     foreach($row2 as $value)
     {
         $TMS->tab[1]['content'] .= $value;  
     }
  }
}

Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System

About Pronux | Pronux Contributions and Add-Ons

Link to comment
Share on other sites

last try:

foreach($info_box_contents as $row)
{
  foreach($row as $row2)
  {
     foreach($row2 as $value)
     {
         $TMS->tab[1]['content'] .= $value;  
     }
  }
}

 

 

Ahh yes !!

 

yes.png

 

In the cons column no longer works, I have only one column. :blush:

 

Thank you Mr Pronux :D

Edited by mamegaga
Link to comment
Share on other sites

  • 4 weeks later...

Hello,

 

I use last version of TMS and works well at this moment. Thanks for this good contrib Pronux.

I use TMS not in product page, but i include it in the header. I use it like seearch engine for my 3/4 main categories with specific filer fields in each tab.

 

My question is : Is it possible to keep the state of the selected tab if we move from one to another page ?

 

Thx for your info or maybe your advises on how to do :)

 

HaaGeN

Link to comment
Share on other sites

Hello,

 

I use last version of TMS and works well at this moment. Thanks for this good contrib Pronux.

I use TMS not in product page, but i include it in the header. I use it like seearch engine for my 3/4 main categories with specific filer fields in each tab.

 

My question is : Is it possible to keep the state of the selected tab if we move from one to another page ?

 

Thx for your info or maybe your advises on how to do :)

 

HaaGeN

 

Hi,

 

The only way in my view is to store the selected (active) tab in the $_SESSION. Due to time constraints I can't give you a code example.

Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System

About Pronux | Pronux Contributions and Add-Ons

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

 

First, thank you Pronux for the great TMS contribution!

Works fine, but I have a little problem/question.

 

I have a code that shows the number of items in stock at the

product info page.

Here is the code:

 

<div id="QuantityPROD">
<?php if ($product_info['products_quantity'] > 0) { ?>
<?php echo TEXT_PRODUCT_IN_STOCK; ?>
<?php echo $product_info['products_quantity']; ?>
</div>	
<div id="QuantityPROD2">
<?php } else { ?>	
<?php echo TEXT_PRODCUT_OUT_OF_STOCK; ?>
<?php echo $product_info['products_quantity']; ?>)
<?php } ?>
</div>

 

Unfortunately, I can`t link this code for the tab. If I use syntax $any = ''; i get a parse error message.

Can you help me, how do i displaying stock quantity (with my code) of the product in a tab?

Sorry my English, but I hope you understand my question...

 

Thank you!

regards

Edited by PanTira
Link to comment
Share on other sites

  • 1 month later...

 

somewhere around: 634 <=== this is the part for Pronux add-on

 

<script language="javascript"><!--

updateGross();

//--></script>

<?php

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<tr>

<td class="main1" 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>

</tr>

</table></td>

</tr>

<?php

}

?>

 

 

 

 

 

 

<?php

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<tr>

<td class="main1" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_SPECIFICATION; ?></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_specification[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_specification[$languages[$i]['id']]) ? stripslashes($products_specification[$languages[$i]['id']]) : tep_get_products_specification($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

 

 

<?php

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

?>

<tr>

<td class="main1" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_EXTRA_INFO; ?></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_extra_info[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_extra_info[$languages[$i]['id']]) ? stripslashes($products_extra_info[$languages[$i]['id']]) : tep_get_products_extra_info($pInfo->products_id, $languages[$i]['id']))); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

 

Hi,

 

The above works in Admin, but it is just showing as table and not showing up as tab in Admin.

 

Can we edit the above so that it can be shown as tab in Admin just like the product info page?

 

This is what Pronux gave in the instruction, but it is only suitable for multi-language descriptions and is not for single language different descriptions.

 

<?php //PRONUX TMS START ?>
 <tr>
   <td class="main" valign="top"><?php echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
   <td style="padding-left: 30px">

   <?php          

       include DIR_WS_INCLUDES.'TMS/Conf.php';    

       $tabNo = 0;
       for ($i=0, $n=sizeof($languages); $i<$n; $i++)
       {                    
          $tabNo = $i + 1;                                  
          $TMS->tab[$tabNo]['name']    = tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']);                  
          $TMS->tab[$tabNo]['content'] = 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'])));                                                                                                                           
          $TMS->tab[$tabNo]['content'] = str_ireplace('<textarea ', '<textarea style="width: 100%; height: 100%" ', $TMS->tab[$tabNo]['content']);
       }

       $TMS->setNoOfTabs($tabNo);
       $TMS->generateTabMenuSection(true, false);          
   ?>

   </td>
 </tr>
<?php //PRONUX TMS END ?>  

 

Appreciate if someone can help in coding the categories.php file in the admin page so that tabs to be used in the Admin page as well. Thanks!

 

(If someone is interested to see how the Tabs work in an actual site, please see:

 

http://shashinki.com/shop/used-canon-580ex-flash-speedlite-speedlight-near-canon-malaysia-warranty-till-sept-2011-p-7229.html

)

Edited by khoking

Best regards,

Koh Kho King

Link to comment
Share on other sites

I found a bug...not sure if it is on my site only or if it a general bug.

 

If I have content in Tab 1 and Tab 3 but NOT Tab 2, then there will be some alignment error.

 

In the above case, if I click Tab 3, then click Tab 1, error. Tab 1 will be showing both Tab 1 and Tab 3 contents at the bottom.

Best regards,

Koh Kho King

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...
  • 2 weeks later...

I would like to move the Product Attributes into one of the tabs. I have tried using functions and array. Yet it just seems to disappear once I move the code inside of one of the tabs. Here is the code I have selected on the product_info.php page. Any help would be greatly appreciated. Viewable here http://hughesauctions.net/product_info.php/1964-silver-quarter-and-half-dollar-p-35#!tab1

 

<?php

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

$products_attributes = tep_db_fetch_array($products_attributes_query);

if ($products_attributes['total'] > 0) {

 

echo '<p>' . TEXT_PRODUCT_OPTIONS;

echo '</p><p>';

 

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

 

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

$products_options_array = array();

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

 

echo '<strong>' . $products_options_name['products_options_name'] . ':';

echo '</strong><br />' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute);

echo '<br />';

 

}

 

echo '</p>';

 

}

 

echo '<div style="clear: both;"></div>';

 

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {

 

echo '<p style="text-align: center;">'. sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])).'</p>';

 

}

?>

Edited by dbznss
Link to comment
Share on other sites

  • 1 month later...

Hello,

 

I just installed TMS on my website. I want to display product information like UPC, platform, rating all under a tab called "Notes". I've tried several different approach including echo statements with no success.

 

Thanks for your help.

Link to comment
Share on other sites

************************

4. ADD TO DATABASE: products_description

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

products_specification

products_extra_info

*************************************

 

How do you set it to the database???

 

I know it should be something clear to know but I am a beginner. :)

help plz?...

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

I am having the following issue. It only exists in IE, the code works perfectly with Firefox. What I am trying to do is have different colors between the active and inactive tabs as well as applying the style in use on the rest of my site.

 

In TabMenuSection.php, I have the following code:

 

$tabName = $this->getTabName($x);

$normalDivTab = '<div id="pronuxTab'.$x.'" class="pronuxTabNormal" style="background: #'.$this->CONF['tabColor1'].'; height: '.$this->CONF['tabHeight'].'px; width: '.$this->getTabWidth($x).'px;">';

 

if(!empty($tabName) || $x < $noOfTabsCalculated)

{

$menu .= $normalDivTab;

$menu .= ' <a class="pronuxLink" onfocus="this.blur()" style="padding-top: '.$this->CONF['tabPaddingTop'].'px; height: '.$this->CONF['tabHeight'].'px; line-height: '.$this->CONF['tabHeight'].'px; width: '.$this->getTabWidth($x).'px;" href="'.$this->getPageURL().'#!tab'.$x.'" onmouseover="this.style.textDecoration = \'none\'" onclick="setTab('.$x.')">'.$tabName.'</a>';

 

 

$menu .= '</div>';

$menu .= $borderDiv;

}

else if($this->getTabWidth($x) <= 0)

{

continue;

}

else

{

if($this->CONF['useATabAsPlaceholder'])

{

$menu .= str_replace('id="pronuxTab'.$x.'" ', '', $normalDivTab);

$menu .= '</div>';

$menu .= $borderDiv;

}

else

{

$menu .= '<div class="pronuxTabEmpty" style="height: '.($this->CONF['tabHeight'] + 1).'px; width: '.($this->getTabWidth($x)+1).'px;"></div>';

}

continue;

}

$tabContent .= '<div id="tabContent'.$x.'" class="pronuxOuterContentBox" style="background-color: #'.$this->CONF['outercontentboxBackgroundColor'].'; width: '.$this->CONF['totalWidth'].'px;">';

$tabContent .= '<div class="pronuxContentBox" style="min-height: '.$this->CONF['defaultContentSectionHeight'].'px; height: '.$this->CONF['defaultContentSectionHeight'].'px;">';

$tabContent .= $this->getContentForTab($x);

$tabContent .= '</div></div>';

}

 

$menu .= '<div style="float: left;">';

$menu .= $tabContent;

$menu .= '</div>';

$menu .= '</div><script type="text/javascript">';

 

 

$startJScript = "if(document.getElementById('pronuxTab' + self.document.location.hash.substr(5,1)) != null)

{

setTab(self.document.location.hash.substr(5,1));

}

else

{

setTab(1);

}";

if(!empty($_GET['_escaped_fragment_']))

{

if(strlen($_GET['_escaped_fragment_']) == 4)

{

$startJScript = 'setTab('.substr($_GET['_escaped_fragment_'],-1).');';

}

else if(strlen($_GET['_escaped_fragment_']) == 5)

{

$startJScript = 'setTab('.substr($_GET['_escaped_fragment_'],-2).');';

}

}

$menu .='/* <![CDATA[ */';

$menu .= $startJScript;

$menu .= 'function setTab(tabNo){

for(

z=1;

z<100;

z++)

{

tab = document.getElementById(\'pronuxTab\' + z);

if(tab == null)

{

break;

}

tab.style.borderBottomColor = \'#C1C2C6\';

tab.style.background = \'#'.$this->CONF['tabColor1'].'\';

document.getElementById(\'tabContent\' + z).style.display = \'none\';

}document.getElementById(\'pronuxTab\' + tabNo).style.background = \'#'.$this->CONF['contentBackgroundColor'].'\';

document.getElementById(\'pronuxTab\' + tabNo).style.borderBottomColor = \'#'.$this->CONF['contentBackgroundColor'].'\';

document.getElementById(\'tabContent\' + tabNo).style.display = \'block\';

}';

$menu .='/* ]]> */';

$menu .='</script>';

$menu = str_replace("\n", '', $menu);

$menu = str_replace("\r", '', $menu);

$menu = str_replace("\t", '', $menu);

if($printMenu)

{

echo $menu;

}

 

return $menu;

 

In Conf.php I have:

 

$CONF['contentBackgroundColor'] = '41b7c8 url(../mts/themes/ui/tgi-theme/images/ui-bg_gloss-wave_75_41b7c8_500x100.png) 50% 50% repeat-x';

 

$CONF['tabColor1'] = 'b7d30b url(../mts/themes/ui/tgi-theme/images/ui-bg_gloss-wave_50_b7d30b_500x100.png) 50% 50% repeat-x';

$CONF['outercontentboxBackgroundColor'] = 'f8f8f9';

 

With this, the tab portions show correctly with the correct format, but the tab content sections completely disappear. No info box is drawn. This is in IE only.

 

If I change to just:

 

$CONF['contentBackgroundColor'] = '41b7c8';

 

 

The background color is fine and the tab content shows, but the style of the tab is not correct.

 

Anyone have any ideas what is driving this in internet explorer? As I said, it works great in Firefox.

 

Thank you so much!

Link to comment
Share on other sites

Pretty cool so far but in my site the tabs appear all the way at the bottom left. I noticed that the TabMenuSection.php has the .css path pointing at TabMenuSectionStyles.css so I did not modify the stylesheet.css located under catalog/ but this makes the tabs weird and creates a blank square at the top.

 

Next step I added the styles from TabMenuSectionStyles.css to stylesheet.css and it makes the tabs look the way they are supposed to work but this way is when I get them all the way at the bottom left.

 

Obviously is something with the css files but I tried everything I could think of. Has anybody experienced this? Thanks!

Link to comment
Share on other sites

Hello.

I'm new here, my knowledge of PHP SQL etc. is very basic, so have mercy.

 

Read through this forum and could not realy find the same issue/question.

 

After trying several different approaches I did not manage to get this work the way I wan't to.

Added fields to the database and all works.

I managed to get it to work in admin, the problem is that the layout of the admin pages is now destroyed.

 

About: "Tab menu section (TMS)"

 

I managed to ad the extra fields to the admin products page, naming of the tms tabs products_description1 to 3.

 

Like this.

 

[codebox

$TMS->tab[1]['content'] = $product_info['products_description1'];

$TMS->tab[2]['content'] = $product_info['products_description2'];

$TMS->tab[3]['content'] = $product_info['products_description3'];

 

ITested what was needed for basic input and output.

These are the changes needed: (searched: products_description1)

 

[codebox]

C:\server\www\myserver.dev\public_html\oscom1\oscom2\categories.php (10 hits)

Line 271: 'products_description1' => tep_db_prepare_input($HTTP_POST_VARS['products_description1'][$language_id]),

Line 271: 'products_description1' => tep_db_prepare_input($HTTP_POST_VARS['products_description1'][$language_id]),

Line 625: $TMS->tab[$tabNo]['content'] = tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id'])));

Line 625: $TMS->tab[$tabNo]['content'] = tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id'])));

Line 625: $TMS->tab[$tabNo]['content'] = tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id'])));

Line 625: $TMS->tab[$tabNo]['content'] = tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id'])));

Line 711: <td class="main"><?php echo tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id']))); ?></td>

Line 711: <td class="main"><?php echo tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id']))); ?></td>

Line 711: <td class="main"><?php echo tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id']))); ?></td>

Line 711: <td class="main"><?php echo tep_draw_textarea_field('products_description1[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description1[$languages[$i]['id']]) ? stripslashes($products_description1[$languages[$i]['id']]) : tep_get_products_description1($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

C:\server\www\myserver.dev\public_html\oscommerce\admin\includes\functions\general.php (3 hits)

 

Line 552: function tep_get_products_description1($product_id, $language_id) {

Line 553: $product_query = tep_db_query("select products_description1 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");

Line 556: return $product['products_description1'];

C:\server\www\myserver.dev\public_html\oscommerce\product_info.php (2 hits)

 

Line 37: $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, pd.products_description1, pd.products_description2, pd.products_description3, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

Line 216: $TMS->tab[1]['content'] = $product_info['products_description1'];

[codebox]

 

(Don't realy know what I have done, only copied some code where I found products_description.)

 

 

config:

oscommerce 2.3.1

Windows 7 Ultimate Edition Service Pack 1 (64bit)

Apache/2.2.21 (Win32) PHP/5.3.8

Link to comment
Share on other sites

OK, lets forget my first two posts.

 

In responce to Dutchman's post (no 97)

 

For this to function (I think) you need less lines to change?

 

If you add a column to the database table products_description and want to make it editable in the admin area:

You can use tab[1] as an example (change products_description in whatever (you like)).

(I have shortened the codelines)

 

GO TO: Catalog\product_info.php

In Line 37 (on clean install) ad: " pd.whatever,"):

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, pd.whatever, p.products_model, p.products_quantity,

 

GO TO: catalog\admin\includes\functions\general.php

Copy (and place under) line 545 to 550 (on clean install) and change products_description (second long line) in whatever (3x)

 

function tep_get_whatever($product_id, $language_id) {

$product_query = tep_db_query("select whatever from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and langua

$product = tep_db_fetch_array($product_query);

 

return $product['whatever'];

}

 

GO TO: catalog\admin\categories.php

Copy (and place under) line 252 (on clean install) and change products_description in whatever (2x)

 

'whatever' => tep_db_prepare_input($HTTP_POST_VARS['whatever'][$language_id]),

 

Copy (and place under) line 564 to 574 (on clean install) and change products_description (second long line) in whatever (4x)

 

<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'

<td class="main"><?php echo tep_draw_textarea_field('whatever[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($whatever[$languages[$

</tr>

</table></td>

</tr>

 

<tr>

<td colspan=2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

 

OPTIONAL: If you want to make the content searchable:

GO TO: catalog\advanced_search_result.php

In Line 232 on (clean install) ad: " or pd.whatever"):

 

if (isset($HTTP_GET_VARS['search_in_description]) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description or

Link to comment
Share on other sites

  • 3 weeks later...

Trying to display product attributes from, Extra Product Fields, in $TMS->tab[2]. When there are no additional specs. for a product the tab displays ' There are currently no Details for this product'. When there are specs.... it should display all the labels and their values. So far only first label displays and no values.

 

Can any one help with getting code to work in tabs page. live site @

http://www.cheshirec...cts_id=34#!tab2

Working labels and values show up between 'write review' button and 'overview' tab, would like it inside tabs page, instead.

 

 

// begin Extra Product Fields
 foreach ($epf as $e) {
$mt = ($e['uses_list'] && !$e['multi_select'] ? ($product_info[$e['field']] == 0) : !tep_not_null($product_info[$e['field']]));
if (!$mt) { // only display if information is set for product
  echo '<b>' . $e['label'] . ': </b>';
  if ($e['uses_list']) {
	if ($e['multi_select']) {
	  $values = explode('|', trim($product_info[$e['field']], '|'));
	  $listing = array();
	  foreach ($values as $val) {
		$listing[] = tep_get_extra_field_list_value($val, $e['show_chain'], $e['display_type']);
}
	  echo implode(', ', $listing);
	} else {
	  echo tep_get_extra_field_list_value($product_info[$e['field']], $e['show_chain'], $e['display_type']);
 //$productspecs = '<b>' . $e['label'] . ': </b>' . $product_info[$e['field']];
 }
  } else {
	echo $product_info[$e['field']];
  }
  echo '<br>';
  } else {
  $productspecs = ' There are currently no Details for this product';
}
 }
 // end Extra Product Fields
$TMS->tab[2]['content'] = $productspecs;

Link to comment
Share on other sites

NM. Finally got it. For any one who is trying to get TMS and Extra Product Fields 2.3.1 to work...

 

// ========begin Extra Product Fields========
 foreach ($epf as $e) {
   $mt = ($e['uses_list'] && !$e['multi_select'] ? ($product_info[$e['field']] == 0) : !tep_not_null($product_info[$e['field']]));
   if (!$mt) {
  //echo '<b>' . $e['label'] . ': </b>';
  if ($e['uses_list']) {
    if ($e['multi_select']) {
	  $values = explode('|', trim($product_info[$e['field']], '|'));
	  $listing = array();
	  foreach ($values as $val) {
	    $listing[] = tep_get_extra_field_list_value($val, $e['show_chain'], $e['display_type']);
   }
   //echo implode(', ', $listing);
   } else {
	  //echo tep_get_extra_field_list_value($product_info[$e['field']], $e['show_chain'], $e['display_type']);
 }
  } else {
    //echo $product_info[$e['field']];
  }
  //echo '<br>';
// --------if $mt define variables for tab--------
if ($e['uses_list']) {
if ($e['multi_select']) {
 $productdestails = implode(', ', $listing);
} else {
 $productdestails = tep_get_extra_field_list_value($product_info[$e['field']], $e['show_chain'], $e['display_type']);
}} else {
    $productdestails = $product_info[$e['field']];}
 $productspecs .= '<b>' . $e['label'] . ': </b> ' . $productdestails . '<br><br>';
//--------end tab variable--------
} else {
// --------in not $mt echo place holder text--------
  $productspecs = ' There are currently no Details for this product';
   }  }
 // ========end Extra Product Fields========
$TMS->tab[2]['content'] = $productspecs;

Link to comment
Share on other sites

  • 2 weeks later...

Limitations in parsing code within tab content...?

 

Easily got basic tab function, no problem there. But problems occurred when I added content to Tab 1 by trying to "include" a modified Product_Listing.php.

 

Let me qualify by saying, I have done some very sophisticated coding, so I am not an amateur but I am not a pro's pro. I like design, hate tedious coding but have hacked my way thru a lot of it and come up with some good stuff. And I tend to learn the hard way, so maybe I am going about this all wrong.

 

First, to get Product_Listing.php into the tab content, I had to do this with some tricks:

 

$html = get_include_contents(DIR_WS_INCLUDES . 'product_listing.php');

function get_include_contents($filename) {

if (is_file($filename)) {

ob_start();

include $filename;

return ob_get_clean();

}

return "";

}

$TMS->tab[1]['content'] = '<div><table>' . $html . '</table></div>';

 

 

First error came from not recognizing the "currencies" class (used in Product_Listing.php) within the tab. Had to rename the class and its functions and include the new class code in the product_listing.php that was pulled into the tab content. Actually got it working that way.

 

However, there does appear to be limitations when "including" code within the tab and passing variables to tab content. Am I correct in this? Is there a better way? Or is this an incorrect usage of TMS. I sure like the way the TMS tabs visually perform as opposed to some others I have tried, which look clumsy as they materialize on the screen.

Link to comment
Share on other sites

  • 2 weeks later...

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...