Jump to content
Skittles

Optional Related Products, Version 4.0

Recommended Posts

But, but, but... of course... everything was working before :D This site is so new that it still has the default OSC layout, and even the default home page with the default message. I haven't even changed that part yet :)

 

Would it have something to do with the version of OSC to do? Like the version I have running is Ver 2.2-MS2, and the server version of PHP is 4.4.4 - would that do anything to the coding part of the of the compatibility? Just a thought...

daniaw,

 

Version 4 was developed using osCommerce 2.2 Milestone 2 Update 051113. Are you using Update 060817?

 

In any event, I still believe you need to back up to the previously working state, then systematically make installation changes, testing in between, until you locate what changes are causing the error. Even if there is an incompatibility with your version of osc, we need to determine where it exists in order to fix it.

 

-Skittles

Share this post


Link to post
Share on other sites

I have just tried this contribution - it is really something.

I have some problems thou - I wonder If there are more like me.

 

I do not want to reinvent the wheel here so before I get into inspecting code, I wonder if solution is not out there.

---------

DESCRIPTION:

Fault is in MSIE (tested: 6.0 and 7.0), opera 8 and Netscape (when in MSIE mode).

MSIE loads page but You can't add any additional relationships. Firefox works fine. Opera says nothing, but refuses to work etc.

 

PROBLEM MESSAGES RECEIVED:

1. documents.forms.0.formview - is null or not an object

2. unterminated string constant (a few times)

3. object expected

 

 

Anybody has come across this?

 

Regards,

 

jeffz

Share this post


Link to post
Share on other sites
I have just tried this contribution - it is really something.

I have some problems thou - I wonder If there are more like me.

 

I do not want to reinvent the wheel here so before I get into inspecting code, I wonder if solution is not out there.

---------

DESCRIPTION:

Fault is in MSIE (tested: 6.0 and 7.0), opera 8 and Netscape (when in MSIE mode).

MSIE loads page but You can't add any additional relationships. Firefox works fine. Opera says nothing, but refuses to work etc.

 

PROBLEM MESSAGES RECEIVED:

1. documents.forms.0.formview - is null or not an object

2. unterminated string constant (a few times)

3. object expected

Anybody has come across this?

 

Regards,

 

jeffz

jeffz,

 

This contribution was developed using Firefox. Then tested using Internet Explorer (Version: 6.0.2900.2180.xpsp_sp2_gdr.061219-0316, on my machine). I do not have Opera, so I didn't test it with Opera.

 

Several of my beta testers tested this with IE, including version 7. There were some issues, which were fixed prior to release. I don't know if any of them tested it in Opera or Netscape (MSIE Mode).

 

My first thought on this is there may be a problem with your installation.

 

Is it safe to assume the "Problem Messages Received" (above) are from the Admin area?

 

Were you able to run the SQL Utility?

 

