Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Products Specifications


kymation

Recommended Posts

This could be an issue with the collation, but that's something I have no experience with. I've only used the utf8_general_ui collation.

 

There is an Addon for CKeditor for 2.3.1. I don't know if that would work for you, but it might be worth trying.

 

Regards

Jim

 

This could be an issue with the collation, but that's something I have no experience with. I've only used the utf8_general_ui collation.

 

There is an Addon for CKeditor for 2.3.1. I don't know if that would work for you, but it might be worth trying.

 

Regards

Jim

 

Hi Jim so i change collation utf_general_ci

 

editor wrong save polish chars :/ and is the same

 

without editor polish chart save to data base good

 

have you any idea?

Link to comment
Share on other sites

Hi Jim thx for above solution,

 

I have another problem with header's

 

 

%s Porównanie = comparassion

 

Header insted of tilte page i have the same text "%s Porównanie

 

looks:

http://www.sklep.emcmoda.pl/privacy.php
[url="http://www.sklep.emcmoda.pl/shopping_cart.php"]http://www.sklep.emcmoda.pl/shopping_cart.php[/url]

 

 

BR

Michał

 

 

 

I would like to on each page a different header was in a few cases I shows a comparison string insted of right header

 

i do not know where i must change the code.

 

BR Michał

Link to comment
Share on other sites

You have the right idea. What you want will require some custom coding. The filters will do what I see in your example, but you will need to change the formatting to get it to look like that.

 

That is beyond what this forum is for. You'll need to do that part yourself.

 

Regards

Jim

 

Sorted, works and looks great.

 

If anyone wants the code PM me...

 

Any question - Has any got this working with multiple product categories (products can go in multiple categories)?

Link to comment
Share on other sites

Glad to hear you got it to look the way you want it to.

 

Multiple categories should work if you assign the same Specification Groups to all of the categories that contain the multi-category products.

 

Regards

Jim

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

Link to comment
Share on other sites

Jim,

 

I just came across this topic about mysql5 performance improvements and someone mentioned this function which to me would be ideal if it was implemented on the products info specification tab for multi-valued items ,

http://mahmudahsan.wordpress.com/2008/08/27/mysql-the-group_concat-function/

 

Just thought I'd mention it here, not sure though if you want to put mysql5 as a minimum requirement for the contribution, but I personally wanted to list the values on a single line, so if I can easily modify the contribution to make use of this, I might have it up-and-running soon ...

I'll keep you posted should I get further with this...

 

Cheers,

Carine

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

it looks like it is very easy, at least on my site it seems to work fine

In catalog/includes/modules/products_specifications.php

find at the top of the file

  $specifications_query_raw = "select ps.specification,

replace with

  $specifications_query_raw = "select group_concat(ps.specification) as specification,

 

find a little further down in the same sql query:

							   order by s.specification_sort_order,
								    sd.specification_name

add this group by line, just above it:

                               group by sd.specification_name

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Then you get the results as a string instead of an array. That's fine if you need a string containing the values. In most cases, we need to step through he results and take some action on each one. That would require converting the string back into an array and then stepping through the array. I'm not sure there is any benefit in this case.

 

Regards

Jim

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

Link to comment
Share on other sites

At the moment, I only have it done on the product_info page

without it:

 

Specifications:
  • Diameter: 20 cm
  • Suitable for: Ovenproof
  • Suitable for: Ceran
  • Suitable for: Electrical
  • Suitable for: Gas
  • Suitable for: Induction
  • Type: Non-Stick Pan
  • Interior Surface: Ceramic Coating
  • Shape: Round
  • Dishwasher Safe: No

with it

Specifications:
  • Diameter: 20 cm
  • Suitable for: Ceran,Electrical,Gas,Induction,Ovenproof
  • Type: Non-Stick Pan
  • Interior Surface: Ceramic Coating
  • Shape: Round
  • Dishwasher Safe: No

This is an easy fix for me, it does exactly what I was looking for, without having to put any switch in the code to change the logic for multi-values specs.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Just a quick heads up for anyone trying to optimize seo wise and possibly saving some server load (as I am trying to)

f you are really worried about it, you can add a noindex meta tag to the Filters page, or add rel=nofollow to the filter links, or best of all, add the filters.php to the denied list in your robots.txt. Any of those should keep the search engines out of any potential duplicate content.

 

I'm adding the rel=nofollow to the generation of the links in the includes/functions/products_specifications.php file.

I'm assuming google doesn't do any form submissions on my site

 

and have added to robots.txt (-fc- is the string matching the url-rewrite for my products_filter.php file).

