Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Products Specifications


kymation

Recommended Posts

Hi Jim,

 

Just a quick one. I know you are very busy. I been trying to solve the errors in my web pages. how do i get rid of ones like "Undefined variable '$languages'" in the product_specs page?

 

there are numerous others like "no start tag" etc. I have not made any changes to the files they are downloaded from your product specs link

 

Regards

 

Bret

Link to comment
Share on other sites

Hi Jim thanks for your solutions, second bug is resolved

Below is my settings filters can you check for me ?

 

ps.jpg

 

Regards

Michał

You are showing a price column, which is correct, but you don't have any other columns to show on that page, so the page is confusing. When you select a product from the pulldown, the resulting page shows the products correctly.

 

I don't see a problem here. You need to be more specific in what you think is wrong.

 

Regards

Jim

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

Link to comment
Share on other sites

Hi Jim,

 

Just a quick one. I know you are very busy. I been trying to solve the errors in my web pages. how do i get rid of ones like "Undefined variable '$languages'" in the product_specs page?

 

there are numerous others like "no start tag" etc. I have not made any changes to the files they are downloaded from your product specs link

 

Regards

 

Bret

$languages should be defined with a line like this:

 

        $languages = tep_get_languages();

I can't give any more detailed advice without knowing the line number the error message is showing.

 

"No start tag" usually means that the validator got confused, usually by a previous error message. A real missing tag will normally distort the page layout. Again. I can't be more specific without the actual error message.

 

Regards

Jim

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

Link to comment
Share on other sites

if you look at 'catalog/admin/includes/modules/products_specifications.php' line 42

sg2c.categories_id = '" . (int) $current_category_id . "'

 

I am using zend 8.0 and it tells me that "$current_category_id" is undefined.

 

There are numerous others like line 66,67,69 where it says that "$languages" is also undefined.

 

There are also warnings such as

Multiple annotations found at this line:

- Undefined variable '$i'

- Occurrence of '$i'

 

Is this error or warning anything to worry about?

Link to comment
Share on other sites

$current_category_id is defined in admin/includes/application_top.php. There is a serious error in your code if that is undefined. It's essential to the stock osC code as well as the specifications code.

 

$languages should also be defined before that file is called, i.e. in line 854 of admin/categories.php. Again, this is an essential define.

 

$i is a loop index on $languages. I'm not surprised that it's missing when the main variable is missing.

 

You're going to have to track this one down. I can't duplicate the error on my test site.

 

Regards

Jim

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

Link to comment
Share on other sites

My website is going to list electronic products such as TV's, i'm going to need a specification page which will have attributes such as:

Format, Screen size, HD ready, Frame rate, Contrast, Resolution, Audio Power, Speakers, Connectivity

 

Will this add on allow me to do this?

 

- Kimb3r

Link to comment
Share on other sites

If you mean a separate page for each product, you would need to modify the code to do that. If you mean on the regular product page, then yes. If you mean a comparison page that lists those specifications for each product in a category, also yes.

 

Regards

Jim

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

Link to comment
Share on other sites

Hi Jim,

 

Just a quick one. How do i get the product description to keep the same formatting when it is displayed. When i enter it it looks ok, but when you look at the website it does not seem to do the crlf. it just makes it into one complete sentence.

 

Also do you know how i may show the technical specs of my products in a table format?

 

 

Regards

 

Bret

Link to comment
Share on other sites

As always in osCommerce, the description must be formatted with HTML. You can do this easily by installing the ckeditor addon, which Product Specifications supports by default.

 

You can change the way the specifications show on a page by changing the CSS or by modifying the code to use tables instead of the default list.

 

Regards

Jim

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

Link to comment
Share on other sites

Thanks, I downloaded the ckeditor addon, just having one issue. The installation document tell me to find <script language="javascript" src="includes/general.js"></script> in the admin/categories.php file.

 

There is no line in the file like this?

 

