Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Development] Products Specifications


kymation

Recommended Posts

1. This was tested using MySQL 5.0.67. No errors were reported. I still don't know how you are getting this error. Possibly some setting in your MySQL is forcing stricter syntax?

 

2. catalog/includes/modules/products_filter.php displays the filters. catalog/products_filter.php displays the products selected by the filter(s). catalog/includes/classes/specifications.php and catalog/includes/functions/products_specifications.php are also used.

 

Regards

Jim

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

Link to comment
Share on other sites

1. This was tested using MySQL 5.0.67. No errors were reported. I still don't know how you are getting this error. Possibly some setting in your MySQL is forcing stricter syntax?

 

2. catalog/includes/modules/products_filter.php displays the filters. catalog/products_filter.php displays the products selected by the filter(s). catalog/includes/classes/specifications.php and catalog/includes/functions/products_specifications.php are also used.

 

Regards

Jim

http://foto-bomba.ru/products_filter.php?f52=0-cpu&sort=products_name

It's oscom rc2 and your product. Nothing else!

Filter class:reverse

If you need - i'll take you admin pass and login.

 

1054 - Unknown column 'ps.specification' in 'where clause'

 

select count(p.products_id) as count from (products p) join (products_to_categories p2c) on (p.products_id = p2c.products_id) left join (specials s) on (p.products_id = s.products_id) INNER JOIN products_specifications ps52 ON p.products_id = ps52.products_id where p.products_status = '1' AND 'cpu' BETWEEN SUBSTRING_INDEX(ps.specification,'-',1) AND SUBSTRING_INDEX(ps.specification,'-',-1) AND ps52.specifications_id = '52' AND ps52.language_id = '1'

Link to comment
Share on other sites

This is your error: (ps.specification,'-',1) AND SUBSTRING_INDEX(ps.specification,'-',-1)

That ps.specification should be ps52.specification. The specification ID is missing. Find this code in catalog/includes/functions/products_specifications.php (line 542):

 

          $sql_array['where'] .= " AND " . $filter_array[0] . " BETWEEN SUBSTRING_INDEX(ps.specification,'-',1) AND SUBSTRING_INDEX(ps.specification,'-',-1)

and replace it with

 

          $sql_array['where'] .= " AND " . $filter_array[0] . " BETWEEN SUBSTRING_INDEX(ps" . $specifications_id . ".specification,'-',1) AND SUBSTRING_INDEX(ps" . $specifications_id . ".specification,'-',-1)

I haven't tested this yet, so please let me know if it works.

 

Regards

Jim

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

Link to comment
Share on other sites

This is your error: (ps.specification,'-',1) AND SUBSTRING_INDEX(ps.specification,'-',-1)

That ps.specification should be ps52.specification. The specification ID is missing. Find this code in catalog/includes/functions/products_specifications.php (line 542):

 

          $sql_array['where'] .= " AND " . $filter_array[0] . " BETWEEN SUBSTRING_INDEX(ps.specification,'-',1) AND SUBSTRING_INDEX(ps.specification,'-',-1)

and replace it with

 

          $sql_array['where'] .= " AND " . $filter_array[0] . " BETWEEN SUBSTRING_INDEX(ps" . $specifications_id . ".specification,'-',1) AND SUBSTRING_INDEX(ps" . $specifications_id . ".specification,'-',-1)

I haven't tested this yet, so please let me know if it works.

 

Regards

Jim

 

I did:

1) Installed osCommerce Online Merchant v2.2 Release Candidate 2a

2) Copy all files from products_specifications_1_0_1.zip to catalog.

3) Execute SQL-query from products_specifications.sql

4) Get this error.

 

Now (with Your fix) it works on foto-bomba.ru!

 

But i still can't to resoluve my trouble on hello.od.ua :(

"catalog/includes/classes/specifications.php and catalog/includes/functions/products_specifications.php are also used."

This string interesting. Which file makes a query to database(or something else) to detect that "specification of product" is?And the script can begin to use "Filter Class" and then show results?

"

Link to comment
Share on other sites

They are all used. You will need to track down the error yourself; I can't do it from here. I would start by disabling all but one filter and trace taht one out through the code. Once you find that error, the rest will probably work.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 3 months later...

Great Contrib!

 

I installed the latest version, but I have one error. When I try to send an e-mail using tab ask a question, I get the following error:

Error Error: Your name must not be empty.

Error Error: Your e-mail address must be valid.

 

What is wrong?

 

Thanks for the help

Link to comment
Share on other sites

It sounds like the data is being lost somewhere between the form and the processing. The form is in catalog/includes/modules/ask_a_question.php and the processing is done in the top of catalog/product_info.php. You'll have to track down the error from there.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Hi there.

Im not quite sure if this is the right place to post, but i think so.

 

This contrib is really great and it works like a charm in the admin-backend.

 

However, i've installed a contrib called "Customer Add Product", wich make it possible for my customers to add products to my store. But its really buggy, so i have gone throu the code and got it to work for 95%. So im almost finished.

 

*****************************************

Here goes my problem;

In the admin-backend, when i add a product, the "text fields" for this contrib is about 420px width.

But in the front end (Customer Add Product), the "text fields" are only 1 px width.

*****************************************

 

I've copied all the "admin php-files" to the front end to make it work (but changed some file-names so it wont crash due to file names that already existed there. (also added these to filenames.php and changed in Customer Add Product-pages so it will match).

 

Do you have any clue what i've missed?

 

(The drop down lists all works perfect. Its just the text-fields that are buggy).

 

