Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Products Specifications


kymation

Recommended Posts

I think i have a sanitise or stripslash issue, only effecting the admin. See images attached.

<snip>

I can't make this happen on my test site. I think you have an error in your installation somewhere. Check all of your edits to admin/categories.php, and any other files on the Admin side if that doesn't help.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

<snip>

I have checked that the catalog/includes/functions/products_specifications.php exists - and contains the function. Any ideas please?

Not many. Do you have other languages installed? Sometimes a missing language file causes an incorrect error message.

 

It appears that you are on a Windows server. Is it running Apache or IIS?

 

Check your Server Info: Is open_basedir set to true? This causes otherwise valid file links to fail.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I can't make this happen on my test site. I think you have an error in your installation somewhere. Check all of your edits to admin/categories.php, and any other files on the Admin side if that doesn't help.

 

Regards

Jim

 

Thanks Jim - Totally right as always - Problem SOLVED!

Link to comment
Share on other sites

Not many. Do you have other languages installed? Sometimes a missing language file causes an incorrect error message.

 

It appears that you are on a Windows server. Is it running Apache or IIS?

 

Check your Server Info: Is open_basedir set to true? This causes otherwise valid file links to fail.

 

Regards

Jim

 

Jim,

 

Thanks for your reply.

 

Yes running on windows. No other languages are installed.

 

Will check to see if open_basedir set to true, but other calls to file links all seem to work.

 

I am more suspicious I have missed a file edit somewhere and will try to go through all the edits and new files again.

Link to comment
Share on other sites

includes/modules/products_tabs.php

 

<?php

// General tab #2

