Jump to content

Archived

This topic is now archived and is closed to further replies.

Stealth1

Distinct search in mysql

Recommended Posts

Sorry about the poor title, couldn't think of the right way to ask this.

 

I was told a solution to my problem may be to put something in the mysql statement for the search function so that instances of the same product don't show up multiple times in the results.

 

I have many products which are created in one category but then are copied via the "link product" action to other categories. This works great in the sense that a product only shows up once, but it poses a problem with Header Tag and Meta contributions as it maintains the information from the initial category rather than dynamically changing based on the actual breadcrumb trail of the category it is being viewed in.

 

So if I used the copy action with the "duplicate product" then each instance would have seperate Header Tag and Meta information but the product would show up each time in the manufacturers and search function.

 

Is there any way to put a statement in these functions that if a product with the same model or model name is found that it only shows it once?

Share this post


Link to post
Share on other sites

Products that are 'linked' to other categories only appear in the products database once. If you have a single item and you link it to 8 other categories you still only have one item. No matter how many times you linked it to other categories, once that one product is sold they will all show to be out of stock.

 

Product that are COPIED into other categories are just that. Copied, and appear in the products table once for each time copied..... If you have one item, and you copy it into 8 other categories, then it is like having 9 separate but identical products that can each be sold.

 

Now, having said all that, did you enter your products wrong and are now trying to fix your mess with code changes? Or, do you really have a legitimate code problem?


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Products that are 'linked' to other categories only appear in the products database once. If you have a single item and you link it to 8 other categories you still only have one item. No matter how many times you linked it to other categories, once that one product is sold they will all show to be out of stock.

 

Product that are COPIED into other categories are just that. Copied, and appear in the products table once for each time copied..... If you have one item, and you copy it into 8 other categories, then it is like having 9 separate but identical products that can each be sold.

 

Now, having said all that, did you enter your products wrong and are now trying to fix your mess with code changes? Or, do you really have a legitimate code problem?

 

The issue is that with all of the Header Tag and Meta contributions available if I have the products "linked" the Header Tag and Meta information is the same for each instance of the product in different categories.

 

Right now I use KissMT for this stuff and with the linked option it shows as follows for example

 

Original Product Creation

Catalog >> Home >> 1998-2001

Header Tag shows all the product info and then "Home" and "1998-2001"

 

Linked product to a different category

Catalog >> House >> 2002-2003

Header Tag shows all the product info an then "Home" and "1998-2001" since it pulls the information not from the cPath but from the original location the product was created.

 

I asked to have the contribution modified so it bases the information on the cPath but the author doesn't feel it should be changed

 

I have my categories broken down into certain Manufacturer/model/submodel/year since my customer base is very targetted and it works best this way. Many products are used across multiple categories.

 

Now if I was to duplicate the product into each category the problem of the product showing up multiple times in the manufacturers and search results arises. The Meta and Header Tags would be changed as I want though so if I could have the multiple instances not shown in the manufacturers and search results it would work almost perfect.

Share this post


Link to post
Share on other sites

 

Header Tag shows all the product info an then "Home" and "1998-2001" since it pulls the information not from the cPath but from the original location the product was created.

 

I asked to have the contribution modified so it bases the information on the cPath but the author doesn't feel it should be changed

 

It's not a matter of the author not feeling like it should not be changed, but because it would mean a very major change in the methodology of the coding. As I said earlier, products that are linked are in the database once. The meta tag information is stored in the products database. Where would you propose the meta tag data be kept for all the 'linked' products?

 

He would have to move all the meta tag information to the products_to_categories table, and change several hundred lines of code. Anyone that updated would then have to uninstall several hundred lines of code prior to installing several hundred lines of code. The author not feeling like it should be changed is based on the benefits returned vs the risk involved in making the change.

 

Of course, that's just my opinion.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

It's not a matter of the author not feeling like it should not be changed, but because it would mean a very major change in the methodology of the coding. As I said earlier, products that are linked are in the database once. The meta tag information is stored in the products database. Where would you propose the meta tag data be kept for all the 'linked' products?

 

He would have to move all the meta tag information to the products_to_categories table, and change several hundred lines of code. Anyone that updated would then have to uninstall several hundred lines of code prior to installing several hundred lines of code. The author not feeling like it should be changed is based on the benefits returned vs the risk involved in making the change.

 

Of course, that's just my opinion.

 

I don't believe KissMT stores anything in the database, it pulls the information from the database and caches it. The author FWR said it would just probably require having the cache files include the cPath and not just the product id.

 

What your saying is alot of work but that is not what I am asking for nor what others have said could be done.

Share this post


Link to post
Share on other sites

×