Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Products Specifications


kymation

Recommended Posts

i encoded here in categories.php page

 

in

 

<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']]) ? htmlspecialchars_decode($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

</tr>

 

 

i checked in query also

 

i am unable to find it please help where to encode it to escape from special characters

Link to comment
Share on other sites

1. That file has passed on! It is no more! It has ceased to be! It's expired and gone to ... catalog/includes/modules/boxes/products_filter.php.

 

Oh, and that one has a known formatting bug. If you want to use it, look up in this thread a bit for the posted fix.

 

2. That's a bug in jQuery. There's a patch for that back a page or two.

 

I really need to package up all of these changes and make a new release. Someday....

 

Regards

Jim

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

Link to comment
Share on other sites

It looks like you are using a template. The proper placement of the code may be different than for stock osC, or it may need to be in a different file altogether. The code is normally in index.php:

 

// Start Product Specifications
  // Check the number of products is above the minimum for the comparison table
  $check_query_raw = "select distinct p2c.products_id
					   from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c,
						    " . TABLE_SPECIFICATION_GROUPS . " sg,
						    " . TABLE_SPECIFICATIONS_TO_CATEGORIES . " sg2c
					   where sg.show_comparison = 'True'
						 and sg.specification_group_id = sg2c.specification_group_id
						 and p2c.categories_id = sg2c.categories_id
						 and sg2c.categories_id = '" . (int) $current_category_id . "'
					 ";
  // print $check_query_raw . "<br>\n";
  $check_query = tep_db_query ($check_query_raw);
  $show_comparison = SPECIFICATIONS_MINIMUM_COMPARISON <= tep_db_num_rows ($check_query);

  if (SPECIFICATIONS_BOX_COMP_INDEX == 'False' && SPECIFICATIONS_COMP_LINK == 'True' && $current_category_id != 0 && $show_comparison == true && tep_has_spec_group ($current_category_id, 'show_comparison') == true) {
    echo '			    <td align="center"><a href="' . tep_href_link (FILENAME_COMPARISON, 'cPath=' . $cPath) . '">' . tep_image_button ('button_products_comparison.gif', TEXT_BUTTON_COMPARISON) . '</a></td>' . "\n";
  } // if (SPECIFICATIONS_BOX_COMP_INDEX
// End Product Specifications

 

Also note that this code requires the proper value for $current_category_id. It will not work if that value is not set or if it is set to zero.

 

Regards

Jim

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

Link to comment
Share on other sites

1. That file has passed on! It is no more! It has ceased to be! It's expired and gone to ... catalog/includes/modules/boxes/products_filter.php.

 

Oh, and that one has a known formatting bug. If you want to use it, look up in this thread a bit for the posted fix.

 

2. That's a bug in jQuery. There's a patch for that back a page or two.

 

I really need to package up all of these changes and make a new release. Someday....

 

Regards

Jim

 

Hi Jim,

 

1. There is only bm_products_filter.php in catalog/includes/modules/boxes/ and there is catalog/includes/modules/products_filter.php...is that correct?

 

2. I added

 

