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

Pronux, Thanks to you It's working. I've been trying to make it where it would also say "no reviews have been made" and when there is not reviews it would have a button or something telling users if they would like to leave a review.

 

I'm going to keep messing with it to see if I could get it or not.

 

Thank you for all your help!

Link to comment
Share on other sites

Hi Pronux,

 

I am recently working on my site, along with TMS great module. So far so good to me. I will update it to the newer version which I can update information through Admin as you mentioned.

During the time i were working on the TMS Module, I have a question here:

 

In the file TabMenuSection.php on line 33 has this code: $path = $this->CONF['pathtms'].'TabMenuSectionStyles.css';

 

We already done this step 3 per instruction:

Step 3: Add the styles in TMS/TabMenuSectionStyles.css to your osCommerce stylesheet (normaly this is catalog/admin/includes/stylesheet.css)

 

So, should i change the code above from 'TabMenuSectionStyles.css' to 'stylesheet.css', but what 'pathtms' to change to?

The reason i am asking is i dont see the point why i have 2 duplicated *.css for one module, if i have to modify this stylesheet.css than i have to do other TabMenuSectionStyles.css as well, this is not what i want to do.

 

Please advice.

 

Thanks,

Andy,

Link to comment
Share on other sites

Pronux, Thanks to you It's working. I've been trying to make it where it would also say "no reviews have been made" and when there is not reviews it would have a button or something telling users if they would like to leave a review.

 

I'm going to keep messing with it to see if I could get it or not.

 

Thank you for all your help!

 

Hi Stream,

 

I could not get it shows on the tab2, how can you get it works? Give me a hand!

 

I am still confusing at this stage wrote by Pronux: "...it does nothing else than putting the generated content into a temp variable ($reviewTabContent)..."

 

Please show me specific code of how you put those $reviewTabContent = ''; and $reviewTabContent .= ' on the codes.

 

I spent 2 hours to play around with it. I got stuck here. Please help!

 

By the way:

I followed this step by Pronux:

3. Go to catalog/includes/TMS/Conf.php and change the name of the second tab:

 

$CONF['tabs']['en'][2] = 'Reviews';

 

However i want it show the number of customer reviews after to the Reviews, like this Review (1), so customer will notice there is 1 review in there before clicking on it. What i did was:

 

3. Go to catalog/includes/TMS/Conf.php and change the name of the second tab:

add this code right underneath of //Language Settings:

 

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");

$reviews = tep_db_fetch_array($reviews_query);

 

change this: $CONF['tabs']['en'][2] = 'Reviews';

to this: $CONF['tabs']['en'][2] = 'Reviews (' . $reviews['count'] . ')';

 

Thanks,

Andy,

Link to comment
Share on other sites

@andyn

 

If you have added the styles from TabMenuSectionStyles.css to your osCommerce stylesheet.css, you can simply ignore line 33 in TabMenuSection.php ($path = $this->CONF['pathtms'].'TabMenuSectionStyles.css'), it doesn't do anything.

 

Reviews: I've provided an example in this thread how you can add the reviews to a tab. Insert the code on products_info.php before you add the content to the tabs:

 

$TMS->tab[1]['content'] = 'content for tab 1...';

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

$TMS->tab[3]['content'] = 'content for tab 3...';

Edited by Pronux

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

Thanks Pronux for your time,

 

All night, i keep thinking about how to make the review info appear on the tab2. I have done alot of works so far to set up the product_info.php page, till this stage, my tab 2 can not appear the review content.

 

My TMS is working fine so far as i said, the only thing i want is how to make the content or some contents in the product_reviews.php page to be appeared on the tab2.

In Conf.php, i have:

 

$CONF['tabs']['en'][1] = 'Description';

$CONF['tabs']['en'][2] = 'Customer Reviews (' . $reviews['count'] . ')';

$CONF['tabs']['en'][3] = 'Notes';

 

and in product_info.php, i have:

 

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

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

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

 

Everything is working smooth as silk, except no review content appears under tab2, there is something related with $reviewTabContent;. However, Pronux mentioned: "...it does nothing else than putting the generated content into a temp variable ($reviewTabContent)...", I am still confusing how to put those $reviewTabContent = ''; and $reviewTabContent .= ' on the product_reviews.php code in order to make them appeared on the tab2.

 

Please give me more specific details. I almost give it up at this stage. Here is how far i have done on my product_info.php page: http://www.microheli.com/store/product_info.php/products_id/19#!tab2

You can see I already copied some of the codes from product_reviews.php into the products_info.php so that the review content can be appeared at the bottom of the page for proving that the codes are working and ready, but still can not make them appeared under tab2.

This drives me crazy now. Please help before i give it up, i can not go too far on this.

 

Thanks again,

Andy,

Link to comment
Share on other sites

@andyn

 

Two tips:

