Jump to content
Sign in to follow this  
alfredr

Trouble with Optional Related Products 1.0

Recommended Posts

The entire install seemed to go very smoothly, and indeed the backend (admin) stuff seems to be working perfectly. When I go to the frontend to view the results, however, I get the following error . . .

 

1146 - Table 'bridal9_osc1.TABLE_PRODUCTS_OPTIONS_PRODUCTS' doesn't exist

 

select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from TABLE_PRODUCTS_OPTIONS_PRODUCTS, products_description pa, products pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '1' and pop_products_id_master = '29' and products_status=1 order by pop_order_id, pop_id

 

 

I've checked the database with phpmyadmin and the table products_options_products does in fact exist with the fields called here.

 

Anybody got a clue as to what to check next?

 

This is exactly the feature I've been looking for and it would be great to get it working.

Share this post


Link to post
Share on other sites
The entire install seemed to go very smoothly, and indeed the backend (admin) stuff seems to be working perfectly.  When I go to the frontend to view the results, however, I get the following error . . .

 

1146 - Table 'bridal9_osc1.TABLE_PRODUCTS_OPTIONS_PRODUCTS' doesn't exist

 

select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from TABLE_PRODUCTS_OPTIONS_PRODUCTS, products_description pa, products pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '1' and pop_products_id_master = '29' and products_status=1 order by pop_order_id, pop_id

I've checked the database with phpmyadmin and the table products_options_products does in fact exist with the fields called here.

 

Anybody got a clue as to what to check next?

 

This is exactly the feature I've been looking for and it would be great to get it working.

Share this post


Link to post
Share on other sites

I'm not sure if you've figured this one out, but I ran in to the same problem. What seemed to work for me was looking at the sql. The sql in the readme txt is slightly different than the sql file in the zip file. The update sql in the readme does not contain this command.

 

DROP TABLE IF EXISTS `products_options_products`;

CREATE TABLE `products_options_products` (

`pop_id` int(11) NOT NULL auto_increment,

`pop_products_id_master` int(11) NOT NULL default '0',

`pop_products_id_slave` int(11) NOT NULL default '0',

`pop_order_id` smallint(6) NOT NULL default '0',

PRIMARY KEY (`pop_id`)

) TYPE=MyISAM AUTO_INCREMENT=18 ;

 

However, it is included in the stand alone related_products.sql. Originally I used the update sql from the readme and encountered the same problem. Once I used the full sql, it works like a dream.

Share this post


Link to post
Share on other sites

Does anyone know how to make Optional Related Products 1.0 work with sts templates???

 

need help!!

 

Optional Related Products 1.0 it works fine when I turn off STS templates but it needs a fix like the DHTML Categories Menu contrib:

http://www.oscommerce.com/community/contributions,2844

 

.... would anyone be able to help? I need to have an $ comand so that I can implement it into all my sts template pages? can anyone help?

 

here's my site:

 

 

http://www.ariellesgallery.com

Share this post


Link to post
Share on other sites

I'm having the same problem. Any ideas.

 

1146 - Table 'mystore.table_products_options_products' doesn't exist

 

select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from TABLE_PRODUCTS_OPTIONS_PRODUCTS, products_description pa, products pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '1' and pop_products_id_master = '21' and products_status=1 order by pop_order_id, pop_id

 

 

I have checked in PhpMyadmin and the products_options_products is there.

 

Any help woud be appreciated.

 

Mick

Share this post


Link to post
Share on other sites
I'm having the same problem. Any ideas.

 

1146 - Table 'mystore.table_products_options_products' doesn't exist

 

select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from TABLE_PRODUCTS_OPTIONS_PRODUCTS, products_description pa, products pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '1' and pop_products_id_master = '21' and products_status=1 order by pop_order_id, pop_id

I have checked in PhpMyadmin and the products_options_products is there.

 

Any help woud be appreciated.

 

Mick

 

Same here, any answers???

 

David


Ebaby.ca - Toothbrush.ca - Halitosis.ca - Templatemonster.ca - Adultfriendfinders.ca

Share this post


Link to post
Share on other sites