Have you tested the product _info page? (If things are set up correctly, it shouldn't make any difference to the displayed page until there are related products for the product being viewed.)

 

What other contributions, if any, do you have installed? (Perhaps there is a conflict?)

 

I'll try to help you figure this out and get it running correctly on you site.

 

-Skittles

Share this post


Link to post
Share on other sites

Hello Skittles - regards from London

 

How is ole'good Uncle Sam doing these days? I really enjoyed time I spent there. :rolleyes:

 

My first thought on this is there may be a problem with your installation.

My osCo installation seems to be fine (but I wouldn't stake my "tender parts" on it). Shows no problems besides this one. Which is not actually a major one.

 

Is it safe to assume the "Problem Messages Received" (above) are from the Admin area?

This is actually the only place where problem surfaces.

 

Were you able to run the SQL Utility?

SQL seems to be fine. I tested it. BTW: which utility you have in mind?

 

Have you tested the product _info page?

Product_info.php is fine'n'dandy. That's why I love your contribution - it is so scalable. The only problem is with dbase writing. I assume it is the base issue. But I must admit - I didn't do any code inspection or thorough testing to narrow down the problem. I intend to do it as soon I get some free time.

 

What other contributions, if any, do you have installed? (Perhaps there is a conflict?)

That came to me also. I've got a few contributions:

1. CCGV-trad,

2. totally rewritten by myself 1.8 step-by-step manual order entry

3. PayPal (I do not use it thou) ... and a few more ...

plus some more stuff by "yours truly" - I have to post it one day - some people may find some of it handy - especially if they deal with osCo as primary sales and stock management system ( both on- and offline) in a multi-branch environment. Just question of wrapping it for people who do not necessarily think that coding could actually become a way of life ;)

 

However I do not think there is a case of conflict.

Why?

Problem is with relating products in Admin section. Once products are related - all is displayed as it should.

 

I'll try to help you figure this out and get it running correctly on you site.

Thank you Skittles, I willl look into it as well and let you (and everybody else) know when I get these wheels on the road.

 

Regards,

 

Jeff

Share this post


Link to post
Share on other sites
Hello Skittles - regards from London

 

How is ole'good Uncle Sam doing these days? I really enjoyed time I spent there. :rolleyes:

 

My first thought on this is there may be a problem with your installation.

My osCo installation seems to be fine (but I wouldn't stake my "tender parts" on it). Shows no problems besides this one. Which is not actually a major one.

 

Is it safe to assume the "Problem Messages Received" (above) are from the Admin area?

This is actually the only place where problem surfaces.

 

Were you able to run the SQL Utility?

SQL seems to be fine. I tested it. BTW: which utility you have in mind?

 

Have you tested the product _info page?

Product_info.php is fine'n'dandy. That's why I love your contribution - it is so scalable. The only problem is with dbase writing. I assume it is the base issue. But I must admit - I didn't do any code inspection or thorough testing to narrow down the problem. I intend to do it as soon I get some free time.

 

What other contributions, if any, do you have installed? (Perhaps there is a conflict?)

That came to me also. I've got a few contributions:

1. CCGV-trad,

2. totally rewritten by myself 1.8 step-by-step manual order entry

3. PayPal (I do not use it thou) ... and a few more ...

plus some more stuff by "yours truly" - I have to post it one day - some people may find some of it handy - especially if they deal with osCo as primary sales and stock management system ( both on- and offline) in a multi-branch environment. Just question of wrapping it for people who do not necessarily think that coding could actually become a way of life ;)

 

However I do not think there is a case of conflict.

Why?

Problem is with relating products in Admin section. Once products are related - all is displayed as it should.

 

I'll try to help you figure this out and get it running correctly on you site.

Thank you Skittles, I willl look into it as well and let you (and everybody else) know when I get these wheels on the road.

 

Regards,

 

Jeff

Jeff,

 

My first thought on this is there may be a problem with your installation.

My osCo installation seems to be fine (but I wouldn't stake my "tender parts" on it). Shows no problems besides this one. Which is not actually a major one.

I was referring to the installation of this contribution. Sorry I didn't make that clear.

 

Were you able to run the SQL Utility?

SQL seems to be fine. I tested it. BTW: which utility you have in mind?

This would be the SQL Utility packaged with the contribution. After making all the changes to the existing files and uploading new files, you go to Admin Catalog->Related Products and the Utility should automatically open. This is how you modify the database with the new table and Admin Configuration->Related Products options.

 

The conflict I would be looking for is anyplace where this code and the code for another modification overlap.

 

To help you find the problem, I'll need input from you. Perhaps you could email me the modified files and I could look through the code for the possible culprit(s)? I don't believe in putting email addresses in posts, so if you'd like me to look over your code, send me your email address in a PM

 

-Skittles

 

P.S. It's getting ready to rain this afternoon, after a beautiful sunny morning. Rather typical weather for this part of Oregon. As far as I know, Uncle Sam is doing fine, just don't ask me about the politics... :)

Share this post


Link to post
Share on other sites
Becki,

 

I checked, and that is the only one that didn't have the " == 'True' " specified...

 

Now, to add 'customers also bought' box to appear only if there are no related products, open the module file ([catalog/]includes/modules/optional_related_products.php) and go to the end of the file.

 

Replace the final:

 

<?php
}
?>

with:

 