if ($product_info['products_tab_2'] > '') {

?>

<div id="tabs-3">

<div class="inside_heading"><?php echo TEXT_TAB_2; ?></div>

<br>

<?php

echo stripslashes ($product_info['products_tab_2']);

?>

</div>

Link to comment
Share on other sites

I have made some nice mods -

 

just need to know, for example: I input xxxxxxx in the "warranty description" in product admin. save!

 

How do i call that in products_tabs.php.

 

echo $product_info['products_tab_2'];

 

returns nothing

Link to comment
Share on other sites

Hi Guys,

 

I'm using this addon for 2.2 (I know should upgrade but is heavily heavily modded).

 

I have a small bug I hope should could help me with:-

 

 

 

This happens on a checkbox filter set to exact when selecting multiple checkboxes.

 

Any & all help welcome.

You must use a multiple filter type when using any multi-select filter.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

There were several bugs in the tabs section. Here's the corrected (I think) includes/modules/products_tabs.php:

 

<?php
/*
 $Id: products_tabs.php, v1.1.2 20110909 kymation Exp $
 $Loc: catalog/includes/modules/ $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2011 osCommerce
 Released under the GNU General Public License
*/

 // Set the current selected tab
 $selected_tab = 0;
 if (isset ($_GET['tab']) && $_GET['tab'] > 0 ) {
   $selected_tab = ( int )$_GET['tab'];
 }
?>
 <script type="text/javascript">
   $(function() {
  $( "#tabs" ).tabs({ selected: <?php echo $selected_tab; ?> });
   });
 </script>
 <div id="tabs">
   <ul>
<?php
// Start showing the tabs that are turned on in the Admin
// The Product Description tab (always on)
?>
  <li><a href="#tabs-0"><?php echo TEXT_TAB_DESCRIPTION; ?></a></li>
<?php
// The Specifications tab
 include_once( DIR_WS_MODULES . 'products_specifications.php' );
 if ($count_specificatons >= SPECIFICATIONS_MINIMUM_PRODUCTS) {
?>
  <li><a href="#tabs-1"><?php echo TEXT_TAB_SPECIFICATIONS; ?></a></li>
<?php
 }
?>
<?php
// General tab 1
 if ($product_info['products_tab_1'] > '') {
?>
  <li><a href="#tabs-2"><?php echo TEXT_TAB_1; ?></a></li>
<?php
 }
?>
<?php
// General tab 2
 if ($product_info['products_tab_2'] > '') {
?>
  <li><a href="#tabs-3"><?php echo TEXT_TAB_2; ?></a></li>
<?php
 }
?>
<?php
// General tab 3
 if ($product_info['products_tab_3'] > '') {
?>
  <li><a href="#tabs-4"><?php echo TEXT_TAB_3; ?></a></li>
<?php
 }
?>
<?php
// General tab 4
 if ($product_info['products_tab_4'] > '') {
?>
  <li><a href="#tabs-5"><?php echo TEXT_TAB_4; ?></a></li>
<?php
 }
?>
<?php
// General tab 5
 if ($product_info['products_tab_5'] > '') {
?>
  <li><a href="#tabs-6"><?php echo TEXT_TAB_5; ?></a></li>
<?php
 }
?>
<?php
// General tab 6
 if ($product_info['products_tab_6'] > '') {
?>
  <li><a href="#tabs-7"><?php echo TEXT_TAB_6; ?></a></li>
<?php
 }
?>
<?php
// The Accessories (cross sell) tab
 if( SPECIFICATIONS_ACCESSORIES_TAB == 'True' ) {
   $acc_tab = false;
   $check_xsell_query_raw = "
  select
    count(xp.xsell_id) as total
  from " . TABLE_PRODUCTS_XSELL . " xp,
	   " . TABLE_PRODUCTS . " p
  where xp.products_id = '" . (int) $_GET['products_id'] . "'
    and xp.xsell_id = p.products_id
    and p.products_status = '1'
  ";
   $check_xsell_query = tep_db_query($check_xsell_query_raw);
   $check_xsell = tep_db_fetch_array ($check_xsell_query);
   if( $check_xsell['total'] >= MIN_DISPLAY_ALSO_PURCHASED ) {
  $acc_tab = true;
?>
   <li><a href="#tabs-8"><?php echo TEXT_TAB_ACCESSORIES; ?></a></li>
<?php
   }
 }
?>
<?php
// If the Reviews tab is turned on in the Admin
 if (SPECIFICATIONS_REVIEWS_TAB == 'True') {
?>
  <li><a href="#tabs-9"><?php echo TEXT_TAB_REVIEWS; ?></a></li>
<?php
 }
?>
<?php
// If the Ask a Question tab is turned on in the Admin
 if (SPECIFICATIONS_QUESTION_TAB == 'True') {
?>
  <li><a href="#tabs-10"><?php echo TEXT_TAB_ASK_A_QUESTION; ?></a></li>
<?php
 }
?>
<?php
// Tell a Friend tab
 if (SPECIFICATIONS_FRIEND_TAB == 'True') {
?>
  <li><a href="#tabs-11"><?php echo TEXT_TAB_TELL_A_FRIEND; ?></a></li>
<?php
 }
?>
<?php
// If the Documents tab is turned on in the Admin
 if (DOCUMENTS_SHOW_PRODUCT_INFO == 'True') {
   $documents_tab = false;
   $products_documents_query_raw = "
  select
    count(*) as total
  from
    " . TABLE_PRODUCTS_TO_DOCUMENTS . "
  where
    products_id = '" . (int) $_GET['products_id'] . "'
   ";
   // print 'Documents Query: ' . $products_documents_query_raw . '<br>';
   $products_documents_query = tep_db_query ($products_documents_query_raw);
   $products_documents = tep_db_fetch_array ($products_documents_query);
   if ($products_documents['total'] > 0) {
  $documents_tab = true;
?>
  <li><a href="#tabs-12"><?php echo TEXT_TAB_DOCUMENTS; ?></a></li>
<?php
   }
 }
?>
   </ul>
<?php
// End of the Tab display
// Start showing the Content boxes attached to the above tabs
?>
   <div id="tabs-0">
  <div class="inside_heading"><?php echo TEXT_TAB_DESCRIPTION_HEAD; ?></div>
  <br>
<?php
// The Product Description content
 echo stripslashes( tep_sanitize_html( html_entity_decode( stripslashes( $product_info[ 'products_description' ] ) ) ) );
?>
			    </ul>
			  </div>
<?php
 if( isset( $specification_text ) && strlen( $specification_text ) > 36 ) {
?>
   <div id="tabs-1">
  <div class="inside_heading"><?php echo TEXT_TAB_SPECIFICATIONS_HEAD; ?></div>
  <br>
<?php
// The Specifications
 echo stripslashes ($specification_text);
?>
   </div>
<?php
   } //if( isset( $specification_text
?>
<?php
// General tab #1
 if ($product_info['products_tab_1'] > '') {
?>
   <div id="tabs-2">
  <div class="inside_heading"><?php echo TEXT_TAB_1; ?></div>
  <br>
<?php
   echo stripslashes ($product_info['products_tab_1']);
?>
   </div>
<?php
 } // if ($product_info['products_tab_1
?>
<?php
// General tab #2
 if ($product_info['products_tab_2'] > '') {
?>
   <div id="tabs-3">
  <div class="inside_heading"><?php echo TEXT_TAB_2; ?></div>
  <br>
<?php
   echo stripslashes ($product_info['products_tab_2']);
?>
   </div>
<?php
 }
?>
<?php
// General tab #3
 if ($product_info['products_tab_3'] > '') {
?>
   <div id="tabs-4">
  <div class="inside_heading"><?php echo TEXT_TAB_3; ?></div>
  <br>
<?php
   echo stripslashes ($product_info['products_tab_3']);
?>
   </div>
<?php
 }
?>
<?php
// General tab #4
 if ($product_info['products_tab_4'] > '') {
?>
   <div id="tabs-5">
  <div class="inside_heading"><?php echo TEXT_TAB_4; ?></div>
  <br>
<?php
   echo stripslashes ($product_info['products_tab_4']);
?>
   </div>
<?php
 }
?>
<?php
// General tab #5
 if ($product_info['products_tab_5'] > '') {
?>
   <div id="tabs-6">
  <div class="inside_heading"><?php echo TEXT_TAB_5; ?></div>
  <br>
<?php
   echo stripslashes ($product_info['products_tab_5']);
?>
   </div>
<?php
 }
?>
<?php
// General tab #6
 if ($product_info['products_tab_6'] > '') {
?>
   <div id="tabs-7">
  <div class="inside_heading"><?php echo TEXT_TAB_6; ?></div>
  <br>
<?php
   echo stripslashes ($product_info['products_tab_6']);
?>
   </div>
<?php
 }
?>
<?php
// The Accessories/Cross Sell tab
 if ($acc_tab == true) {
   echo '    <div id="tabs-8">' . "\n";
   echo '	  <div class="inside_heading">' . sprintf( TEXT_TAB_ACCESSORIES_HEAD, $product_info['products_name'] ) . '<span class="smalltext">[' . $product_info['products_model'] . '<span></div>' . "\n";
   echo '	  <br>' . "\n";
   include_once( DIR_WS_MODULES . 'products_accessories.php' );
   echo '    </div>' . "\n";
 }
?>
<?php
// The Reviews tab
   if (SPECIFICATIONS_REVIEWS_TAB == 'True') {
 echo '    <div id="tabs-9">';
  include( DIR_WS_MODULES . FILENAME_PRODUCT_REVIEWS );
 echo '    </div>';
   }
?>
<?php
// The Ask a Question tab
   if (SPECIFICATIONS_QUESTION_TAB == 'True') {
 echo '    <div id="tabs-10">';
  include( DIR_WS_MODULES . FILENAME_ASK_A_QUESTION );
 echo '    </div>';
   }
?>
<?php
// The Tell a Friend tab
   if (SPECIFICATIONS_FRIEND_TAB == 'True') {
 echo '    <div id="tabs-11">';
  include( DIR_WS_MODULES . FILENAME_TELL_A_FRIEND );
 echo '    </div>';
   }
?>
<?php
// The Documents tab
   if ($documents_tab == true) {
 echo '    <div id="tabs-12">';
  include( DIR_WS_MODULES . FILENAME_DOCUMENTS );
 echo '    </div>';
   }
?>
 </div>

 

I'll upload a new release in a bit. Thanks for the bug report.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim! I'm newbie for oscommerce and i'm not a programmer. Product Specification is really important add-on for me. I have the installed clear version of OSC 2.3.1 with Product Specification 1.1.11 for testing. What i do:

 

To fix the above bug, find this code in catalog/includes/functions/products_specifications.php:

 

 $link_array = tep_get_link_data( $columns_array['products_id'] );
$cPath_new = $link_array['cPath'];
$category_name = $link_array['categories_name'];

$parameters = 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'];
$product_link = tep_href_link( FILENAME_PRODUCT_INFO, $parameters, 'NONSSL', true, true, $category_name, $columns_array['products_name'] );

and replace it with this:

 

 $cPath_new = tep_get_product_path( $columns_array['products_id'] );
$product_link = tep_href_link( FILENAME_PRODUCT_INFO, 'cPath=' . $cPath_new . '&products_id=' . $columns_array['products_id'] );

I'll put up a new download with this change later.

 

Regards

Jim

 

in release 1.1.11 it's not updated:) and in file catalog/includes/functions/clean_code.php

i see the next strings:

	   case FILENAME_PRODUCT_INFO:
		 if( $products_id > 0 ) {
			$data_array = tep_get_link_data( $products_id );
		  if( $cPath_new == 0 )  $cPath_new = $data_array['cPath'];
			$query_string = 'cPath=' . $cPath_new . '&products_id=' . $products_id;
		   $replacement_array[] = tep_href_link ($filename, $query_string, 'NONSSL', true, true, $data_array['categories_name'], $data_array['products_name'] ) . '"'; // Add the corrected link to the array
		 } else {
		   $replacement_array[] = $strings; // Leave it as it is

it is ok?

 

I have problems on my test site:

1. I have the test category Auto->Audi with 6 products and linked filter Audi 100(C2) to category Auto and subcategories, in category Auto filter working perfect, but if i open category Audi i see http://allauto.com.u...php/cPath/22_23 it's ok?, i think i must see the filter on this page or comparsion must have links or i'm not right? The settings in admin:

 

Comparison Link in Index True

Comparison Row in Table both

Show Comparison True

Comparison in Index True

Comparison Suffix in Header True

Comparison Box Style Plain

 

2) If i enabled tabs "Review", "Tell a Friend", "Ask a Question" only "Tell a Friend" working. If i press Submit button on Reviews - product added to cart, if i press Submit button on Ask a Question - it do nothing.

 

3)Have problems with styles, but its no critical

 