Cheers

Link to comment
Share on other sites

I have no idea. Combining two Addons can create any number of weird interactions. Perhaps somebody else here has tried this combination. Given the relative rarity of this Addon, I suspect you're on your own.

 

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 no idea. Combining two Addons can create any number of weird interactions. Perhaps somebody else here has tried this combination. Given the relative rarity of this Addon, I suspect you're on your own.

 

Regards

Jim

 

Okey.

Is it possible to change the "textarea" into a "textfield" instead maybe? And tell it to be size="40" for example?

Link to comment
Share on other sites

It should be possible, but I don't see that it would work very well. You should just fix the text field so it works as it should.

 

Regards

Jim

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

Link to comment
Share on other sites

Okey, got it to work as an input field.

Just changed 2 lines in Products_specifications_input.php (in modules)

 

echo tep_draw_textarea_field ('products_specification[' . $id . '][' . $languages[$i]['id'] . ']', '', '70', '3', $products_specification);

to

echo tep_draw_input_field ('products_specification[' . $id . '][' . $languages[$i]['id'] . ']', '', '70', '3', $products_specification);

 

......................

 

Now i have an additional problem. When i add a new product, my specification looks like this: (both in admin and Customer Add Product)

specs_1.jpg

First: The name and description only applys to my default language, and not to both Swedish and English.

Second: I would love to have the descriptions to the right side of the box. Is that possible?

Third: Can i get an additional <br /> after each specification?

 

This is how i would want it to look like:

specs_2.jpg

Edited by Zane86
Link to comment
Share on other sites

There is an error in your code. The parameters for tep_draw_input_field() are not the same as the parameters for tep_draw_textarea_field(). You need to fix that or the function will not work properly.

 

Your changes to the layout can be made in the same location that you made the function changes. Just change the HTML to reformat it.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

This is a post form Rose form the other support forum. Would like to know if anybody has gotten this to work. Found a workaround to the problem but would like this contribution to work on its own.

 

I have also installed your add on to a clean osCommerce-2.2rc2a. I have the same problem as James. I noticed that the products_specifications table is not being updated, and therefore the column name specifications are not showing on the site. When I manually enter the information in this table, everything worked well. The SQL below gives us some of the information we need:

 

"SELECT s.specifications_id, s.specification_group_id, s.products_column_name, p2c.products_id

FROM products_to_categories p2c,

specifications s,

specification_groups_to_categories sg2c

WHERE s.specification_group_id = sg2c. specification_group_id

and sg2c.categories_id = p2c.categories_id

and s.specifications_id = '" . $current_specification_id . "';"

 

 

 

I realize there needs to be more, and the statement isn't complete, however you can see my thought process. Where would we put the code snippet we need? I was thinking the catalog/admin/products_specifications.php file? I have been trying to follow the code, but your help would be greatly appreciated. This addon is complex and I'm not sure if I am following the code properly. Thank you for this valuable contribution to osCommerce.

 

Thank you,

 

James

Link to comment
Share on other sites

I'm a bit puzzled by this. The products_specifications table is updated by making entries in Admin > Categories/Products > [select product] > Edit. If the fields are not showing up, you have an error of some sort in your setup.

 

There must be at least one Specification field defined that is not linked to an existing field. Otherwise, I need more information to figure out what's gone wrong.

 

Regards

Jim

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

Link to comment
Share on other sites

It sounds like the data is being lost somewhere between the form and the processing. The form is in catalog/includes/modules/ask_a_question.php and the processing is done in the top of catalog/product_info.php. You'll have to track down the error from there.

 

Regards

Jim

 

Thanks for the reply Jim.

 

I fixed the error, i get a response successfully sent. Nevertheless, I don't get any e-mail.

 

Can you please help?

 

Thanks!

Link to comment
Share on other sites

Email uses the same osCommerce function that all other email is sent from. Are you getting other emails from the site, such as the cart checkout? If you are, put some print statements in the top of product_info.php to check the variables the form is sending. You will need to comment out the redirect for these to show.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 4 weeks later...

If you mean the New/Update Products form in the Admin, just save your changes and the defaults will be applied for all Specifications. If you've made changes to any of them, then the changed values will be saved.

 

If that's not what you meant, then I don't understand the question.

 

Regards

Jim

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

Link to comment
Share on other sites

I'm sorry Kymation,

i realized now i really didnt explain it well.

 

I'm talking about the filter box which you can enable at the top of each category, on the catalog client side.

Lets' say a cpu has 2 Specification checkboxes: Frequency and Brand.

Now, as things are now, if a user were to select 2,2 ghz AND intel, he would first need to click on 2,2 then press the filter button, then again after the page reloaded, click on INTEL and click again the filter.

 

This happens since there's multiple forms in one page ... Any way to make it 'single' (ie: the user can click on the same page the checkboxes of 2,2 and intel and then click a single filter button?)

 

Thanks in advance

Link to comment
Share on other sites

That only happens if you have Javascript disabled. The filters will normally update automatically as soon as one is clicked. You could change the filter code to apply a single form to the entire filters box, but you'll have to make changes to the code to do that.

 

Regards

Jim

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

Link to comment
Share on other sites

Thanks Kymation,

yeah probable the update on click code has been broken by the fact that i added css checkboxes on the filters.

I will later install a vanilla version and try to reinstate that.

 

Putting everything in a single form, i did that already, didnt seem to work dont know why. was only passing along the cpath not the checked values ...

Thanks again for your answer!

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