1. What happens when you add the code from http://www.oscommerce.com/forums... to products_info.php BEFORE

 

$TMS->tab[1]['content'] = $product_info['products_description'];
$TMS->tab[2]['content'] = $reviewTabContent;
$TMS->tab[3]['content'] = $contentTab3;

 

2. In PHP you can put text (string) into a varaible:

$thisIsAVarialbe = 'this is a text string';

Now put all the generated review HTML-strings (that means all the review-content which is on the bottom of your products_info.php at the moment) into the variable $reviewTabContent. Do this BEFORE:

 

$TMS->tab[1]['content'] = $product_info['products_description'];
$TMS->tab[2]['content'] = $reviewTabContent;
$TMS->tab[3]['content'] = $contentTab3;

 

If it doesn't help, maybe StreamMan can post his solution here in this thread.

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

Hi Pronux,

 

I dont want to bother you and your time too much here. I appreciate for your effort to help us, but i failed on this stage.

 

In the file content_tabs_en.php, i have this line:

 

<?php

 

$reviewTabContent = 'test';

 

$contentTab3 = '

1. Warning when the sum of all tabWidthUserDefined tabs+border is bigger then totalWidth

<br/>2. Auto-Size of the tabs (width) and/or the ability to define the width per language

<br/>3. Caching of the whole tab-menu

<br/>

<br/>Having other suggestions or ideas about this addon? Feel free to contact us.

';

 

?> (<-----original file is missing this "?>" sign)

 

then i have the text "test" appears on the tab2. As soon as I replace this "test" by this code:

 

<!--Begin Product Reviews-->

<?php

define('TEXT_OF_5_STARS', '%s of 5 Stars!');

$reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.reviews_status = 1 order by r.reviews_id desc";

$reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

 

if ($reviews_split->number_of_rows > 0) {

if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {

?>

 

<div class="ui-widget-content infoBoxContents">

<div style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></div>

 

<?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?>

</div>

 

<?php

}

 

$reviews_query = tep_db_query($reviews_split->sql_query);

while ($reviews = tep_db_fetch_array($reviews_query)) {

?>

 

<div>

<span class="mainText" style="float: right;"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></span>

<h2><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</a>'; ?></h2>

</div>

 

<div class="contentText">

<?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br />') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.png', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>'; ?>

</div>

 

<?php

}

} else {

?>

 

<div class="contentText">

<?php echo TEXT_NO_REVIEWS; ?>

</div>

 

<?php

}

 

if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>

 

<div class="ui-widget-content infoBoxContents">

<div style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></div>

 

<?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?>

</div>

 

<?php

}

?>

<!--End Product Reviews-->

 

It wont work. This is what i keep saying that i am confusing this statement: "...it does nothing else than putting the generated content into a temp variable ($reviewTabContent)..."

 

I have wasted to much bandwidth here, something is not working for me, no matter what i try. I give it up!

 

Thanks again for all your help and support.

 

Happy New Year to all,

Andy,

Link to comment
Share on other sites

@Andy

 

I've got it working the way Pronux explane. (Well working some what) It was showing the reviews, but not the text that says like " no reviews has been left" Also I think it did not have a button to leave a review.

 

I've search around and found a much easier way for me to get it to work.

 

This has nothing to do with Pronux add on.

 

 

 

Open catalog/product_info.php about line 187 add the following just below the </div> :

<!--tabs-->
<script>
$(document).ready(function() {
$("#tabs").tabs();
});
</script>
<div id="tabs">
<ul>
<li><a href="#fragment-1"><span>Description</span></a></li>
<li><a href="#fragment-2"><span>Reviews</span></a></li>
<li><a href="#fragment-3"><span>Three</span></a></li>
</ul>
<div id="fragment-1">
   <?php echo stripslashes($product_info['products_description']); ?>
</div>

<div id="fragment-2">
<?php
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS);

 $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.reviews_status = 1 order by r.reviews_id desc";
 $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

 if ($reviews_split->number_of_rows > 0) {
   if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
?>

 <div class="contentText">
   <p style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></p>

   <p><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></p>
 </div>

 <br />

<?php
   }

   $reviews_query = tep_db_query($reviews_split->sql_query);
   while ($reviews = tep_db_fetch_array($reviews_query)) {
?>

 <div>
   <span style="float: right;"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></span>
   <h2><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</a>'; ?></h2>
 </div>

 <div class="contentText">
   <?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br />') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>'; ?>
 </div>

<?php
   }
 } else {
?>

 <div class="contentText">
   <?php echo TEXT_NO_REVIEWS; ?>
 </div>

<?php
 }

 if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>

 <div class="contentText">
   <p style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></p>

   <p><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></p>
 </div>

<?php
 }
?>

 <br />

 <div class="buttonSet">
   <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW, 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()), 'primary'); ?></span>

   <?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params())); ?>
 </div>