And little question - i can install STS with Product Specification? Its all on this moment.

Thank you for this great add-on, and support!

 

P.S. Sorry for my bad English.

 

Best Regards,

Sergey Vorov

Edited by Novice777

Best Regards,

Sergey Vorov

Link to comment
Share on other sites

Hi Jim,

 

I have a couple of questions:

 

1. On the website you mentioned previously (www.binding-machine.net), in any of the product info page, if I click "submit" button in the fourth tab, which is a "Ask a Question" tab, without entering required information, I do not get to see the prompted warning message because the page refreshed and brought me back to the first tab. Is it a normal behavior of PS?

 

2. Are there any code changes need to be done on the X-Sell contribution before installing your PS version 1.1.11? The X-Sell you suggest us to use (http://addons.oscommerce.com/info/1415) seem to be a ms2 version.

 

Thanks in advance for your time.

 

Best wishes,

Eddy

Link to comment
Share on other sites

1. I probably should make that return to the same tab. I'll look into that.

 

2. Xsell needs to be updated to work with 2.3.1. The changes are fairly minor. Instructions are here, here, and here.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

<snip>in release 1.1.11 it's not updated:)

Nobody has reported that change as actually working, so I didn't bother. Test it and let me know if it helps.

 

in file catalog/includes/functions/clean_code.php

i see the next strings:

<snip>it is ok?

Why wouldn't it be. I'm not psychic; tell me what you think is wrong and I'll look at it.

 

I have problems on my test site:

1. I have the test category Auto->Audi with 6 products and linked filter Audi 100(C2) to category Auto and subcategories, in category Auto filter working perfect, but if i open category Audi i see http://allauto.com.u...php/cPath/22_23 it's ok?, i think i must see the filter on this page or comparsion must have links or i'm not right? The settings in admin:

 

Comparison Link in Index True

Comparison Row in Table both

Show Comparison True

Comparison in Index True

Comparison Suffix in Header True

Comparison Box Style Plain

You can't have both Show Comparison and Comparison in Index set to true. That's a conflict. Decide which one you want to use and set the other one to False.

 

Check that your Specification Group is actually linked to the subcategory.

 

2) If i enabled tabs "Review", "Tell a Friend", "Ask a Question" only "Tell a Friend" working. If i press Submit button on Reviews - product added to cart, if i press Submit button on Ask a Question - it do nothing.

