Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Optional Related Products, Version 4.0


Skittles

Recommended Posts

Hi PJ2006.

 

Your efforts to troubleshoot will go easier if you learn how to read the error messages. I don't claim to be an expert at it, but the error messages in your previous posts are all very helpful.

 

First, anytime you get an error message that includes a term in all uppercase, you have a constant that isn't defined. For example, a few posts back, you listed the following error:

 

1146 - Table 'effortle_oscl.TABLE_COUNTER' doesn't exist

In this case, TABLE_COUNTER wasn't defined in the database_tables.php file (or equivalent STS file). As it had been working previously, I would suspect a change you made for this contribution introduced an error in that file. As the file only contains a list of define statements, my guess would be the new table definition was entered without the ending semi-colon (";").

 

We see this kind of error most often when an installation step was missed and a filename, database table or text definition wasn't added to the appropriate file.

 

Next, the errors that begin "Fatal error: Cannot redeclare" are telling you the same function has been "declared" in more than one place. And then the message goes on to tell you exactly where it is declared:

 

Fatal error: Cannot redeclare tep_set_banner_status() (previously declared in /home/effortle/publich_html/catalog/includes/functions/general.php:706) in /home/effortle/public_html/catalog/includes/functions/banner.php on line 15

This message tells you that "function tep_set_banner_status()" exists on line 706 of general.php, and that is also exists on line 15 of banner.php. A quick search of the files in an unmodified version of osc shows me that it belongs in banner.php, so you need to remove it from general.php. If the copy in general.php contains any recent changes (not part of this contribution, for anyone listening in) you should 'cut' it from general and 'paste' it in banner.php in place of the old function. Be sure to include the entire function through it's final end bracket ("}") or you will introduce more errors, one in each file.

 

In the following error,

 

Fatal error: Cannot redeclare tep_get_products_description() (previously declared in /home/effortle/public_html/catalog/admin/includes/functions/general.php:518) in /home/effortle/public_html/catalog/admin/includes/functions/general.php on line 525

the message is telling you that "function tep_get_products_description()" is in the admin general.php file twice, once on line 518 and again on line 525.

 

In this instance, I suspect you copied the change from the install instructions and inserted the copied code under the existing function instead of replacing the existing function with the copied code. Just remove one of the two identical functions.

 

And finally, when you receive "syntax error, unexpected T_STRING", (or unexpected "}", ";", etc.), it usually means you have one too many of the unexpected character, OR you've left off a character that is required. In the case of "unexpected T_STRING", you usually are missing something immediately before the string, like a "." (dot) which tells php to add the two together. For example:

 

$some_string_result = $some_string_variable . SOME_STRING_CONSTANT 'some string hard coded text';

The above code would produce the unexpected T_STRING error. It should be written like this instead:

$some_string_result = $some_string_variable . SOME_STRING_CONSTANT . 'some string hard coded text';

It is important to remember that osc error messages are informative, and will tell you what to look for and where. In the case of "unexpected", the line number will not necessarily be the line with the missing/extra item, but you can start on that line and work your way towards the top of the file. The more you work with the error messages, the easier it gets to decipher them, and to find the error. As you can see, I've had a LOT of practice. :)

 

Good luck, and let us know how it goes.

-Skittles

 

 

Thank you so much for getting back. I've managed to correct a whole load of problems now.

 

I've hit one I'm not sure what to do about and I'm beginning to wonder if I should uninstall osCommerce and start again from scratch as I think I must have done something bad to get all of these problems.

 

My current error message is:

 

Template file does not exist: [includes/sts_templates/yummymummy/boxes/infobox_header.php.html]
Fatal error: Call to undefined function: tep_has_category_subcategories() in /home/effortle/public_html/catalog/includes/boxes/categories.php on line 41

 

I think this is telling me that a file does not exist - not quite sure where that went!

 

The Fatal effor is telling me I need to define a function I think in categories.php, but I'm not sure how to do that.

 

Sorry, I'm not normally this bad

 

:blush:

Link to comment
Share on other sites

Thank you so much for getting back. I've managed to correct a whole load of problems now.

 

I've hit one I'm not sure what to do about and I'm beginning to wonder if I should uninstall osCommerce and start again from scratch as I think I must have done something bad to get all of these problems.

 

My current error message is:

 

Template file does not exist: [includes/sts_templates/yummymummy/boxes/infobox_header.php.html]
Fatal error: Call to undefined function: tep_has_category_subcategories() in /home/effortle/public_html/catalog/includes/boxes/categories.php on line 41

 

I think this is telling me that a file does not exist - not quite sure where that went!

 

The Fatal effor is telling me I need to define a function I think in categories.php, but I'm not sure how to do that.

 