Disallow: /*-fc-

This way, it is keeping search engines out of the filter result pages, but the category and manufacturer listings are still available to the search engines.

 

Should I want google to index specific pages, I believe I can still write-out the native format of the url with products_filter.php in the url and not the rewritten version, as I only added disallow to the robots.txt file for the rewritten url and not the actual filename.

Edited by bruyndoncx

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

  • 2 weeks later...

Hi Jim

 

I don't know how fix it

http://www.sklep.emcmoda.pl/plaszcz-damski-k1111-p-33.html

 

 

when i click tab tell a friend or ask a question instead of send emial the script adding the product to the bin where is bug

 

I receive below emial:

dfsfsf

 

Here is the product link:

[url="http://www.sklep.emcmoda.pl/-p-.html"]http://www.sklep.emcmoda.pl/-p-.html[/url]

// this link is wrong why ?

 

-dfsfd

 

 

 

BR

Michał

Edited by emcmoda
Link to comment
Share on other sites

It appears there is a misplaced </form> tag in product_info.php. Move that line to just before this code:

<?php
   include_once (DIR_WS_MODULES . FILENAME_PRODUCTS_TABS);
// End Products Specifications

Regards

Jim

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

Link to comment
Share on other sites

It appears there is a misplaced </form> tag in product_info.php. Move that line to just before this code:

<?php
include_once (DIR_WS_MODULES . FILENAME_PRODUCTS_TABS);
// End Products Specifications

Regards

Jim

 

 

Hmm it isn't this :/

 

my info_products.php

<?php
/*
 $Id: product_info.php $
 $Loc: catalog/ $
 $Mod: Products Specifications 1.1 20110715 kymation $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2010 osCommerce
 Released under the GNU General Public License
*/
 require('includes/application_top.php');
 define('TEXT_XSELL_PRODUCTS', 'Akcesoria  / Polecane produkty');
 require( DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO );
// Start Products Specifications
 require_once (DIR_WS_FUNCTIONS . 'products_specifications.php');
// Process data from the on-page forms
 require_once( DIR_WS_MODULES . 'product_info_process.php' );
// End Products Specifications
 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);
// Start Products Specifications
 if (SPECIFICATIONS_BOX_FRAME_STYLE == 'Tabs') {
   // Insert the javascript for the tabs
   $head_javascript = '  <script language="javascript" type="text/javascript">' . PHP_EOL;
   $head_javascript .= '    $(document).ready(function(){' . PHP_EOL;
   $head_javascript .= '	  initTabs();' . PHP_EOL;
   $head_javascript .= '    });' . PHP_EOL;
   $head_javascript .= '    function initTabs() {' . PHP_EOL;
   $head_javascript .= "	  $('#tabMenu a').bind('click',function(e) {" . PHP_EOL;
   $head_javascript .= '	  e.preventDefault();' . PHP_EOL;
   $head_javascript .= '	  var thref = $(this).attr("href").replace(/#/, "");' . PHP_EOL;
   $head_javascript .= "	  $('#tabMenu a').removeClass('active');" . PHP_EOL;
   $head_javascript .= "	  $(this).addClass('active');" . PHP_EOL;
   $head_javascript .= "	  $('#tabContent div.content').removeClass('active');" . PHP_EOL;
   $head_javascript .= "	  $('#'+thref).addClass('active');" . PHP_EOL;
   $head_javascript .= '	  });' . PHP_EOL;
   $head_javascript .= '    }' . PHP_EOL;
   $head_javascript .= '  </script>' . PHP_EOL;
   $head_javascript .= '  <script src="ext/jquery/star_rating/jquery.rating.pack.js" type="text/javascript" language="javascript"></script>' . PHP_EOL;
   $head_javascript .= '  <link href="ext/jquery/star_rating/jquery.rating.css" type="text/css" rel="stylesheet"/>' . PHP_EOL;
   $oscTemplate->addBlock( $head_javascript, 'header_tags' );
 }
 require( DIR_WS_INCLUDES . 'template_top.php' );
// echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'));
?>
<?php
 if ($product_check['total'] < 1) {
?>
<div class="contentContainer">
 <div class="contentText">
   <?php echo TEXT_PRODUCT_NOT_FOUND; ?>
 </div>
 <div style="float: right;">
   <?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
 </div>
</div>
<?php
 } else {
// Products Specifications
   $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_tab_1, pd.products_tab_2, pd.products_tab_3, pd.products_tab_4, pd.products_tab_5, pd.products_tab_6 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);
   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }
   if (tep_not_null($product_info['products_model'])) {
  $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
  $products_name = $product_info['products_name'];
   }
?>
<div>
 <h1 style="float: right;"><?php echo $products_price; ?></h1>
 <h1><?php echo $products_name; ?></h1>
</div>
<div class="contentContainer">
 <div class="contentText">