<script type="text/javascript">
// fix jQuery base tag bug
$.fn.__tabs = $.fn.tabs;
$.fn.tabs = function (a, b, c, d, e, f) {
	 var base = location.href.replace(/#.*$/, '');
	 $('ul>li>a[href^="#"]', this).each(function () {
	 var href = $(this).attr('href');
	 $(this).attr('href', base + href);
	 });
	 $(this).__tabs(a, b, c, d, e, f);
};
</script>

 

in the two includes/template_top.php, but there are no changes about the tabs behaviour...

Link to comment
Share on other sites

@@lbdublb

 

1. Right. the file in catalog/includes/modules/boxes/ is the filters box to go in the left/right column, and the one in catalog/includes/modules/ is the equivalent that goes in the center column.

 

2. That should fix the jQuery bug. Check that all of your jQuery files are in place and being called correctly in the head section of the page, and that the Javascript that invokes the tabs is present on the page.

 

 

@@brchalla

 

All specifications are in a Specification Group. Apparently I don't understand the question. Please explain.

 

If the data is stored in the database but is not being displayed, there is a problem in the products_info.php or in one of the included files. I don't know where the error is. Check all of your edits again, or add some debugging commands.

 

Regards

Jim

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

Link to comment
Share on other sites

@@lbdublb

 

1. Right. the file in catalog/includes/modules/boxes/ is the filters box to go in the left/right column, and the one in catalog/includes/modules/ is the equivalent that goes in the center column.

 

2. That should fix the jQuery bug. Check that all of your jQuery files are in place and being called correctly in the head section of the page, and that the Javascript that invokes the tabs is present on the page.

 

 

@@brchalla

 

All specifications are in a Specification Group. Apparently I don't understand the question. Please explain.

 

If the data is stored in the database but is not being displayed, there is a problem in the products_info.php or in one of the included files. I don't know where the error is. Check all of your edits again, or add some debugging commands.

 

Regards

Jim

 

If you scroll down the product page, there you can see another Tab Module...that cannot be the cause, right?

Link to comment
Share on other sites

I used Firebug to remove the second set of tabs, but the first set still didn't work. Try moving the Javascript that is just ahead of the tabs to down below the tabs. There could be something else here that I'm just not seeing.

 

Regards

Jim

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

Link to comment
Share on other sites

@@kymation

 

I will explain clearly.

i created two specification groups & created some specifications in both.

then i linked both specification groups to only one category .here i can all

see specifications names & attributes which i have given in product info page,istead i want them to display with specification group and specification

 

for ex:

spec group1:

spec1:attribut1

spec2:attrbut2

 

specgroup2:

spec1:attribut1

spec2:attrbut2

Link to comment
Share on other sites

The groups were never intended to be displayed. You can change the code in includes/modules/products_specifications from this

 

  $specifications_query_raw = "select ps.specification,
								  s.filter_display,
								  s.enter_values,
								  sd.specification_name,
								  sd.specification_prefix,
								  sd.specification_suffix
						   from " . TABLE_PRODUCTS_SPECIFICATIONS . " ps,
							    " . TABLE_SPECIFICATION . " s,
							    " . TABLE_SPECIFICATION_DESCRIPTION . " sd,
							    " . TABLE_SPECIFICATION_GROUPS . " sg,
							    " . TABLE_SPECIFICATIONS_TO_CATEGORIES . " sg2c
						   where sg.show_products = 'True'
							 and s.show_products = 'True'
							 and s.specification_group_id = sg.specification_group_id
							 and sg.specification_group_id = sg2c.specification_group_id
							 and sd.specifications_id = s.specifications_id
							 and ps.specifications_id = sd.specifications_id
							 and sg2c.categories_id = '" . (int) $current_category_id . "'
							 and ps.products_id = '" . (int) $_GET['products_id'] . "'
							 and sd.language_id = '" . (int) $languages_id . "'
							 and ps.language_id = '" . (int) $languages_id . "'
						   order by s.specification_sort_order,
								    sd.specification_name
						 ";

 

to something like this:

 

  $specifications_query_raw = "select ps.specification,
								  s.filter_display,
								  s.enter_values,
								  sd.specification_name,
								  sd.specification_prefix,
								  sd.specification_suffix,
								  sg.specification_group_name
						   from " . TABLE_PRODUCTS_SPECIFICATIONS . " ps,
							    " . TABLE_SPECIFICATION . " s,
							    " . TABLE_SPECIFICATION_DESCRIPTION . " sd,
							    " . TABLE_SPECIFICATION_GROUPS . " sg,
							    " . TABLE_SPECIFICATIONS_TO_CATEGORIES . " sg2c
						   where sg.show_products = 'True'
							 and s.show_products = 'True'
							 and s.specification_group_id = sg.specification_group_id
							 and sg.specification_group_id = sg2c.specification_group_id
							 and sd.specifications_id = s.specifications_id
							 and ps.specifications_id = sd.specifications_id
							 and sg2c.categories_id = '" . (int) $current_category_id . "'
							 and ps.products_id = '" . (int) $_GET['products_id'] . "'
							 and sd.language_id = '" . (int) $languages_id . "'
							 and ps.language_id = '" . (int) $languages_id . "'
						   order by sg.specification_group_name,
								    s.specification_sort_order,
								    sd.specification_name
						 ";

 

Then you can use $specifications['specification_group_name'] to display the group name.

 

Regards

Jim

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

Link to comment
Share on other sites

I have pasted the code,it is showing like :

spec group1: spec1:attribut1

spec group1: spec2:attrbut2

spec group2: spec1:attribut1

spec group2: spec2:attrbut2.

 

i have included $specifications['specification_group_name'] in includes/modules/product_specifications.php

 

while ($specifications = tep_db_fetch_array ($specifications_query) ) {

if ($specifications['specification'] != '') {

$specification_text .= '<li>';

if (SPECIFICATIONS_SHOW_NAME_PRODUCTS == 'True') {

$specification_text .= $specifications['specification_group_name'] . ': ' ;

$specification_text .= $specifications['specification_name'] . ': ';

}

 

$specification_text .= $specifications['specification_prefix'] . ' ';

 

 

please let me know where to include $specifications['specification_group_name'] to display specifications under the specification group name.

like:

spec group1: spec1:attribut1

spec group1: spec2:attrbut2

 

spec group2: spec1:attrbut1

spec group2: spec2:attrbut2

please tell me

Link to comment
Share on other sites

Sorry like

please let me know where to include $specifications['specification_group_name'] to display specifications under the specification group name.

like:

spec group1:

spec1:attribut1

spec2:attrbut2

spec group2:

spec1:attrbut1

spec2:attrbut2

 

please tell me

Link to comment
Share on other sites

What you want is custom code. I don't have the time to write a custom application just for you. I've given you hints and sample code to point you in the right direction. The rest is your job.

 

Regards

Jim

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

Link to comment
Share on other sites

I used Firebug to remove the second set of tabs, but the first set still didn't work. Try moving the Javascript that is just ahead of the tabs to down below the tabs. There could be something else here that I'm just not seeing.

 

Regards

Jim

 

Thanks! Solved! There had to be some mistake in the jquery folder files....I renewed them and now it works.

 

How do I change the design of the tabs? I would likr to use the design of the template like the tabs below the spec tabs...

Link to comment
Share on other sites

hello @@kymation

please tell me if i need to change in sql query in includes/modules/product_specifications.php. to group all specification names under specification group name tried with creating a temp array but it not worked.please let me know where i have to change code here.

thyank you...

Link to comment
Share on other sites

@@kymation

 

to add all these (specification group name ,specification name, specifications and category which is linked ) into database through excel sheet do you have any plugin

because i have many specification groups .i dont want to add manually.

 

help me if their is any addon to add all these values

 

Thanks&regards:

brchalla

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