<?php
} else { /* option: call another module instead */
?>
  <tr>
	<td>
<?php
if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
 }
?>
	</td>
  </tr>
<?php
}
?>

 

Now go into product_info.php and remove this code from the file:

 

	  <tr>
	<td>
<?php
if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
 }
?>
	</td>
  </tr>

Otherwise, you could end up with the 'also purchased' displayed twice!

 

-Anita

 

Hi Skittles,

 

Hope you're well,

I have only just had time to implement the changes you've mentioned above but when I do on the product info page I get a blank screen. If I only make the above change to 'includes/modules/optional_related_products.php' then all i get is the product description with the back and continue etc buttons? Any ideas?

 

Also I've been meaning to ask you where can i make a change to make the drop down field boxes accept more characters (make them longer) as the site has lots of products that start with the same few words then the last couple are different and at the moment all I can see in the drop down boxes is 20products all with the same name!

 

Many Thanks

 

Becki

Share this post


Link to post
Share on other sites

YES!!!!

 

This contribution is amazing!!!!!!!!! thank you so much.

 

I have been looking for a way to link specific products, this makes it so much easier for my customers to find the correct parts to go together.

 

Install took about 4 hours with troubleshooting ( I have a ton of contributions already installed) but It's up and running in one sitting.

 

thank you, thank you, thank you.

Share this post


Link to post
Share on other sites

YES!!!!

 

This contribution is amazing!!!!!!!!! thank you so much.

 

I have been looking for a way to link specific products, this makes it so much easier for my customers to find the correct parts to go together.

 

Install took about 4 hours with troubleshooting ( I have a ton of contributions already installed) but It's up and running in one sitting.

 

thank you, thank you, thank you.

Share this post


Link to post
Share on other sites
Hi Skittles,

 

Hope you're well,

I have only just had time to implement the changes you've mentioned above but when I do on the product info page I get a blank screen. If I only make the above change to 'includes/modules/optional_related_products.php' then all i get is the product description with the back and continue etc buttons? Any ideas?

 

Also I've been meaning to ask you where can i make a change to make the drop down field boxes accept more characters (make them longer) as the site has lots of products that start with the same few words then the last couple are different and at the moment all I can see in the drop down boxes is 20products all with the same name!

 

Many Thanks

 

Becki

Becki,

 

When you get the chance, respond to the PM I sent you, and we'll work together on the "customer also bought" box mod until we get it working for you.

 

In the meantime, you can specify the length displayed in the drop-down list via the configuration options. In the Admin, go to Configuration->Related Products and find the option "Admin Display: Drop-Down List Maximum Length". This is set to 25 by default, but you can change it to whatever works best for you. A value of "0" will allow the full product name to be shown.

 

Another way to handle this, if you use model numbers for your products, is to enable the "Admin Display: Use Product Model" option. When this option is set to "true", the product model is listed before the product name. (You can even use the Product Model instead of the Product Name, if that works better for you.)

 

Talk to you soon,

-Skittles

Share this post


Link to post
Share on other sites
YES!!!!

 

This contribution is amazing!!!!!!!!! thank you so much.

 

I have been looking for a way to link specific products, this makes it so much easier for my customers to find the correct parts to go together.

 

Install took about 4 hours with troubleshooting ( I have a ton of contributions already installed) but It's up and running in one sitting.

 

thank you, thank you, thank you.

mmph,

 

Don't hold back, man, tell us what you really think! :D

 

Seriously, I'm glad you like it.

 

And your testimony should be encouraging to other shop owners with heavily modified sites.

 

The ability to change osCommerce to fit your specific needs is both a blessing and a curse. With each contribution you install, the functionality of your site increases, but so does the complexity of the installation. It takes a lot of patience to work out the changes when two or three mods are all changing the same snippet of code! Which explains all the cursing...

 

So what is it you sell with so many "parts"? And would you consider posting a link to your site so the rest of us can see?

 

-Skittles

Share this post


Link to post
Share on other sites

When I set the "Random Display Order" to false the products are still shown ramdomize.

How can I fix this?

 

Chris

Share this post


Link to post
Share on other sites
When I set the "Random Display Order" to false the products are still shown ramdomize.

