Howmessages Posted November 25, 2016 Share Posted November 25, 2016 With the latest version of the versions of Gburtons Bootstrap osCommerce, the order pages of the admin side has these tabs for customers, products and status. This is a nice way to get things organized without having a full page of information. Now I like to do something similar on the product page that costumers can see. Tabs underneath the product info that costumers can click to reveal the specifications, reviews, status and/or maybe something else. A screenshot of my idea how it should look: Imgur: fIImN33.png This wil keep the page clean, especially for the mobiel view. Best would be to make this a module that's easy to install and uninstall. Maybe some others are willing to try and code this with me. Quote Link to comment Share on other sites More sharing options...
ArtcoInc Posted November 25, 2016 Share Posted November 25, 2016 (edited) @@Howmessages @@burt has made a commercial product that has this feature. Look at day # 23 here: http://www.28daysofcode.com/ HTH Malcolm PS: There was also a thread discussing this before ... http://www.oscommerce.com/forums/topic/398352-234bs-tabs-in-product-info/ Edited November 25, 2016 by ArtcoInc Quote Link to comment Share on other sites More sharing options...
milerwan Posted November 26, 2016 Share Posted November 26, 2016 (edited) @@HowmessagesHere is the script to add to the product_info file to have bootstrap nav tabs : <div class="contentContainer"> <div class="contentText" <!-- Nav tabs --> <ul class="nav nav-pills" role="tablist"> <li role="presentation" class="active"><a href="#descriptive" aria-controls="descriptive" role="tab" data-toggle="tab"><?php echo TEXT_DESCRIPTIVE; ?></a></li> <?php if (tep_not_null($product_info['products_nav_tabs_text_1'])) { ?> <li role="presentation"><a href="#nav_tabs_1" aria-controls="nav_tabs_1" role="tab" data-toggle="tab"> <?php echo $product_info['products_nav_tabs_title_1']; ?></a></li> <?php } if (tep_not_null($product_info['products_nav_tabs_text_2'])) { ?> <li role="presentation"><a href="#nav_tabs_2" aria-controls="nav_tabs_2" role="tab" data-toggle="tab"> <?php echo $product_info['products_nav_tabs_title_2']; ?></a></li> <?php } ?> <li role="presentation"><a href="#reviews" aria-controls="reviews" role="tab" data-toggle="tab"><?php echo TEXT_REVIEWS; ?></a></li> <?php // also_purchase tab start $orders_query = tep_db_query("select p.products_id, p.products_image, pd.products_name from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); $num_products_ordered = tep_db_num_rows($orders_query); if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) { ?> <li role="presentation"><a href="#also_purchased" aria-controls="also_purchased" role="tab" data-toggle="tab"><?php echo TEXT_ALSO_PURCHASED; ?></a></li> <?php } // also_purchase tab end ?> </ul> <br> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="descriptive" itemprop="description"> <?php echo stripslashes($product_info['products_description']); ?> </div> <?php if (tep_not_null($product_info['products_nav_tabs_text_1'])) { ?> <div role="tabpanel" class="tab-pane main" id="nav_tabs_1" itemprop="description"><?php echo $product_info['products_nav_tabs_text_1']; ?></div> <?php } if (tep_not_null($product_info['products_nav_tabs_text_2'])) { ?> <div role="tabpanel" class="tab-pane main" id="nav_tabs_2" itemprop="description"><?php echo $product_info['products_nav_tabs_text_2']; ?></div> <?php } ?> <div role="tabpanel" class="tab-pane" id="reviews"> <!-- début --> <?php $reviews_query_raw = "select r.reviews_id, SUBSTRING_INDEX(rd.reviews_text, ' ', 20) as reviews_text, r.reviews_rating, date(r.date_added) as date_added, c.customers_firstname, c.customers_lastname from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_CUSTOMERS . " c where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and r.customers_id = c.customers_id and rd.languages_id = '" . (int)$languages_id . "' and r.reviews_status = 1 order by r.date_added DESC"; $reviews_split = new splitPageResults($reviews_query_raw, '4'); if ($reviews_split->number_of_rows > 0) { ?> <h4><?php echo TEXT_LAST_REVIEWS; ?></h4> <hr> <div class="reviews"> <!-- ADD anonymous reviews --> <?php $reviews_query = tep_db_query($reviews_split->sql_query); while ($reviews = tep_db_fetch_array($reviews_query)) { $review_name = tep_output_string_protected($reviews['customers_firstname'] . ' ' . substr($reviews['customers_lastname'], 0, 1) . '.'); ?> <!-- END anonymous reviews --> <blockquote class="col-sm-6" itemprop="review" itemscope itemtype="http://schema.org/Review"> <p itemprop="reviewBody"><?php echo tep_output_string_protected($reviews['reviews_text']) . ' ...' ?></p> <meta itemprop="datePublished" content="<?php echo $reviews['date_added']; ?>"> <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <meta itemprop="ratingValue" content="<?php echo (int)$reviews['reviews_rating']; ?>"></span> <footer><?php echo sprintf(REVIEWS_TEXT_RATED, tep_draw_stars($reviews['reviews_rating']), $review_name, $review_name); ?></footer> <span style="margin-top:5px;" class="pull-right xsmall"><?php echo REVIEWS_TEXT_POSTED . ' ' . tep_date_long($reviews['date_added']); ?></span> </blockquote> <?php } ?> </div> <div class="clearfix"></div> <?php } else { ?> <div class="alert alert-info"> <?php echo TEXT_NO_REVIEWS; ?> </div> <?php } ?> <br> <?php if ($reviews_split->number_of_rows > 0) { ?> <div class="row col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'fa fa-commenting', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></div> <?php } else { ?> <div class="row col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'fa fa-commenting', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></a></div> <?php } ?> <div class="clearfix"></div> </div> <!-- fin --> <div role="tabpanel" class="tab-pane main" id="also_purchased"> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } ?> </div> </div> </div> And in admin/categories.php file, you must add/adapt these entries:- products_nav_tabs_title_1- products_nav_tabs_title_2- products_nav_tabs_text_1- products_nav_tabs_text_2Like this : $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]), 'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]), 'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]), // Nav Tabs 'products_nav_tabs_title_1' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_title_1'][$language_id]), 'products_nav_tabs_title_2' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_title_2'][$language_id]), 'products_nav_tabs_text_1' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_text_1'][$language_id]), 'products_nav_tabs_text_2' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_text_2'][$language_id])); // Nav Tabs and $description_query = tep_db_query("select language_id, products_name, products_description, products_nav_tabs_title_1, products_nav_tabs_title_2, products_nav_tabs_text_1, products_nav_tabs_text_2, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'"); while ($description = tep_db_fetch_array($description_query)) { tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_nav_tabs_title_1, products_nav_tabs_title_2, products_nav_tabs_text_1, products_nav_tabs_text_2, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_nav_tabs_title_1']) . "', '" . tep_db_input($description['products_nav_tabs_title_2']) . "', '" . tep_db_input($description['products_nav_tabs_text_1']) . "', '" . tep_db_input($description['products_nav_tabs_text_2']) . "', '" . tep_db_input($description['products_url']) . "', '0')"); } and $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_nav_tabs_title_1, pd.products_nav_tabs_title_2, pd.products_nav_tabs_text_1, pd.products_nav_tabs_text_2, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_availability, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); and above the textarea description windows: <!-- Nav Tabs --> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td colspan="2" class="main"><hr></td> </tr> <tr> <td colspan="2" class="main"><?php echo TEXT_PRODUCTS_NAV_TABS; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" cellspacing="0" cellpadding="0"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . ' ' . tep_draw_input_field('products_nav_tabs_title_1[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_nav_tabs_title_1($pInfo->products_id, $languages[$i]['id'])), 'size="30"'); ?></td> <tr> <td class="main" valign="top"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_nav_tabs_text_1[' . $languages[$i]['id'] . ']', 'soft', '60', '4', (isset($products_nav_tabs_text_1[$languages[$i]['id']]) ? stripslashes($products_nav_tabs_text_1[$languages[$i]['id']]) : tep_get_products_nav_tabs_text_1($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '20', '1'); ?></td> <td><table border="0" cellspacing="0" cellpadding="0"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . ' ' . tep_draw_input_field('products_nav_tabs_title_2[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_nav_tabs_title_2($pInfo->products_id, $languages[$i]['id'])), 'size="30"'); ?></td> <tr> <td class="main" valign="top"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_nav_tabs_text_2[' . $languages[$i]['id'] . ']', 'soft', '60', '4', (isset($products_nav_tabs_text_2[$languages[$i]['id']]) ? stripslashes($products_nav_tabs_text_2[$languages[$i]['id']]) : tep_get_products_nav_tabs_text_2($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } ?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <!-- Nav Tabs --> Finally, you need to create/add in your database / TABLE / "products_description" these entries:- products_nav_tabs_title_1 -> Type varchar(32)- products_nav_tabs_title_2 -> Type varchar(32)- products_nav_tabs_text_1 -> Type text- products_nav_tabs_text_2 -> Type text With these blank entries, you can add for some products specific tabs with their own text. Edited November 26, 2016 by milerwan ArtcoInc 1 Quote Osc v2.3.4 BS "custom" PHP 7.3 compatible (710 modified files => o_O') Link to comment Share on other sites More sharing options...
vampirehunter Posted December 19, 2016 Share Posted December 19, 2016 @@Howmessages Here is the script to add to the product_info file to have bootstrap nav tabs : <div class="contentContainer"> <div class="contentText" <!-- Nav tabs --> <ul class="nav nav-pills" role="tablist"> <li role="presentation" class="active"><a href="#descriptive" aria-controls="descriptive" role="tab" data-toggle="tab"><?php echo TEXT_DESCRIPTIVE; ?></a></li> <?php if (tep_not_null($product_info['products_nav_tabs_text_1'])) { ?> <li role="presentation"><a href="#nav_tabs_1" aria-controls="nav_tabs_1" role="tab" data-toggle="tab"> <?php echo $product_info['products_nav_tabs_title_1']; ?></a></li> <?php } if (tep_not_null($product_info['products_nav_tabs_text_2'])) { ?> <li role="presentation"><a href="#nav_tabs_2" aria-controls="nav_tabs_2" role="tab" data-toggle="tab"> <?php echo $product_info['products_nav_tabs_title_2']; ?></a></li> <?php } ?> <li role="presentation"><a href="#reviews" aria-controls="reviews" role="tab" data-toggle="tab"><?php echo TEXT_REVIEWS; ?></a></li> <?php // also_purchase tab start $orders_query = tep_db_query("select p.products_id, p.products_image, pd.products_name from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); $num_products_ordered = tep_db_num_rows($orders_query); if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) { ?> <li role="presentation"><a href="#also_purchased" aria-controls="also_purchased" role="tab" data-toggle="tab"><?php echo TEXT_ALSO_PURCHASED; ?></a></li> <?php } // also_purchase tab end ?> </ul> <br> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="descriptive" itemprop="description"> <?php echo stripslashes($product_info['products_description']); ?> </div> <?php if (tep_not_null($product_info['products_nav_tabs_text_1'])) { ?> <div role="tabpanel" class="tab-pane main" id="nav_tabs_1" itemprop="description"><?php echo $product_info['products_nav_tabs_text_1']; ?></div> <?php } if (tep_not_null($product_info['products_nav_tabs_text_2'])) { ?> <div role="tabpanel" class="tab-pane main" id="nav_tabs_2" itemprop="description"><?php echo $product_info['products_nav_tabs_text_2']; ?></div> <?php } ?> <div role="tabpanel" class="tab-pane" id="reviews"> <!-- début --> <?php $reviews_query_raw = "select r.reviews_id, SUBSTRING_INDEX(rd.reviews_text, ' ', 20) as reviews_text, r.reviews_rating, date(r.date_added) as date_added, c.customers_firstname, c.customers_lastname from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_CUSTOMERS . " c where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and r.customers_id = c.customers_id and rd.languages_id = '" . (int)$languages_id . "' and r.reviews_status = 1 order by r.date_added DESC"; $reviews_split = new splitPageResults($reviews_query_raw, '4'); if ($reviews_split->number_of_rows > 0) { ?> <h4><?php echo TEXT_LAST_REVIEWS; ?></h4> <hr> <div class="reviews"> <!-- ADD anonymous reviews --> <?php $reviews_query = tep_db_query($reviews_split->sql_query); while ($reviews = tep_db_fetch_array($reviews_query)) { $review_name = tep_output_string_protected($reviews['customers_firstname'] . ' ' . substr($reviews['customers_lastname'], 0, 1) . '.'); ?> <!-- END anonymous reviews --> <blockquote class="col-sm-6" itemprop="review" itemscope itemtype="http://schema.org/Review"> <p itemprop="reviewBody"><?php echo tep_output_string_protected($reviews['reviews_text']) . ' ...' ?></p> <meta itemprop="datePublished" content="<?php echo $reviews['date_added']; ?>"> <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <meta itemprop="ratingValue" content="<?php echo (int)$reviews['reviews_rating']; ?>"></span> <footer><?php echo sprintf(REVIEWS_TEXT_RATED, tep_draw_stars($reviews['reviews_rating']), $review_name, $review_name); ?></footer> <span style="margin-top:5px;" class="pull-right xsmall"><?php echo REVIEWS_TEXT_POSTED . ' ' . tep_date_long($reviews['date_added']); ?></span> </blockquote> <?php } ?> </div> <div class="clearfix"></div> <?php } else { ?> <div class="alert alert-info"> <?php echo TEXT_NO_REVIEWS; ?> </div> <?php } ?> <br> <?php if ($reviews_split->number_of_rows > 0) { ?> <div class="row col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'fa fa-commenting', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></div> <?php } else { ?> <div class="row col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'fa fa-commenting', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></a></div> <?php } ?> <div class="clearfix"></div> </div> <!-- fin --> <div role="tabpanel" class="tab-pane main" id="also_purchased"> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } ?> </div> </div> </div> And in admin/categories.php file, you must add/adapt these entries: - products_nav_tabs_title_1 - products_nav_tabs_title_2 - products_nav_tabs_text_1 - products_nav_tabs_text_2 Like this : $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]), 'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]), 'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]), // Nav Tabs 'products_nav_tabs_title_1' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_title_1'][$language_id]), 'products_nav_tabs_title_2' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_title_2'][$language_id]), 'products_nav_tabs_text_1' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_text_1'][$language_id]), 'products_nav_tabs_text_2' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_text_2'][$language_id])); // Nav Tabs and $description_query = tep_db_query("select language_id, products_name, products_description, products_nav_tabs_title_1, products_nav_tabs_title_2, products_nav_tabs_text_1, products_nav_tabs_text_2, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'"); while ($description = tep_db_fetch_array($description_query)) { tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_nav_tabs_title_1, products_nav_tabs_title_2, products_nav_tabs_text_1, products_nav_tabs_text_2, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_nav_tabs_title_1']) . "', '" . tep_db_input($description['products_nav_tabs_title_2']) . "', '" . tep_db_input($description['products_nav_tabs_text_1']) . "', '" . tep_db_input($description['products_nav_tabs_text_2']) . "', '" . tep_db_input($description['products_url']) . "', '0')"); } and $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_nav_tabs_title_1, pd.products_nav_tabs_title_2, pd.products_nav_tabs_text_1, pd.products_nav_tabs_text_2, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_availability, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); and above the textarea description windows: <!-- Nav Tabs --> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td colspan="2" class="main"><hr></td> </tr> <tr> <td colspan="2" class="main"><?php echo TEXT_PRODUCTS_NAV_TABS; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" cellspacing="0" cellpadding="0"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . ' ' . tep_draw_input_field('products_nav_tabs_title_1[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_nav_tabs_title_1($pInfo->products_id, $languages[$i]['id'])), 'size="30"'); ?></td> <tr> <td class="main" valign="top"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_nav_tabs_text_1[' . $languages[$i]['id'] . ']', 'soft', '60', '4', (isset($products_nav_tabs_text_1[$languages[$i]['id']]) ? stripslashes($products_nav_tabs_text_1[$languages[$i]['id']]) : tep_get_products_nav_tabs_text_1($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '20', '1'); ?></td> <td><table border="0" cellspacing="0" cellpadding="0"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . ' ' . tep_draw_input_field('products_nav_tabs_title_2[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_nav_tabs_title_2($pInfo->products_id, $languages[$i]['id'])), 'size="30"'); ?></td> <tr> <td class="main" valign="top"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_nav_tabs_text_2[' . $languages[$i]['id'] . ']', 'soft', '60', '4', (isset($products_nav_tabs_text_2[$languages[$i]['id']]) ? stripslashes($products_nav_tabs_text_2[$languages[$i]['id']]) : tep_get_products_nav_tabs_text_2($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } ?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <!-- Nav Tabs --> Finally, you need to create/add in your database / TABLE / "products_description" these entries: - products_nav_tabs_title_1 -> Type varchar(32) - products_nav_tabs_title_2 -> Type varchar(32) - products_nav_tabs_text_1 -> Type text - products_nav_tabs_text_2 -> Type text With these blank entries, you can add for some products specific tabs with their own text. your code doesn't work. spent an hour trying to edit the categories page and kept giving this error 1054 - Unknown column 'pd.products_nav_tabs_text_1' in 'field list' Quote Link to comment Share on other sites More sharing options...
bonbec Posted March 26, 2017 Share Posted March 26, 2017 @@vampirehunter, For your "1054 - Unknown column 'pd.products_nav_tabs_text_1' in 'field list'" : you forgot to add Finally, you need to create/add in your database / TABLE / "products_description" these entries:- products_nav_tabs_title_1 -> Type varchar(32)- products_nav_tabs_title_2 -> Type varchar(32)- products_nav_tabs_text_1 -> Type text- products_nav_tabs_text_2 -> Type text @@milerwan it's true, it doesn't work. There are curious functions : tep_get_products_nav_tabs_title_1 and tep_get_products_nav_tabs_title_2 : Fatal error: Call to undefined function tep_get_products_nav_tabs_title_1 ... Quote with OsC 2.2 since 2006 ... Link to comment Share on other sites More sharing options...
milerwan Posted March 26, 2017 Share Posted March 26, 2017 (edited) @@vampirehunter, For your "1054 - Unknown column 'pd.products_nav_tabs_text_1' in 'field list'" : you forgot to add @@milerwan it's true, it doesn't work. There are curious functions : tep_get_products_nav_tabs_title_1 and tep_get_products_nav_tabs_title_2 : Fatal error: Call to undefined function tep_get_products_nav_tabs_title_1 ... @@vampirehunter, @@bonbec Sorry about theses missing functions. :mellow: In admin/includes/functions/general.php, you need to had this at the end of the page : /// NAV TABS products // Nav Tabs 1 title function tep_get_products_nav_tabs_title_1($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_title_1 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_title_1']; } // Nav Tabs 2 title function tep_get_products_nav_tabs_title_2($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_title_2 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_title_2']; } // Nav Tabs 1 text function tep_get_products_nav_tabs_text_1($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_text_1 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_text_1']; } // Nav Tabs 2 text function tep_get_products_nav_tabs_text_2($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_text_2 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_text_2']; } Edited March 26, 2017 by milerwan Quote Osc v2.3.4 BS "custom" PHP 7.3 compatible (710 modified files => o_O') Link to comment Share on other sites More sharing options...
coelroy Posted March 17, 2018 Share Posted March 17, 2018 On 3/26/2017 at 12:39 PM, milerwan said: @@vampirehunter, @@bonbec Sorry about theses missing functions. In admin/includes/functions/general.php, you need to had this at the end of the page : /// NAV TABS products // Nav Tabs 1 title function tep_get_products_nav_tabs_title_1($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_title_1 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_title_1']; } // Nav Tabs 2 title function tep_get_products_nav_tabs_title_2($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_title_2 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_title_2']; } // Nav Tabs 1 text function tep_get_products_nav_tabs_text_1($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_text_1 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_text_1']; } // Nav Tabs 2 text function tep_get_products_nav_tabs_text_2($product_id, $language_id) { $product_query = tep_db_query("select products_nav_tabs_text_2 from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_nav_tabs_text_2']; } Hi Any chance of putting this altogether into a contribution? Quote Link to comment Share on other sites More sharing options...
milerwan Posted March 27, 2018 Share Posted March 27, 2018 On 17/03/2018 at 10:36 AM, coelroy said: Hi Any chance of putting this altogether into a contribution? Try to reproduce the tutorial and if you have issues, come back here to ask help. :) Quote Osc v2.3.4 BS "custom" PHP 7.3 compatible (710 modified files => o_O') Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.