</div>
</div>
</div>
<div id="fragment-3">
test 3
</div>
</div>
<!--/tabs-->

 

I've could not find out how to make it where it would show the numbers of reviews, I would like to get this working my self.

 

If you have problems with these codes please let me know, I will do my best to help.

 

 

-Stream

Link to comment
Share on other sites

Stream,

 

I just done the code which shows the number (x) of how many reviews are in there like "Review (2)" before customer clicks on the tab. Add some codes base on the code that you shown me.

 

<!--tabs-->

<?php

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");

$reviews = tep_db_fetch_array($reviews_query);

?>

 

<script>

$(document).ready(function() {

$("#tabs").tabs();

});

</script>

<div id="tabs">

<ul>

<li><a href="#fragment-1"><span>Description</span></a></li>

<li><a href="#fragment-2"><span>Reviews<?php echo ' ' . '(' . $reviews['count'] . ')'; ?></span></a></li>

<li><a href="#fragment-3"><span>Three</span></a></li>

</ul>

<div id="fragment-1">

<?php echo stripslashes($product_info['products_description']); ?>

</div>

<div id="fragment-2">

Test 2

</div>

<div id="fragment-3">

Test 3

</div>

</div>

<!--/tabs-->

 

Thanks,

Andy,

Link to comment
Share on other sites

farbor asked:

 

------------------------------------------------------------------------------

Hi Pronux,

 

Thanks for the great work behind TMS, I really love it.

Can I ask you which image contribution are you using in the live demo Tab Menu Section (TMS)? I really would like to have something similar.

Could you point me out to the right contribution?

Thanks in advance for the info.

 

Kind Regards

------------------------------------------------------------------------------

 

Answer: It's not a contribution, it's the new picture module of osCommerce 2.3.1

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

LOL

 

That's annoying as I am on 2.2 and I cannot upgrade right now.

Do you know a similar contribution for 2.2?

 

Thanks in advance for the help.

Kind Regards

JK

 

farbor asked:

 

 

 

Answer: It's not a contribution, it's the new picture module of osCommerce 2.3.1

Link to comment
Share on other sites

LOL

 

That's annoying as I am on 2.2 and I cannot upgrade right now.

Do you know a similar contribution for 2.2?

 

Thanks in advance for the help.

Kind Regards

JK

 

I know only the "UltraPics - MS2 Image Addon Pack!" http://addons.oscommerce.com/info/1642 which looks different.

If I were you, I would copy-past the code from 2.3.1 to your 2.2, is not that hard :thumbsup:

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

Thanks for the reply, I am now testing 2.3.1 to see if I can move the image application on my website.

 

Unfortunately I have noticed something weird that I did not noticed yesterday....

Same problem reproducible in both my 2.2 and 2.3.1 clean install.

 

3 Issues:

 

1) Just below the tabs before the content there is a white section....not sure where that come from

2) The last tab on the right (horizontal alignment) is missing the right border

3) If you have an empty tab as last tab, this is still selectable.

 

The demo site is not affected by any of the above problem (http://oscommerce.pronux.ch/product_info.php?products_id=28).

 

I wonder if there is something different in the files uploaded in the contributions or I am doing something fondamentally wrong....

 

Any ideas?

 

Kind Regards

JK

 

I know only the "UltraPics - MS2 Image Addon Pack!" http://addons.oscommerce.com/info/1642 which looks different.

If I were you, I would copy-past the code from 2.3.1 to your 2.2, is not that hard :thumbsup:

Link to comment
Share on other sites

3 Issues:

1) Just below the tabs before the content there is a white section....not sure where that come from

2) The last tab on the right (horizontal alignment) is missing the right border

3) If you have an empty tab as last tab, this is still selectable.

 

 

Sounds weird. I'm also using a clean install of osc 2.3.1 and the uploaded TMS-files should be the same as on my demosite.

Can you provide me a link to your site?

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 think I found the root of the problem!!!

Nothing to do with your code but something stupid that I have done or a bug not sure.

In the Conf.php I have added this line:

 

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");

$reviews = tep_db_fetch_array($reviews_query);

 

 

$CONF['tabs']['en'][2] = 'Reviews('.$reviews['count'].')';

 

To populate the name of the second tab with Reviews(x)

 

The tab is populated correctly but there is an extra white row between the tab header and the tab body (for all the tabs).

 

If I change to

 

$CONF['tabs']['en'][2] = 'Reviews';

 

The layout issue is gone and the tab shows correctly (last tab is still selectable though!)

Am I concatenate the strings uncorrectly? Does $reviews['count'] need to be cast in some way?

Problem is easily reproducible just adding the above code.

 

Please let me know if you have any idea?

 

Kind Regards

JK

 

 

 

 

 

Sounds weird. I'm also using a clean install of osc 2.3.1 and the uploaded TMS-files should be the same as on my demosite.