How can I fix this?

 

Chris

Chris,

 

Becki ran into this problem, too. We discovered a small snafu in my code that got past the beta testers.

 

In [catalog/]includes/modules/optional_related_products.php, find the following line:

 

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

Change it to this:

 

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

 

I hope you'll find this contribution helpful.

-Skittles

Share this post


Link to post
Share on other sites
Chris,

 

Becki ran into this problem, too. We discovered a small snafu in my code that got past the beta testers.

 

In [catalog/]includes/modules/optional_related_products.php, find the following line:

 

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

Change it to this:

 

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

 

I hope you'll find this contribution helpful.

-Skittles

Skittles,

My file has these two lines:

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

$orderBy .= (RELATED_PRODUCTS_MAX_DISP)?' limit ' . RELATED_PRODUCTS_MAX_DISP:'';

Should both of them be changed?

Share this post


Link to post
Share on other sites
Skittles,

My file has these two lines:

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

$orderBy .= (RELATED_PRODUCTS_MAX_DISP)?' limit ' . RELATED_PRODUCTS_MAX_DISP:'';

Should both of them be changed?

Hi Dave.

 

Only the first of the two lines above needs to be changed. RELATED_PRODUCTS_MAX_DISP is a numeric value. If you set it to 0 (in the Admin), the code considers it false and will not add a limit -- all related products will be displayed. Otherwise, the display is limited to the value you set in the Admin.

 

RELATED_PRODUCTS_RANDOMIZE is set to 'True' or 'False'. The words are capitalized, so php is seeing them as strings instead of the boolean true or boolean false. Because php interprets the value as a string, RELATED_PRODUCTS_RANDOMIZE tests as true regardless of the content.

 

Once I discovered this little bug, I checked the entire contribution for any other possible instances of strings instead of boolean not specifying the comparison string, and there are none. All of the other comparisons either use numeric values, like RELATED_PRODUCTS_RANDOMIZE above, or the strings 'True' or 'False' have been used.

 

Good to hear from you again. I hope business is booming, with nice weather on the way...

-Skittles

Share this post


Link to post
Share on other sites
Becki,

 

When you get the chance, respond to the PM I sent you, and we'll work together on the "customer also bought" box mod until we get it working for you.

 

In the meantime, you can specify the length displayed in the drop-down list via the configuration options. In the Admin, go to Configuration->Related Products and find the option "Admin Display: Drop-Down List Maximum Length". This is set to 25 by default, but you can change it to whatever works best for you. A value of "0" will allow the full product name to be shown.

 

Another way to handle this, if you use model numbers for your products, is to enable the "Admin Display: Use Product Model" option. When this option is set to "true", the product model is listed before the product name. (You can even use the Product Model instead of the Product Name, if that works better for you.)

 

Talk to you soon,

-Skittles

 

Thanks Skittles,

 

I should have noticed that in the configurations but I obviously didn't think it would be in there!

 

Thanks for your help - I'll PM you now.

 

Thanks

Becki

Share this post


Link to post
Share on other sites
Chris,

 

Becki ran into this problem, too. We discovered a small snafu in my code that got past the beta testers.

 

In [catalog/]includes/modules/optional_related_products.php, find the following line:

 

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

Change it to this:

 

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

 

I hope you'll find this contribution helpful.

-Skittles

 

Thank you for the solution and quick response.

The contribution is very helpful.

 

Chris

Share this post


Link to post
Share on other sites
mmph,

 

Don't hold back, man, tell us what you really think! :D

 

Seriously, I'm glad you like it.

 

And your testimony should be encouraging to other shop owners with heavily modified sites.

 

The ability to change osCommerce to fit your specific needs is both a blessing and a curse. With each contribution you install, the functionality of your site increases, but so does the complexity of the installation. It takes a lot of patience to work out the changes when two or three mods are all changing the same snippet of code! Which explains all the cursing...

 

So what is it you sell with so many "parts"? And would you consider posting a link to your site so the rest of us can see?

 

-Skittles

 