Ok...with some messing around, I have found the fix for the sql problem. If you go to the contribution and download the one dated Feb 25, you will have an sql file there that needs to be run. The one in the latest package does not work right. You must also go into your phpmyadmin and delete the extra field that it creates in configuration_group.

 

I have also noticed with this contrib, if you use thumbnails, you can not alter the size of those thumbnails without altering the size of the small image shown on the category page. I have messed around with the images and found also that if you add more than 3 related products, it blows out the table and does put a carriage return to list below the other related products.

Share this post


Link to post
Share on other sites
Ok...with some messing around, I have found the fix for the sql problem. If you go to the contribution and download the one dated Feb 25, you will have an sql file there that needs to be run. The one in the latest package does not work right. You must also go into your phpmyadmin and delete the extra field that it creates in configuration_group.

 

I have also noticed with this contrib, if you use thumbnails, you can not alter the size of those thumbnails without altering the size of the small image shown on the category page. I have messed around with the images and found also that if you add more than 3 related products, it blows out the table and does put a carriage return to list below the other related products.

 

Hi thanks a lot for your help. I've added the database from the 25th but I'm having trouble with the deletion on the Extra field. I went to phpmyadmin but I don't know how to delete that field. Can you please help.

 

Regards,

 

David


Ebaby.ca - Toothbrush.ca - Halitosis.ca - Templatemonster.ca - Adultfriendfinders.ca

Share this post


Link to post
Share on other sites
Hi thanks a lot for your help. I've added the database from the 25th but I'm having trouble with the deletion on the Extra field. I went to phpmyadmin but I don't know how to delete that field. Can you please help.

 

Regards,

 

David

 

Hi, I had forgotten to add some codes. It doesn't work yet but it's on its way.

 

Thanks,,

 

David


Ebaby.ca - Toothbrush.ca - Halitosis.ca - Templatemonster.ca - Adultfriendfinders.ca

Share this post


Link to post
Share on other sites
Hi thanks a lot for your help. I've added the database from the 25th but I'm having trouble with the deletion on the Extra field. I went to phpmyadmin but I don't know how to delete that field. Can you please help.

 

Regards,

 

David

 

Go to phpmyadmin, open you osc database, click on configuration_group on the left, on the right click on browse, make sure there are not two entries for related products, if there are, click on the x beside the one with 901 as the group id.

Share this post


Link to post
Share on other sites
Ok...with some messing around, I have found the fix for the sql problem. If you go to the contribution and download the one dated Feb 25, you will have an sql file there that needs to be run. The one in the latest package does not work right. You must also go into your phpmyadmin and delete the extra field that it creates in configuration_group.

 

I have also noticed with this contrib, if you use thumbnails, you can not alter the size of those thumbnails without altering the size of the small image shown on the category page. I have messed around with the images and found also that if you add more than 3 related products, it blows out the table and does put a carriage return to list below the other related products.

 

 

Hello sir, I have tried that but still not working for me. Still got this message:

 

1146 - Table 'USER.TABLE_PRODUCTS_OPTIONS_PRODUCTS' doesn't exist

select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from TABLE_PRODUCTS_OPTIONS_PRODUCTS, products_description pa, products pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '4' and pop_products_id_master = '42' and products_status=1 order by pop_order_id, pop_id

Share this post


Link to post
Share on other sites

I'm also curious if anyone has come up with a solution to put the carriage return in if you are using images and have more than three items? I am using related products v 3. 2 and everything including the install is working like a charm..... :thumbsup: Great work!!!!

Share this post


Link to post
Share on other sites
I'm also curious if anyone has come up with a solution to put the carriage return in if you are using images and have more than three items? I am using related products v 3. 2 and everything including the install is working like a charm..... :thumbsup: Great work!!!!

 

I have the same problem.. is it possible to set the number of items in a row?

Share this post


Link to post
Share on other sites

One more improvement to be done:

 

how can I have the drop down menus in the admin display the Product model instead of the name? I have too many products with the same name (ie mini skirt) so I need a unique way to identify them.

Anyone has a simple solution?