Sorry, I'm not normally this bad

 

:blush:

PJ2006,

 

It does seem like there is something seriously wrong. Perhaps starting from scratch is the best solution. And may even be less time consuming.

 

Is your site live? I hope it's only in development. What a hassle if your live shop is broken.

 

-Skittles

Link to comment
Share on other sites

PJ2006,

 

It does seem like there is something seriously wrong. Perhaps starting from scratch is the best solution. And may even be less time consuming.

 

Is your site live? I hope it's only in development. What a hassle if your live shop is broken.

 

-Skittles

 

Hi,

 

No don't worry, just in development.

 

I will start again but to confirm before I do. I want to use STS, I think it's best to install that then the Optional Related Products - should this work OK or is that why I'm having problems?

 

Thanks

Link to comment
Share on other sites

Hi,

 

No don't worry, just in development.

 

I will start again but to confirm before I do. I want to use STS, I think it's best to install that then the Optional Related Products - should this work OK or is that why I'm having problems?

 

Thanks

My guess is the problems stem from trying to make my changes to the STS files. They are different, and if the code ends up in the wrong place it will create problems. There may be other issues, too, I just don't know. As I said before, I have no experience with STS...

 

I'm swamped with work this week, maybe next week as well. But, if you aren't in too big of a hurry, I'm willing to set up an STS development site on my XAMPP server and see if I can adapt this for you. I'm sure there are other folks out there who would like this contribution to be STS compatible, too.

 

-Skittles

Link to comment
Share on other sites

My guess is the problems stem from trying to make my changes to the STS files. They are different, and if the code ends up in the wrong place it will create problems. There may be other issues, too, I just don't know. As I said before, I have no experience with STS...

 

I'm swamped with work this week, maybe next week as well. But, if you aren't in too big of a hurry, I'm willing to set up an STS development site on my XAMPP server and see if I can adapt this for you. I'm sure there are other folks out there who would like this contribution to be STS compatible, too.

 

-Skittles

 

 

Skittles,

 

That really would be great if you wouldn't mind. Thank you so much.

Link to comment
Share on other sites

Skittles,

 

That really would be great if you wouldn't mind. Thank you so much.

PJ2006,

 

I'll post here when I've completed it, but I'll PM you as well. Count on at least three, maybe four weeks from now before you hear from me on this, depending on an assortment of factors...

 

-Skittles

Link to comment
Share on other sites

Anita (Skittles),

 

I would very much like to know how it is coming with the Optional Related Products and STS integration. I am using STS and have just installed the optional related products contribution. The only problem is that because of how the templates are set up in STS the information posted on the product information pages does not come from the "catalog/product_info.php" page. While I am a pretty good designer, and am pretty good at reading and manipulating code to do what I want I am having a problem on exactly what needs to be done in order to have it work using STS. Any information you could offer on this would be great, because it would be a great benefit to use this contrib for my store. Thank you for any help you offer.

 

- Ryan

 

P.S. - Just out of curiosity, have you thought of making this an infobox?

Edited by runo1377
Link to comment
Share on other sites

Anita (Skittles),

 

I would very much like to know how it is coming with the Optional Related Products and STS integration. I am using STS and have just installed the optional related products contribution. The only problem is that because of how the templates are set up in STS the information posted on the product information pages does not come from the "catalog/product_info.php" page. While I am a pretty good designer, and am pretty good at reading and manipulating code to do what I want I am having a problem on exactly what needs to be done in order to have it work using STS. Any information you could offer on this would be great, because it would be a great benefit to use this contrib for my store. Thank you for any help you offer.

 

- Ryan

 

P.S. - Just out of curiosity, have you thought of making this an infobox?

Hi Ryan.

 

It will easily be another couple of weeks before I can get to this. I apologize that it will take so long, but I have commitments to clients I have to meet before I can get started.

 

I'll be happy to PM you when it's done.

 

And, yes. I have put this in an infobox. Well, sort of. I used CSS instead of the boxes class. It is set up to display up to 3 related products randomly. If there aren't any related products, it displays new products instead.

 

You can see it work on my client's site: Expertees.com. (She sells t-shirts.)

 

-Skittles

(aka Anita)

Link to comment
Share on other sites

well, thanks for the reply back. However, I kinda figured it out, and was able to get it working. But... like most things... another problem has arose now. Prior to installing the contrib I was using "Forced Cookie Use" in order to make the sites URL more SEO friendly, but now sessions arn't keeping, which won't allow me to add anything to the cart (which obviously for an ecommerce site is a big problem... lol). The only way I can get anything to work is if I turn off "Force Cookie Use", which in turn gives me a long complicated url. If I have to do it that way, its fine, but I'd prefer not. Any help would be great, but I completely understand client priority. Look forward to hearing from you.

 