Can you provide me a link to your site?

Link to comment
Share on other sites

 

The layout issue is gone and the tab shows correctly (last tab is still selectable though!)

Am I concatenate the strings uncorrectly? Does $reviews['count'] need to be cast in some way?

Problem is easily reproducible just adding the above code.

 

Please let me know if you have any idea?

 

At the demo site it seems to work: http://oscommerce.pronux.ch/product_info.php?products_id=28

 

Try to make some changes to the TMS Conf.php -> f.e. reduce the no of tabs, change the width of tab 2 etc.

Or install the demo app from the zip package and test if it works on your domain.

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

And that is the issue!!!!

If you don't specify the width of the empty tab the extra white space appears.

Setting the width fix the problem (although is still clickable...not sure why...)

 

As an extra I have fixed the product info to show the botton Write Review under the Review tab and as well the NO_REVIEW_TEXT.

 

I attach the code to add product_info for everyone else (of course is an example and has not been heavily tested):

 

//PRONUX TMS BEGIN

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS);

$reviewTabContent = '';

 

 

$reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.reviews_status = 1 order by r.reviews_id desc";

$reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

 

if ($reviews_split->number_of_rows > 0) {

if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {

 

$reviewTabContent = '

<div class="contentText">

<p style="float: right;">'. TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))) .'</p>

 

<p>'. $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS) .'</p>

</div>

 

<br />';

}

 

$reviews_query = tep_db_query($reviews_split->sql_query);

while ($reviews = tep_db_fetch_array($reviews_query)) {

 

$reviewTabContent .= '

<div>

<span style="float: right;">'.sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])) .'</span>

<h2><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</a> </h2>

</div>

 

<div class="contentText">

'. tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br />') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>

</div>

<div class="buttonSet">

<span class="buttonAction">' .tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW, 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()), 'primary'). '</span>

</div>';

}

} else {

 

$reviewTabContent = '

<div class="contentText">'.TEXT_NO_REVIEWS.'

</div>

<div class="buttonSet">

<span class="buttonAction">' .tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW, 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()), 'primary'). '</span>

</div>';

}

 

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

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

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

$TMS->tab[4]['content'] = $product_info['products_use'];

 

$TMS->setLanguage('', $_SESSION['language']);

$TMS->generateTabMenuSection(true);

//PRONUX TMS END

?>

 

Hope this helps.

 

Cheers

JK

 

 

 

At the demo site it seems to work: http://oscommerce.pronux.ch/product_info.php?products_id=28

 

Try to make some changes to the TMS Conf.php -> f.e. reduce the no of tabs, change the width of tab 2 etc.

Or install the demo app from the zip package and test if it works on your domain.

Link to comment
Share on other sites

Hi Pronux,

 

Thanks for this great contribution! Almost everything is working accept one thing. I need a Write review button in my third tab. I'm using 2.2 rc2a and it give me an error when i enter this code:

 

<?php   $reviewTabContent = '';

 $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id desc";
 $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

 if ($reviews_split->number_of_rows > 0) {
   if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {

       $reviewTabContent = '
         <div class="contentText">
           <p style="float: right;">'. TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))) .'</p>

           <p>'. $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS) .'</p>
         </div>

         <br />';
   }

   $reviews_query = tep_db_query($reviews_split->sql_query);
   while ($reviews = tep_db_fetch_array($reviews_query)) {

$reviewTabContent .= '
 <div>
   <span style="float: right;">'.sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])) .'</span>
   <h2><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</a> </h2>
 </div>

 <div class="contentText">
   '. tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br />') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>
 </div>

  <div class="buttonSet">
   <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW, 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()), 'primary'); ?></span>

   <?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params())); ?>
 </div>'

 ;
   }
 } else {

$reviewTabContent = '
 <div class="contentText">
   <?php echo TEXT_NO_REVIEWS; ?>
 </div>';
 }
?>
	<?php 
//PRONUX TMS START
include DIR_WS_INCLUDES.'TMS/Conf.php';

$TMS->tab[1]['content'] = $product_info['products_description']; 
$TMS->tab[2]['content'] = 'hello world 1';
$TMS->tab[3]['content'] = $reviewTabContent;

$TMS->setLanguage('', $_SESSION['language']);
$TMS->generateTabMenuSection(true);
//PRONUX TMS END
?>

 

All i get is this error:

 

Parse error: syntax error, unexpected T_STRING in /var/www/html/catalog/product_info.php on line 322

 

any ideas?

Link to comment
Share on other sites

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

And that is the issue!!!!

If you don't specify the width of the empty tab the extra white space appears.

Setting the width fix the problem (although is still clickable...not sure why...)

 

I never experienced these two problems but I will check it on my demo site. Thanks for your feedback.

Edited by Pronux

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

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