Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Products Specifications


kymation

Recommended Posts

The original reasoning was that you would have to query the database for the filter values when they are read, and this could get slow if you have a lot of filters. Using the IDs would have probably been a better choice. Feel free to make that change, and when you do, please share your code with the rest of us.

 

Regards

Jim

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

Link to comment
Share on other sites

The original reasoning was that you would have to query the database for the filter values when they are read, and this could get slow if you have a lot of filters. Using the IDs would have probably been a better choice. Feel free to make that change, and when you do, please share your code with the rest of us.

 

Regards

Jim

 

I can't rewrite the code since I don't know how. I'm just a curious person that can pull the logic around.

 

I thought that since you are the add on creator, you might see the advantage of the change and perhaps you could know faster than anybody else where to rewrite the code.

 

I know someone that can rewrite the code but at a price. And he is actually thinking about create an add on for the filters only, without the other features products specifications add on have.

 

I'm looking forward for your advice.

 

Regards,

Paul

Edited by dvale
Link to comment
Share on other sites

I have thought of doing this. I even have it on my list of things to do. I just don't have the time to do it.

 

An addon for the filters alone would be easy enough -- just strip the product display and comparison parts out of PS. The hard part of filters (and comparisons, specifications, etc.) is the product data. The database structure and the Admin functions that feed it are the core of Product Specifications. The filters, comparison tables, etc just use that data in interesting ways. Since you need the core functions for any of these, why not just install the whole package? You might decide later to take advantage of some of the other features.

 

Regards

Jim

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

Link to comment
Share on other sites

Hello,

 

I am new to this contrib and I think I am setting something up wrong. I have created a test site to try this on installing a fresh version of osc 2.3.1 and then uploading the latest version of this contrib 1.1.11. I was wondering if someone could take a look at http://www.ckscs.com/ckcomputer/catalog/index.php?cPath=1_16 and tell me what I am doing wrong? The box on the left is where i think i have something set incorrectly in the configuration. Any assistance would be greatly appreciated.

 

Thank you,

Cliff

Link to comment
Share on other sites

Hello,

 

I am new to this contrib and I think I am setting something up wrong. I have created a test site to try this on installing a fresh version of osc 2.3.1 and then uploading the latest version of this contrib 1.1.11. I was wondering if someone could take a look at http://www.ckscs.com/ckcomputer/catalog/index.php?cPath=1_16 and tell me what I am doing wrong? The box on the left is where i think i have something set incorrectly in the configuration. Any assistance would be greatly appreciated.

 

Thank you,

Cliff

looks like something is wrong in generating the radio buttons, try changing to list of links (that is what I have and working well) - might give a clue to where the problem is.

I'm not sure if I have 1.1.11 or earlier version ...

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

Thank you. I am now receiving this error.

 

Fatal error: include() [<a href='function.include'>function.include</a>]: Cannot redeclare class bm_products_filter in /home/content/64/9542864/html/ckcomputer/catalog/includes/classes/osc_template.php on line 87

Link to comment
Share on other sites

Ok, actually i put it in both places because i wan't really sure which one I needed to replace. I put it in includes/modules/boxes first and nothing changed, so i put it in includes/languages/english/modules/boxes. I will replace the one in includes/languages/english/modules/boxes so you can take a look again if you need to. Thanks for your assistance, I really appreciate this.

Link to comment
Share on other sites

Ok, actually i put it in both places because i wan't really sure which one I needed to replace. I put it in includes/modules/boxes first and nothing changed, so i put it in includes/languages/english/modules/boxes. I will replace the one in includes/languages/english/modules/boxes so you can take a look again if you need to. Thanks for your assistance, I really appreciate this.

 

I replaced the file. If you need to take a look again you are more than welcome to.

 

Thanks,

Cliff

Link to comment
Share on other sites

Well it was worth a try. You'll have to debug it or wait for me to get the time to fix it.

 

Regards

Jim

 

Good copy. I appreciate your help. I will see what I can do or maybe there is someone else on here that might know.

 

Take care,

Cliff

Link to comment
Share on other sites

looks like something is wrong in generating the radio buttons, try changing to list of links (that is what I have and working well) - might give a clue to where the problem is.