Any ideas where i need to add the reference to the ckeditor.js file ?

 

 

Regards

 

Bret

Link to comment
Share on other sites

Hi,

I got the ckeditor up in the descriptions admin section.

all works fine. but then i go to the web site and it is add extra characters "\r\n"

If i then go back to the editor it also shows up the "\r\n" extras???

 

Any ideas?

 

Bret

Link to comment
Share on other sites

That's the Windows Return character. It doesn't do that on my copy. Were you pasting in something from another source?

 

Regards

Jim

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

Link to comment
Share on other sites

I don't see this problem so I'm going to have to guess here. Try changing line 22 of catalog/includes/functions/clean_code.php from this:

  	$html_from_database = html_entity_decode( addslashes( $html_from_database ) );

to this:

  	$html_from_database = html_entity_decode( $html_from_database );

Let me know if that actually works. If it doesn't, and it certainly should not, I'll probably have to write a filter for the problem string.

 

Regards

Jim

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

Link to comment
Share on other sites

Next try -- in the same file, replace this line:

    $evaluated_html = stripslashes( stripslashes( $evaluated_html ) );

with this:

   $evaluated_html = str_replace( '\\r\\n', '', $evaluated_html );
   $evaluated_html = stripslashes( $evaluated_html );
   $evaluated_html = str_replace( "\r\n", '', $evaluated_html );
   $evaluated_html = stripslashes( $evaluated_html );

Regards

Jim

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

Link to comment
Share on other sites

still no joy,

 

If i keep going into the product description in admin and click save on the ckeditor it keeps added rubbish.

This is after saving three times without changing any text

 

 

\r\n \\\\r\\\\n \\\\\\\\\\\\\\\\r\\\\\\\\\\\\\\\\n test

 

\r\n

 

\r\n \\\\r\\\\n

 

\r\n

 

\r\n \\\\r\\\\n \\\\\\\\\\\\\\\\r\\\\\\\\\\\\\\\\n

 

\r\n

 

\r\n \\\\r\\\\n

 

\r\n

 

If i add another (larger image) and add text in the ckeditor there it saves fine????

 

I am really confused now. If i view the second image on the website , click it the popup shows perfectly

Link to comment
Share on other sites

This won't fix the problem if the database is already corrupted. Delete everything and start over with a clean page.

 

Regards

Jim

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

Link to comment
Share on other sites

Version 1.1.8 has been uploaded to the Addons page. It's also available from my server until the official upload is approved.

 

This update fixes a couple of bugs, one of which was discussed in this thread.

 

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 the old version products_specifications_1_0_2.tar.gz and coded it into my osC 2.3.1 store 2-3 months ago - now I see that yoyu released a version for 2.3.1

 

Do you recommend me to upgrade/change all my work?

What has changed?

 

Is it possible to place the code from products_fiters.php into index.php so you don't have 2 seperate files (and links)?

 

Best wishes,

Dominik

Link to comment
Share on other sites

The only changes in version 1.1 are for osC 2.3.1 compatibility. No need to change if you have everything working the way you want it to.

 

The two files could certainly be combined. It would be a lot of work with no real benefit, so I see no reason to do so. Feel free to code that if you want to.

 

Regards

Jim

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

Link to comment
Share on other sites

thanks for your answers :)

 

I am not really sure if I will try to combine these two files - let me explain why I thought about doing this:

I have themed the files to look the same, so the customer starts off on index.php with the filter section on the left hand side,

when he clicks on a filter he will get redirected to products_filter.php - it all looks still the same but with the filter applied.

 

So that is fine with me, but I think it is bad for SEO purposes because the same page contents are available on 2 different URL's,

which is basically duplicate content.

 

It would be cool if all the filters would work in the index.php - attaching the filters to the URL.

 

I am not sure if this is worth doing, especially because my knowledge is kind of okay, but definitely not good enough to do code changes

that you describe as "lots of work" :)

Edited by BiBS0N
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...