here's the code that generates the drop downs. If someone can point out how to make one work I think I can fix the others too:

 

<td class="smallText"> <select name="products_id_master">

<?php

$products = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' order by pd.products_name");

while($products_values = tep_db_fetch_array($products)) {

if ($attributes_values['pop_products_id_master'] == $products_values['products_id']) {

echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '" SELECTED>' . $products_values['products_name'] . '</option>';

} else {

echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>';

}

}

?>

</select> </td>

Share this post


Link to post
Share on other sites
Can anyone tell me what the "inherit" option is supposed to do???

 

Inherit allows you to assign the same product associations to the "Master" as those associated to the "Slave".

 

When you assign relationships, you select the "Master" product in the left column, then the product to be related, the slave, in the right column.

 

The same is true with Inherit.

 

For example, let's say you have Item 1, and using "Insert" you related Item 2, Item 3, Item 4, and Item 5 to Item 1. Now you want to relate Items 2 through 5 with Item 6.

 

Select Item 6 from the left column (Master) drop-down. Now select Item 1 from the right column (Slave) drop-down. Click on "Inherit". You are now taken to the page specific to Item 6, where you can see the Items 2-5 have been associated with Item 6.

 

Including a sort order is optional. Inherit will assign the sort order to all the items, so you still need to update the sort order after the Inherit action. It assigns '0' if you leave it blank.

 

To get Update to work, however, you'll need to change one line of code in the admin/products_options.php file.

 