I'm not sure if I have 1.1.11 or earlier version ...

 

Thank you, I have tried what you mentioned. Don't think that worked :-)

Link to comment
Share on other sites

I have thought of doing this. I even have it on my list of things to do. I just don't have the time to do it.

 

An addon for the filters alone would be easy enough -- just strip the product display and comparison parts out of PS. The hard part of filters (and comparisons, specifications, etc.) is the product data. The database structure and the Admin functions that feed it are the core of Product Specifications. The filters, comparison tables, etc just use that data in interesting ways. Since you need the core functions for any of these, why not just install the whole package? You might decide later to take advantage of some of the other features.

 

Regards

Jim

 

There is now a smart way to set special characters of filters over db table specification_filter_aliasses

 

catalog/includes/modules/products_filter.php

 

/////////////FIND/////////////

$filters_select_array[$filter_index] = array ('id' => ($filter_id),

'text' => $filter_text,

'count' => $count

);

$filter_index++;

 

 

/////////////PLACE BEFORE/////////////

$needles = array('slash', 'inch', 'comma');

$haystack = array('/', '"', ',');

$filter_text = str_replace($needles, $haystack, $filter_text);

 

/////////////So it looks like this/////////////

 

$needles = array('slash', 'inch', 'comma');
$haystack = array('/', '"', ',');
$filter_text = str_replace($needles, $haystack, $filter_text);
//str_replace($needles, $replacements, $string);
	 $filters_select_array[$filter_index] = array ('id' => ($filter_id),
												 'text' => $filter_text,
												 'count' => $count
												 );
	 $filter_index++;

 

So now you can replace special characters with keywords in this way:

/ = slash

" = inch

, = comma

...and so on, depending of your need.

 

For example to type:

 

3/4"

 

...now you type:

 

3slash4inch

 

In this way the filters and values are set with keywords allowing the proper display of the Special Characters.

 

Live example here https://www.shopperstation.com/auto_parts/index.php?cPath=3_12

 

Full credit to Henry Withoot

Donations will be accepted through PayPal

[email protected]

 

Regards,

Paul

Edited by dvale
Link to comment
Share on other sites

Well it was worth a try. You'll have to debug it or wait for me to get the time to fix it.

 

Regards

Jim

 

Looks like i am going to have to wait for you to fix it, i can not seem to figure out why it is not working correctly. It just looks like something is not being pulled to the page properly, plus the comparisons are not being displayed. I have them turned off now thinking maybe they were conflicting, but that didn't change anything.

 

Thanks again, i appreciate your time.

 

Take care,

Cliff

Link to comment
Share on other sites

I am going back through the files that require changes to be made to them and when i compare the OSC version of catalog/includes/modules/product_listing.php to the PS 1.1.11 version, winmerge is saying both files are identical. Could this be the problem?

 

Thanks,

Cliff

Link to comment
Share on other sites

The files are identical, so apparently all changes have been removed from product_listing.php in this version. This file will be removed from the next release. Thanks for the bug report.

 

product_listing.php is only used in (sub)category pages where there are products in that category. It has nothing to do with filters.

 

Regards

Jim

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

Link to comment
Share on other sites

The files are identical, so apparently all changes have been removed from product_listing.php in this version. This file will be removed from the next release. Thanks for the bug report.

 

product_listing.php is only used in (sub)category pages where there are products in that category. It has nothing to do with filters.

 

Regards

Jim

 