- Ryan

Link to comment
Share on other sites

Hi,

I am so happy to find this great contribution and I had tried to install it three times now. I did everything the instructions said to do and when I try to log into my Admin, it goes blank? I am new to OSC and I've only installed the MZMT Geo shipping module and it is working well.

 

Does anyone know why the admin panel would go blank after installing the Optional Related Products? I've checked all the code and I am not sure maybe I missed something. Also, could it be because I am running OSC on php 5.0.4?

 

Any help would be greatly appreciated! Thank you everyone!

Link to comment
Share on other sites

Hi,

I am so happy to find this great contribution and I had tried to install it three times now. I did everything the instructions said to do and when I try to log into my Admin, it goes blank? I am new to OSC and I've only installed the MZMT Geo shipping module and it is working well.

 

Does anyone know why the admin panel would go blank after installing the Optional Related Products? I've checked all the code and I am not sure maybe I missed something. Also, could it be because I am running OSC on php 5.0.4?

 

Any help would be greatly appreciated! Thank you everyone!

Hi joaopk,

 

Which screen of the Admin is blank? The first page? Or just the Related Products page? By blank, do you mean the entire browser window is blank? Or does the header, left navigation and/or footer show?

 

-Skittles

Link to comment
Share on other sites

Skittles,

 

Any thoughts on my issue of "Force Cookie Use" not keeping or storing the sessions?

 

I would really like to use that function so that I can get rid of the session ID in the url. Any help would be greatly appreciated.

Link to comment
Share on other sites

Hi joaopk,

 

Which screen of the Admin is blank? The first page? Or just the Related Products page? By blank, do you mean the entire browser window is blank? Or does the header, left navigation and/or footer show?

 

-Skittles

 

Hi Skittles,

Thank you for your reply. It is the main first page.

After changing all the code and installing all the files, I go to log into my admin: for example,

http://www.website.com/admin

When I do, it prompts me for the user and password as always but once I enter that info, the screen just goes blank, no control panel menu.

When I looked at "view page source" just to see if there is any code, there is not a single code.

 

Thank you again for your help.

JP

Link to comment
Share on other sites

Skittles,

 

Any thoughts on my issue of "Force Cookie Use" not keeping or storing the sessions?

 

I would really like to use that function so that I can get rid of the session ID in the url. Any help would be greatly appreciated.

Ryan,

 

Honestly, I have no idea why the ability to set a cookie would be impacted by integrating this contribution.

 

Hopefully, I'll be able to develop a variation of this contribution that will work with STS and not interfere with cookies.

 

In the meantime, if you determine the source of the issue, please let me know what it is.

 

-Skittles

Link to comment
Share on other sites

Skittles,

 

Thanks for the reply, and you will be happy to know that my issue with the cookies had nothing to do with your contrib. It appears that the issue was with SSL. I couldnt figure out what was causing the problem, and just somehow thought about turning off SSL in my "includes/configure.php" file. Which caused force cookie use to work.

 

It seemed that when I gave ... define('HTTPS_COOKIE_DOMAIN', ''); ... a value it would not store cookies. So I still have SSL enabled and work, and as long as I don't enter any settings in that define area the force cookies works perfectly. This isn't an important thing to have defined is it?

 

Lol, what a pain and frustration this was. But I'm glad it's resolved.

 

- Ryan

 

F.Y.I. - With this done I do have your contrib installed and working on a OSCOM system running STS and a # of other contribs. Let me know if you need any help or anything like that.

Edited by runo1377
Link to comment
Share on other sites

Hi Skittles,

Thank you for your reply. It is the main first page.

After changing all the code and installing all the files, I go to log into my admin: for example,

http://www.website.com/admin

When I do, it prompts me for the user and password as always but once I enter that info, the screen just goes blank, no control panel menu.

When I looked at "view page source" just to see if there is any code, there is not a single code.

 

Thank you again for your help.

JP

Link to comment
Share on other sites

Hi Skittles,

Thank you for your reply. It is the main first page.

After changing all the code and installing all the files, I go to log into my admin: for example,

http://www.website.com/admin

When I do, it prompts me for the user and password as always but once I enter that info, the screen just goes blank, no control panel menu.

When I looked at "view page source" just to see if there is any code, there is not a single code.

 

Thank you again for your help.

JP

 

Hi Skittle,

 

Sorry. I figured it out. I had mistakenly erased one code snipet. Now it works great.

Thanks,

JP

Link to comment
Share on other sites

Hi Skittle,

 

Sorry. I figured it out. I had mistakenly erased one code snipet. Now it works great.

Thanks,

JP

JP,

 

I'm glad to hear you figured out what was causing your problem. Once you verified it was the main Admin page, it didn't sound like anything that would/should be related to changes for this contribution.

 