Look for this line of code, (around line 244):

			<td align="center" class="smallText"> <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> <?php echo '<a href="' . tep_href_link(FILENAME_RELATED_PRODUCTS, '&attribute_page=' . $attribute_page . '&products_id_view='.$products_id_view, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a> </td>

 

And replace if with this line of code:

			<td align="center" class="smallText"> <input type="hidden" name="action" value="update_product_attribute"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> <?php echo '<a href="' . tep_href_link(FILENAME_RELATED_PRODUCTS, '&attribute_page=' . $attribute_page . '&products_id_view='.$products_id_view, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a> </td>

 

This correction is for version 3.2 and above and will be included in the next version released by myself, probably version 3.3-c. (Waiting for 3.3-b, with screenshots, to be approved first...)

 

-Skittles

Share this post


Link to post
Share on other sites

hii,

is it possible that no one else has the same problem I have, ie to have the product code in the drop down menus instead of the product name?

I have too many products with similar -or identical- names and it would be an hazard every time.

suggestions? solutions?

 

thanks

ciao

Share this post


Link to post
Share on other sites
hii,

is it possible that no one else has the same problem I have, ie to have the product code in the drop down menus instead of the product name?

I have too many products with similar -or identical- names and it would be an hazard every time.

suggestions? solutions?

 

thanks

ciao

 

It would even be much better to see both the product-code

and the product-name visible in the dropdown!

Is that possible?

 

Cheers,

Eric :D

Share this post


Link to post
Share on other sites
hii,

is it possible that no one else has the same problem I have, ie to have the product code in the drop down menus instead of the product name?

I have too many products with similar -or identical- names and it would be an hazard every time.

suggestions? solutions?

 

thanks

ciao

 

Stefano,

 

This is UNTESTED!

 

Backup the file first, then try the following code:

<td class="smallText"> <select name="products_id_master">
<?php
$products = tep_db_query("select p.products_id, p.products_model from " . TABLE_PRODUCTS . " p where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' order by p.products_model");
while($products_values = tep_db_fetch_array($products)) {
if ($attributes_values['pop_products_id_master'] == $products_values['products_id']) {
echo "\n" . '<option name="' . $products_values['products_model'] . '" value="' . $products_values['products_id'] . '" SELECTED>' . $products_values['products_model'] . '</option>';
} else {
echo "\n" . '<option name="' . $products_values['products_model'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_model'] . '</option>';
}
}
?>
</select> </td>

 

This is the snippet you provided in a previous post with changes that *should* give the results you want. As I said, I haven't tested it. But it should be worth a few minutes of your time to give it a try. (I really need to get back to work on *billable* projects. :) )

 

-Skittles

Share this post


Link to post
Share on other sites
It would even be much better to see both the product-code

and the product-name visible in the dropdown!

Is that possible?

 

Cheers,

Eric :D

Hi Eric,

 

Using both isn't practical in most cases. The drop-down menus expand to the widest value unless you set the width, and then part of the option is out of view.

 

I can add options to the configuration file that allow users to specify one or the other, or both. Then it's up to the shop owner, what works best for them

 

However, I really have to get work done on my current project. I've "played" all weekend.

 

When I have it all worked out, and tested, I'll add it to the contrib and upload it. (If no one beats me to it...)

 

I'll PM you when I've got it done. And of course, I'll post here that it's up.

 

-Skittles

Share this post


Link to post
Share on other sites
Hi Eric,

 

Using both isn't practical in most cases. The drop-down menus expand to the widest value unless you set the width, and then part of the option is out of view.

 

I can add options to the configuration file that allow users to specify one or the other, or both. Then it's up to the shop owner, what works best for them

 

However, I really have to get work done on my current project. I've "played" all weekend.

 

When I have it all worked out, and tested, I'll add it to the contrib and upload it. (If no one beats me to it...)

 

I'll PM you when I've got it done. And of course, I'll post here that it's up.

 

-Skittles

 

Hi Skittles,

 

Yes when given the option to choose in admin is really super! Thanks!

 

Good luck with your "payed" work ;-)

 

Eric :D

Share this post


Link to post
Share on other sites
Why is it when you inherit the related items from one to another, it doesn't copy over the sort field too?

 

Great product BTW! :D

PuffDandEd,

 

Once I figured out how inherit works, I wondered the same thing.

 

But the more I think about it, the more sense it makes:

  • Not everyone will want the same sort order on every product, and
  • Inheriting from more than one product can produce duplicate sort order entries.

The original contribution listed the products from top to bottom (vertically). It seems to me, the sort order was more important when you were deciding which product(s) would be "above the fold". Now that the products are listed side by side, It isn't nearly as critical.

 

Then if you turn on random sort, the "sort order" becomes irrelevant, saving you lots of time updating. :)

 

Well, back to the grind...

-Skittles

Share this post


Link to post
Share on other sites
The entire install seemed to go very smoothly, and indeed the backend (admin) stuff seems to be working perfectly. When I go to the frontend to view the results, however, I get the following error . . .

 

1146 - Table 'bridal9_osc1.TABLE_PRODUCTS_OPTIONS_PRODUCTS' doesn't exist

 

select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from TABLE_PRODUCTS_OPTIONS_PRODUCTS, products_description pa, products pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '1' and pop_products_id_master = '29' and products_status=1 order by pop_order_id, pop_id

I've checked the database with phpmyadmin and the table products_options_products does in fact exist with the fields called here.

 

Anybody got a clue as to what to check next?

 

This is exactly the feature I've been looking for and it would be great to get it working.

 

I had the same problem. I missed to add to both database_tables.php the following code:

 

// DANIEL: begin

define('TABLE_PRODUCTS_OPTIONS_PRODUCTS', 'products_options_products');

// DANIEL: end

 

To solve the problem, you must include it in both catalog/includes/database_tables.php and catalog/admin/includes/database_tables.php

Share this post


Link to post
Share on other sites
I had the same problem. I missed to add to both database_tables.php the following code:

 

// DANIEL: begin

define('TABLE_PRODUCTS_OPTIONS_PRODUCTS', 'products_options_products');

// DANIEL: end

 

To solve the problem, you must include it in both catalog/includes/database_tables.php and catalog/admin/includes/database_tables.php

Cristian,

 

Excellent point!

 

A search through the forum will show that this error is very common with contribs that add new tables to the database. Because the filenames are identical, and the instructions for each are usually also identical, it's easy to look at the directions and believe you've already done that step.

 

And for those of us who've done a few mods, (or more,) making changes to both database_tables.php files quickly becomes second nature. Directions that seem obvious to us can still prove challenging to folks doing their first mod.

 

By the way, welcome to the community.

-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
Sign in to follow this  

×