You missed an edit in products_info.php. Your forms are overlapping. Check that tep_draw_form() and </form> are in the correct places and there are no duplicates.

 

3)Have problems with styles, but its no critical

 

And little question - i can install STS with Product Specification? Its all on this moment.

Thank you for this great add-on, and support!

 

P.S. Sorry for my bad English.

 

Best Regards,

Sergey Vorov

Check that you have added all of the PS style classes to stylesheet.css.

 

STS is not compatible with osCommerce 2.3.1, and would require a lot of code changes to work with PS. Don't do it.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

You must use a multiple filter type when using any multi-select filter.

 

Regards

Jim

 

Ok but I have a multi select box with (example for car stereos):

  • AUX in
  • IPod support
  • USB Support
  • Bluetooth

I want users to be able select two or more options and have products show up that have all the selected features. Is there no way to do this?

Link to comment
Share on other sites

Let's try this again: You must set the Filter Class to Multiple when using a Multiple select Filter type (Multi-Pulldown, Check Boxes, or Multi-Image.. See the User's Manual: Table 1 in Section 3.6, or Section 4.2.2.1 for the details.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks Jim, The bas are wall working.

 

 

I have used firebug to locate some code that control the look of the tabs. But i cannot find the class reference to it,

 

My issue is that when the tabs are clicked the TEXT Grows in size - and disrupts the page layout.. See http://www.verdegia.com/BANO/product_info.php?cPath=16&products_id=323 (therby forcing the final tab to the next line.

 

 

 

 