And it would have been difficult, and time-consuming, to troubleshoot remotely.

 

In my experience, mistakes like this one will help you learn more about how the code works, and take you one step closer to being an osCommerce code guru. In a few months, you'll be here in the forums answering questions for the "next generation" of newbies. :)

 

-Skittles

Link to comment
Share on other sites

Skittles,

 

Thanks for the reply, and you will be happy to know that my issue with the cookies had nothing to do with your contrib. It appears that the issue was with SSL. I couldnt figure out what was causing the problem, and just somehow thought about turning off SSL in my "includes/configure.php" file. Which caused force cookie use to work.

 

It seemed that when I gave ... define('HTTPS_COOKIE_DOMAIN', ''); ... a value it would not store cookies. So I still have SSL enabled and work, and as long as I don't enter any settings in that define area the force cookies works perfectly. This isn't an important thing to have defined is it?

 

Lol, what a pain and frustration this was. But I'm glad it's resolved.

 

- Ryan

 

F.Y.I. - With this done I do have your contrib installed and working on a OSCOM system running STS and a # of other contribs. Let me know if you need any help or anything like that.

Ryan,

 

I'm glad you figured out what the problem was, and that you shared the answer with all of us.

 

I'm also glad to hear this contribution works with STS. I'll be sure and use you as a resource when I put together the STS install package. (It sounds like that may simply be a separate installation guide.)

 

As always, thanks for the feedback.

-Skittles

Link to comment
Share on other sites

Hi, I installed Optional Related Products v.4.0 and everything works fine except one feature. If you go to http://shop.fullservis.sk, you can find optional related products down bellow the main product. After I refresh the page, they always change their order. In Admin menu has function "Use Random Display Order" value "False", but it is still randomizing order of shown related products. Can you advise me how to fix it? Our customers can get confused if they see on the same place everytime different related products. Thanx.

Link to comment
Share on other sites

Hi, I installed Optional Related Products v.4.0 and everything works fine except one feature. If you go to http://shop.fullservis.sk, you can find optional related products down bellow the main product. After I refresh the page, they always change their order. In Admin menu has function "Use Random Display Order" value "False", but it is still randomizing order of shown related products. Can you advise me how to fix it? Our customers can get confused if they see on the same place everytime different related products. Thanx.

Radiar,

 

Open the module file ([catalog/]includes/modules/optional_related_products.php) and modify line 20.

 

Change this:

 

  $orderBy .= (RELATED_PRODUCTS_RANDOMIZE)?'rand()':'pop_order_id, pop_id';

to this:

 

  $orderBy .= (RELATED_PRODUCTS_RANDOMIZE == 'True')?'rand()':'pop_order_id, pop_id';

 

That should take care of it.

 

-Skittles

Link to comment
Share on other sites

Radiar,

 

Open the module file ([catalog/]includes/modules/optional_related_products.php) and modify line 20.

 

Change this:

 

  $orderBy .= (RELATED_PRODUCTS_RANDOMIZE)?'rand()':'pop_order_id, pop_id';

to this:

 

  $orderBy .= (RELATED_PRODUCTS_RANDOMIZE == 'True')?'rand()':'pop_order_id, pop_id';

 

That should take care of it.

 

-Skittles

 

 

Thanx, it helped. I owe you the beer :thumbsup:

Link to comment
Share on other sites

Skittles,

 

I don't know that it would have to be a completely separate install package. Because (if I remember correctly) its merely adding a little bit of code in a different file. But not a big deal. The contrib works beautifully though. I'm still working on the site, and only have test products up right now, but you can still take a look at your work in action if you like. I used it in a kind of circuit city feel. Where if yo go to www.circuitcity.com you will see that they have a right column that looks more like a tab that sticks out. A nice little effect that adds to ambiance of the whole site. Anyways, you can see for yourself if you like... again, nothing is live and development is still in process.

 

www.connectionkits.com

 

- Ryan

Link to comment
Share on other sites

hi Skittles ! compliments for this great contrie

this is one of the best development contries i have seen here

 

i have just one small question to optimize the views

don´t know where can i fix the link and the space near the price

 

here as

 

my normal product listing view

 

right.jpg

 

 

 

and that´s yours related products listing view

 

wrong.jpg

 

 

so i´d like to delete the link at price

and create the space behind the price

 

 

thank you :thumbsup:

Link to comment
Share on other sites

Hi there, I was wondering if you can help me out... I have installed this (and find it great by the way) but now in the admin panel I have x4 "Related Products" in the configuration menu... only the last one works and the others give an empty table!, how can I remove the first three please? is this held in the SQL database (GULP!)

 

many thanks in advance for any help

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