Good copy. Thought i had found the reason for my filters not displaying correctly. :( Still trying to figure this out.

 

Thanks,

Cliff

Link to comment
Share on other sites

I fix the same problem, by other way, because the spec name falls out from form tag :

In functions/product_specifications.php

I make new function:

function tep_get_filter_string_new ($display_type, $display_name, $filters_select_array, $target, $filter_name, $filter_value)

(using original function tep_get_filter_string). Added parm $display_name

After each row:

$box_text .= tep_draw_form('filter', $target, 'get');

I added:

$box_text .= "<b>" . $display_name . "</b><br>";

 

In file \includes\modules\boxes\bm_products_filter.php make some changes:

At row 119 original:

$box_label .= '<b>' . $specs_array['specification_name'] . '</b><br>';

change

//$box_label .= '<b>' . $specs_array['specification_name'] . '</b><br>';

At row 183 original:

$box_text .= tep_get_filter_string($specs_array['filter_display'], $filters_select_array, FILENAME_PRODUCTS_FILTERS, $var, $$var);

I change with:

$box_text .= tep_get_filter_string_new($specs_array['filter_display'], $specs_array['specification_name'], $filters_select_array, FILENAME_PRODUCTS_FILTERS, $var, $$var);

 

Thanks for this post, because without THIS POST I don't decided problem.

 

Jim,

 

I was able to fix my display problem by following this, but the display only looks correct using radio buttons, pulldowns and multiimages. So my display looks correct in the left box, but now the specification names are duplicated in the filter box under "Your Selected Products" (See below). Any thoughts?

 

http://www.ckscs.com/ckcomputer/catalog/products_filter.php?f5=Desktop&cPath=1_16&sort=products_name

 

Thanks,

Cliff

Edited by ckscs
Link to comment
Share on other sites

Jim,

 

I was able to fix my display problem by following this, but the display only looks correct using radio buttons, pulldowns and multiimages. So my display looks correct in the left box, but now the specification names are duplicated in the filter box under "Your Selected Products" (See below). Any thoughts?

 

http://www.ckscs.com/ckcomputer/catalog/products_filter.php?f5=Desktop&cPath=1_16&sort=products_name

 

Thanks,

Cliff

 

Ok, I think I got it, in catalog/includes/modules/product_filter.php i found $box_text .= '<b>' . $specs_array['specification_name'] . '</b><br>'; and commented it out (//). Now it looks good. See below.... I can not get the count to show or the comparisons to show, that is my only problems now that i can see.

 

// print $filters_query_raw . "<br>\n";

$filters_query = tep_db_query ($filters_query_raw);

 

$count_filters = tep_db_num_rows ($filters_query);

$filters_select_array = array();

if ($count_filters >= SPECIFICATIONS_FILTER_MINIMUM) {

$filters_array = array();

 

//$box_text .= '<b>' . $specs_array['specification_name'] . '</b><br>';

Link to comment
Share on other sites

Read the User's Manual section on filters. There is information there on setting up filters using checkboxes. You may want to use Radio buttons instead, depending on the way you want the filters to work. Compare the instructions for the two in the manual.

 

You may need to do some CSS formatting to make the Filters box look the way you want. I have an improved filters box around here somewhere; let me know if you would like to try it.

 

Regards

Jim

 

Hey Jim, If you still have that improved filters box, i would like to try it if i may.

 

Thanks,

Cliff

Link to comment
Share on other sites

I've been looking, but I can't find that code. It's probably archived somewhere. I'll look again, but it might be easier to just rebuild it.

 

Regards

Jik

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

Link to comment
Share on other sites

I've been looking, but I can't find that code. It's probably archived somewhere. I'll look again, but it might be easier to just rebuild it.

 

Regards

Jik

 

No worries Jim. I appreciate all of your help. I have figured out how to get the filters in a styled box on the left or right columns. Now I just have to figure out how to change the filters box style that is set by the Filters Module Frame Style setting. Is that something you can help with quickly? If not no worries, I will work on it.

 

Thanks again for all your help,

Take care,

Cliff

Link to comment
Share on other sites

That was a set of style options for osCommerce 2.2. They should still work in 2.3, but it might be better to change the box to use the jQuery UI styles.

 

Regards

Jim

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

Link to comment
Share on other sites

That was a set of style options for osCommerce 2.2. They should still work in 2.3, but it might be better to change the box to use the jQuery UI styles.

 

Regards

Jim

 

That is what I am having a hard time finding, which jQuery styles to change. When i inspect element using google chrome, it is showing that box as a css. It is the very old OSC grey style box. You are welcome to take a look, maybe i have a wrong file? http://www.ckscs.com/ckcomputer/catalog/products_filter.php?f5=0&f2=0&cPath=1_16&sort=products_name

 

That is really not a big deal, it does not look bad with that set as plain.

 

I have one more question for you, if you don't mind. Is there a way to be able to search the specifications? I have a specification set up that I do not have set as a filter, but when i search for it using the search box, it does not show the item.

 

Thanks again and take care,

Cliff

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