Firebug returns this:

 

<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">

 

 

<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">

 

 

<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active">

 

 

<a class="ptabs" style="color:#333;" href="#tabs-0">Description</a>

</li>

 

<li class="ui-state-default ui-corner-top">

 

<li class="ui-state-default ui-corner-top">

 

<li class="ui-state-default ui-corner-top">

 

<li class="ui-state-default ui-corner-top">

</ul>

 

<div id="tabs-0" class="ui-tabs-panel ui-widget-content ui-corner-bottom">

 

 

Where is the CSS that controls this?

where is the refernece to the class in the file pack?

 

 

Thanks Jim!

Link to comment
Share on other sites

Anything that starts with "ui-" belongs to the Jquery UI and is styled with Themeroller. However, Themeroller sets a font and doesn't change it for any of the elements, so what you are seeing is probably part of the osCommerce stylesheet. That's not stock behavior, so it's probably something you've added. Look for something that is styling A:hover or A:active with a larger font size or a bold font weight.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

You missed an edit in products_info.php. Your forms are overlapping. Check that tep_draw_form() and </form> are in the correct places and there are no duplicates.

 

 

Check that you have added all of the PS style classes to stylesheet.css.

 

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

SAME ISSUE:

 

Product_info.php:

 

the only reference to tep_draw_form()

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>

 

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

modules/product_reviews

 

the only reference to tep_draw_form()

echo tep_draw_form ('product_review', tep_href_link (FILENAME_PRODUCT_INFO, 'action=process&tab=review&products_id=' . $_GET['products_id']), 'post', 'onSubmit="return checkForm();"');

 

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

 

NOTE: ALL PS style classes to stylesheet.css.

 

----

 

This is fast becomming the Best Contrib Ever - Great work & a huge thank you!

Link to comment
Share on other sites

Thank you, Jim!

Gemma

in Product_info.php:

</form> from string 224 move to string move to string 203, yo will have:

 <br />
 <div class="buttonSet">
   <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>
 </div>
 </form>
 <div style="clear: both;"></div>
 <br />

 

in includes/modules/product_reviews change:

echo tep_draw_form ('product_review', tep_href_link (FILENAME_PRODUCT_INFO, 'action=process&tab=review&products_id=' . $_GET['products_id']), 'post', 'onSubmit="return checkForm();"');

to

 echo tep_draw_form ('product_review', tep_href_link (FILENAME_PRODUCT_INFO, 'action=process&tab=9&products_id=' . $_GET['products_id']), 'post', 'onSubmit="return checkForm();"');

Best Regards,

Sergey Vorov

Link to comment
Share on other sites

tep_draw_form() and </form> need to exist on the page, and there should be only one of each. The issue is their locations. The code between tep_draw_form() and </form> can not include any of the tabs.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

<snip>

in includes/modules/product_reviews change:

echo tep_draw_form ('product_review', tep_href_link (FILENAME_PRODUCT_INFO, 'action=process&tab=review&products_id=' . $_GET['products_id']), 'post', 'onSubmit="return checkForm();"');

to

 echo tep_draw_form ('product_review', tep_href_link (FILENAME_PRODUCT_INFO, 'action=process&tab=9&products_id=' . $_GET['products_id']), 'post', 'onSubmit="return checkForm();"');

You are right; that's a bug. Thanks for the notice. I'll fix that in the master and put up a new release.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

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