I must have about 20 contributions installed so I have to be very cautious when installing a new one. So far I don't see a single glitch from your Optional related products. I get many inquiries from my customers who are confused about which items go together because I offer a lot of similar products with small variations which are not necessarily compatible.

 

I did get a bit confused following the instructions during the section of code, not that they are incorrect or incomplete but when it gets to the code changes, the txt didn't seem to transition between files very smooth and a bit inconsistent. I got confused when a single line was to be added but the instructions showed an original block replaced with a new block rather than just saying "find xxxxxxxx and insert yyyyyyy just before". Particularly because I have so many contributions that it gets down to the line of what I can change without effecting others and I did have to make a tiny adjustment here and there to accommodate my others. Don't get me wrong, the work is complete, correct and much appreciated.

 

I've been needing this very capability to help my customers identify the correct accessories for the primary product they are purchasing. I sell electronics in two variations, guitar / guitar effects and I also sell Flashlights/batteries/chargers.

 

For example I offer four variations of a rechargeable CR123 battery (a lithium 3v battery about 1/2 the length and a bit wider than a AA, commonly used in cameras and flashlights). Of these four, only two can be charged with the same charger, and I have 3 different versions of that charger; to make it worse, each custom flashlight requires a different one of these battery/charger combo's depending on which one of the 15+ bulb options is chosen........

 

I sell both kits and individual pieces so when a customer is trying to figure out which charger is safe to use with which battery I can now show them with this contribution without having to write it into the product description.

 

I also offer "parts" for guitar effects pedals, when someone is looking at the actual pedal they can now see the exact parts that are available for it.

 

Another example: I sell high end flashlights which are customizable, this contribution allows me to show the bulbs that work with each flashlight rather than a customer having to read the product description of each of my 20+ bulb models and go directly to the ones that work for the model they are interested in.

 

My website, (many thanks to OSC and all it's contributors) is www.e-lectronics.net

 

An example of this contribution in work on my site can be seen on this LED flashlight page, keep in mind that I have over 5 models of batteries which would actually fit in the flashlight but would not perform correctly. You can see from the "items also purchased" that only the correct "recommended" battery and charger show in the "item also purchased"

 

The admin panel is well done and comprehensive as well, thank you.

 

-Markcm

Share this post


Link to post
Share on other sites
Hi Anita,

 

Good job, for days I've been searching for a contribution like ORP and everything that I found I didn't have courage to put in my website. I went through the installation with just a few mistakes from my part. Everything looks good until I install the new SQL table, then the page of my products becomes a big mess and I cannot see the suggested products. My website is modified and I can display three different images for my products. I'll try to include here two screenshots that I made (sorry if they don't show up, this is my first time doing this), the regular page and then the page after I applied the SQL table. If you have any clues to give me I really appreciate.

Thank you very much

Margaret

 

shot1.JPG

shot2.JPG

 

 

Hi,

 

Sorry if you find multiple posts of this. I'm trying to post to the right forum, but my posts never seem to be added on.

 

I'm trying to install this add on, , Optional Related Products but am having problems. I have printed the installation instructions out and I'm trying to follow them but they say to find the following text:

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');

 

The nearest I can find is:

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');

 

 

But it's different.

 

I have STS v4 installed, is that the problem are the two not compatible?

 

I'm new to all of this so sorry if that was a stupid question

 

Thanks

Share this post


Link to post
Share on other sites
Hi,

 

Sorry if you find multiple posts of this. I'm trying to post to the right forum, but my posts never seem to be added on.

 

I'm trying to install this add on, , Optional Related Products but am having problems. I have printed the installation instructions out and I'm trying to follow them but they say to find the following text:

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');

 

The nearest I can find is:

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');

But it's different.

 

I have STS v4 installed, is that the problem are the two not compatible?

 

I'm new to all of this so sorry if that was a stupid question

 

Thanks

PJ2006,

 

Close examination of the code you presented shows it is NOT the code you are looking for. The code you mention above is for the Category, not the Product.

 

It may help to know what original code does, and what the changes will do.

 

When you select a category or product in the admin->catalog area, the right hand column displays image buttons for several maintenance functions. For the Category, those buttons are: edit, delete, and move. For the Product, those buttons are: edit, delete, move, and copy to.

 