<?php
   if (tep_not_null($product_info['products_image'])) {
  $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order");
  if (tep_db_num_rows($pi_query) > 0) {
?>
   <div id="piGal" style="float: left;">
  <ul>
<?php
 /*   $pi_counter = 0;
    while ($pi = tep_db_fetch_array($pi_query)) {
	  $pi_counter++;
	  $pi_entry = '	    <li><a href="';
	  if (tep_not_null($pi['htmlcontent'])) {
	    $pi_entry .= '#piGalimg_' . $pi_counter;
	  } else {
	    $pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image']);
	  }
	  $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $pi['image']) . '</a>';
	  if (tep_not_null($pi['htmlcontent'])) {
	    $pi_entry .= '<div style="display: none;"><div id="piGalimg_' . $pi_counter . '">' . $pi['htmlcontent'] . '</div></div>';
	  }
	  $pi_entry .= '</li>';
	  echo $pi_entry;
    }*/
  $pi_counter = 0;
    while ($pi = tep_db_fetch_array($pi_query)) {
	  $pi_counter++;
	  $pi_entry = '	    <li><a href="';
	  $pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image']);

	  $pi_entry .= '" target="_blank" rel="fancybox" title="' . $pi['htmlcontent'] . '">' . tep_image(DIR_WS_IMAGES . $pi['image'], $pi['htmlcontent']) . '</a>';
	  $pi_entry .= '</li>';
	  echo $pi_entry;
    }
?>
<?php
?>
  </ul>
   </div>
<script type="text/javascript">
$('#piGal ul').bxGallery({
 maxwidth: 600,
 maxheight: 500,
 thumbwidth: <?php echo (($pi_counter > 1) ? '55' : '0'); ?>,
 thumbcontainer: 300,
 load_image: 'ext/jquery/bxGallery/spinner.gif'
});
</script>
<?php
  } else {
?>
   <div id="piGal" style="float: left;">
  <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?>
   </div>
<?php
  }
?>
<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
 cyclic: true
});
</script>
<?php
   }
?>
<?php //echo stripslashes($product_info['products_description']); ?> 
   <div style="clear: both;"></div>
<?php
   echo tep_draw_form ('cart_quantity', tep_href_link (FILENAME_PRODUCT_INFO, tep_get_all_get_params (array ('action') ) . 'action=add_product') );
?>
<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
   <p><?php echo TEXT_PRODUCT_OPTIONS; ?></p>
   <p>
<?php
  $products_id = ( int )$_GET['products_id'];
  $options_array = tep_get_products_attributes( $products_id, ( int )$languages_id, $product_info['products_tax_class_id'] );
  if( $options_array != false && is_array( $options_array ) && count ($options_array) > 0 ) {
    foreach( $options_array as $options ) {
	  echo tep_select_attributes( $products_id, $options, $languages_id, $product_info['products_tax_class_id'] );
    }
  }
?>
   </p>
<?php
   }
?>
 <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>
  <?php //echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?>
 </div>
  <!--- BEGIN Header Tags SEO Social Bookmarks -->
  <?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
	 echo '<div style="margin-top:5px;">';
	 include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php');
	 echo '</div>';
  }
  ?>
 <div style="clear: both;"></div>
 <br />
<?php
   include_once (DIR_WS_MODULES . FILENAME_PRODUCTS_TABS);
// End Products Specifications
?>
   <div style="clear: both;"></div>
<?php
   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
   <p style="text-align: center;"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></p>
<?php
   }
?>
 </div>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1");
   $reviews = tep_db_fetch_array($reviews_query);
?>
<?php
   if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
   } else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }

 /*** Begin Header Tags SEO ***/
   if (! tep_not_null($header_tags_array['title'])) {
	  $header_tags_array['title'] = $product_info['products_name'];
   } 
   echo '<div class="ui-widget-header ui-corner-top infoBoxHeading" style="margin-top:5px; text-align:center;">' . TEXT_VIEWING . ' ';
   echo '<a title="' . $header_tags_array['title'] . '" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL') . '"/# ' . $header_tags_array['title'] . '">' . $header_tags_array['title'] . '</a></div>';
  /*** End Header Tags SEO ***/
  ?> 

</div>
</form>
<?php
 }
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Link to comment
Share on other sites

  • 2 weeks later...

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

 

 

Hi ALL - i am having an issue with "Ask a question" - no emails sent - anyone in the same boat????

 

is there an issue with this line (includes/modules/ask_a_question.php)?:

<?php echo tep_draw_form ('ask_a_question', tep_href_link (FILENAME_PRODUCT_INFO, tep_get_all_get_params (array ('action') ) . 'action=process&products_id=' . $_GET['products_id']) ); ?>

 

 

I have attached my ask_a_question.php file

 

you will notice i have also added the re-capatcha ability.

 

thanks

Link to comment
Share on other sites

  • 4 weeks later...

 

 

Hi,

 

Yes it is possible, but before need to fix tabs for page navigation and correct return position. As specification contribution will be stabilised (now work with cookies for me) I will do it. It looks like working for every extra contributions.

 

There are more possibilities for stabilisation but first need some discussions. The simple Jquery cookies stabilized for all pages at the same time. I think it would be better to fix for unique pages.

My opinion that need to pass the fix as session variable.

 

Regads,

Gergely

 

Could you solve this problem already?

I'm still blocked because of this and I'm waiting for the solution

please thank you to inform me

Link to comment
Share on other sites

thank you for this contribution, i tried to install it on a modified copy but i failed, now i'm testing the contribution on a clean 2.3.1

but i'm facing the following 2 problems:

1 - the filter is not reading the givin values (here)

2 - the product info page is not displaying the tabs but its showing (this) error

 

Ludwig

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