News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Omit specific category from search results

Started by phil147, November 11, 2022, 21:02:57 PM

Previous topic - Next topic

phil147

Hi,
I'm using VM 3.2.12

When we have many products out of stock I'm looking for a way of preventing them showing in product search results.

I have a custom product cateogry and I'm trying to change code so it omits from showing in product search rsults.

I've tried this inside the products.php file , but havnt managed to unset the relevant array key holding the cateogry to hide.

I'm thinking the code should be used in the file where search results are compiled but havnt managed to find this file.

I rather not disable the products as its not good for seo.

Thanks
Phil

see below for code I tried within products.php in folder /html/com_virtuemart/sublayouts/

//   foreach ($product->categories as $key => $value) {
   //               echo " key is ". $key. " value is ". $value;
      //            if($value == 305){ 
          //                $remove[] = $key;
            //              unset($products["$key"]);

hazael

#1
Quote from: phil147 on November 11, 2022, 21:02:57 PM
I rather not disable the products as its not good for seo.
Why are they not good for SEO?

If you are using stock, In the Virtuemart configuration, select the option: Don't show products if related products are out of stock, or hide the product

If you have a lot of products of a similar type that you do not have in stock, it is not worth publishing them.  There is such a thing as bounce rate.
A page that has uninteresting content is usually quickly closed by users. Too short visit time will lower your position in Google ranking.



The only thing wrong with this Virtuemart component is that if the products are related to each other and if children's products are in stock, but the stock of the parent product is 0: Effect - It is this parent product that is displayed

pinochico

When we have many products that are out of stock, I look for a way to prevent them from showing up in product search results.

We use the Discontinued checkbox and have modified the search code

public function sortSearchListQuery

$queryBuilder->setWhere('p.product_discontinued', '0' );


for FE
for displaying on BE in the administration
for eliminate in CF Filtering
for eliminate in Easy Feeder for export to feeds.
At the same time, we have modified the product detail to indicate these products are no longer available for sale.
This is solutions we taked form big world's shop - www.alza.cz
By doing this we preserved the indexed URLs and their existence (We never disable products - this is a basic mistake!!!) and therefore do not generate 404s -yes you are right here.

So you can use a similar method for products that are out of stock and modify the same function.

QuoteIf you have a lot of products of a similar type that you do not have in stock, it is not worth publishing them.  There is such a thing as bounce rate.
A page that has uninteresting content is usually quickly closed by users. Too short visit time will lower your position in Google ranking.

Unfortunately, these are just the musings of wannabe marketers who are bandying about other people's words.
More important for google is whether the product page does not generate 404s and has proper SEO.
So far, there is no tool on Google that evaluates page view recommendations based on bounce rate for internet users.


So if you don't post a product that is out of stock, you are in trouble and you can forget about any bounce rate at that point == don't be fooled by the fact that a product that is out of stock doesn't have interesting content :)
People will continue to search for it because it's indexed and published, and from there they'll go to your eshop.
If you generate a 404 for it, yes, then they won't come back to your store...
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

hazael

#3
There is such a thing as "link juice" inside the domain. Domain strength is divided by the number of internally linked pages.
With a weak domain and a very large number of products, there is a high probability that Google will not index everything - even if you use sitemap.xml
Pages with products are usually of poor quality in the rankings, due to poor content. By removing junk content, you will strengthen other valuable content.
Of course, if the product will be sold further in the future, it is not worth removing or hiding it. It is also not profitable to remove pages that are linked by valuable external domains - such addresses i usually redirect to specific places.

phil147

Quote from: pinochico on November 13, 2022, 03:25:57 AM
When we have many products that are out of stock, I look for a way to prevent them from showing up in product search results.

We use the Discontinued checkbox and have modified the search code

public function sortSearchListQuery

$queryBuilder->setWhere('p.product_discontinued', '0' );


for FE
for displaying on BE in the administration
for eliminate in CF Filtering
for eliminate in Easy Feeder for export to feeds.
At the same time, we have modified the product detail to indicate these products are no longer available for sale.
This is solutions we taked form big world's shop - www.alza.cz
By doing this we preserved the indexed URLs and their existence (We never disable products - this is a basic mistake!!!) and therefore do not generate 404s -yes you are right here.

So you can use a similar method for products that are out of stock and modify the same function.

QuoteIf you have a lot of products of a similar type that you do not have in stock, it is not worth publishing them.  There is such a thing as bounce rate.
A page that has uninteresting content is usually quickly closed by users. Too short visit time will lower your position in Google ranking.

Unfortunately, these are just the musings of wannabe marketers who are bandying about other people's words.
More important for google is whether the product page does not generate 404s and has proper SEO.
So far, there is no tool on Google that evaluates page view recommendations based on bounce rate for internet users.


So if you don't post a product that is out of stock, you are in trouble and you can forget about any bounce rate at that point == don't be fooled by the fact that a product that is out of stock doesn't have interesting content :)
People will continue to search for it because it's indexed and published, and from there they'll go to your eshop.
If you generate a 404 for it, yes, then they won't come back to your store...

Very good answer , thank you very much. Will look into the code

Phil