The code change for this contribution adds an image button labeled Related Products. It needs to go with the Product, not the Category. Once installed, clicking on this button takes you to the Related Products admin page, but it only displays the records for the one product.

 

Open your admin, go to Catalog->Categories/Products and select a product. Look at the buttons to the right. Is there a 'copy to' button? If so, the file should be named button_copy_to.gif

 

Use your editor's search function to just look for "button_copy_to.gif" (without the quotes). This should put you in the right area.

 

Once you find the code you need to be working with, if it still isn't clear, let me know. I'll see what I can do to help.

 

And, in my opinion, the only stupid question is the one you don't ask.

 

-Skittles

 

(For anyone listening in, the changes we're referring to are in [catalog/]admin/categories.php.)

Share this post


Link to post
Share on other sites
PJ2006,

 

Close examination of the code you presented shows it is NOT the code you are looking for. The code you mention above is for the Category, not the Product.

 

It may help to know what original code does, and what the changes will do.

 

When you select a category or product in the admin->catalog area, the right hand column displays image buttons for several maintenance functions. For the Category, those buttons are: edit, delete, and move. For the Product, those buttons are: edit, delete, move, and copy to.

 

The code change for this contribution adds an image button labeled Related Products. It needs to go with the Product, not the Category. Once installed, clicking on this button takes you to the Related Products admin page, but it only displays the records for the one product.

 

Open your admin, go to Catalog->Categories/Products and select a product. Look at the buttons to the right. Is there a 'copy to' button? If so, the file should be named button_copy_to.gif

 

Use your editor's search function to just look for "button_copy_to.gif" (without the quotes). This should put you in the right area.

 

Once you find the code you need to be working with, if it still isn't clear, let me know. I'll see what I can do to help.

 

And, in my opinion, the only stupid question is the one you don't ask.

 

-Skittles

 

(For anyone listening in, the changes we're referring to are in [catalog/]admin/categories.php.)

Skittles,

 

Thanks so much for replying, that really helped.

 

I was steaming along until I got to 6c) I dn't have a product_info.php in my [catalog/]includes/languages/english/ folder, I only have products_attributes and products_expected.

 

Can you help with that?

 

Thanks

 

Lotti

Share this post


Link to post
Share on other sites
Skittles,

 

Thanks so much for replying, that really helped.

 

I was steaming along until I got to 6c) I dn't have a product_info.php in my [catalog/]includes/languages/english/ folder, I only have products_attributes and products_expected.

 

Can you help with that?

 

Thanks

 

Lotti

 

Sorry I realized my mistake and sorted this one, really was me being stupid.

 

I have now done all the changes but get the following error when I view my shop:

 

Parse error: syntax error, unexpected T_STRING in /home/effortl/public_html/catalog/includes/applicatoin_top.php on line 318

 

I guess I've removed something I shouldn't have do you know what?

 

Thanks

 

Lotti

Share this post


Link to post
Share on other sites
Sorry I realized my mistake and sorted this one, really was me being stupid.

 

I have now done all the changes but get the following error when I view my shop:

 

Parse error: syntax error, unexpected T_STRING in /home/effortl/public_html/catalog/includes/applicatoin_top.php on line 318

 

I guess I've removed something I shouldn't have do you know what?

 

Thanks

 

Lotti

 

I sorted that one.

 

but now get:

 

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

 

select startdate, counter from TABLE_COUNTER

 

[TEP STOP]

 

I'm afraid I don't even know where to start with that one. :blush:

 

Thanks

 

Lotti

Share this post


Link to post
Share on other sites
I sorted that one.

 

but now get:

 

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

 

select startdate, counter from TABLE_COUNTER

 

[TEP STOP]

 

I'm afraid I don't even know where to start with that one. :blush:

 

Thanks

 

Lotti

 

I also get:

 

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

Share this post


Link to post
Share on other sites
I also get:

 

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

 

I got rid of that but now get:

 

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

Share this post


Link to post
Share on other sites
I got rid of that but now get:

 

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

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×