Double listed products with the same SKU on category page

Pending
REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme June 23, 2021
Login to reply
Igor Sunz Support Agent
3 years ago

Sorry, but my answer is the same. For all compatible vendor plugins we have no customization in product loop and we use direct functionality of vendor plugins

Ivan Gacesa
3 years ago

WCFM and WCMP are not the same plugin.

We use WCMP and the snippet which I sent you I'd received from WCMP developers. Do you have suggestion for WCMP?

Thanks in advance

Igor Sunz Support Agent
3 years ago

I recommend to write to authors of WCFM

we use regular WCFM function for products

$WCFMmp->template->get_template( apply_filters( 'wcfmp_store_default_template', 'store/wcfmmp-view-store-products.php', $store_tab ), array( 'store_user' => $store_user, 'store_info' => $store_info ), '', apply_filters( 'wcfmp_store_default_template_path', '', $store_tab ) );

So, it's not controled by theme

Ivan Gacesa
3 years ago

I added this code using the Code Snippets plugin (as I added snippets for other things), but it doesn't work.

Do you have any suggestions?

Igor Sunz Support Agent
3 years ago

Yes, it looks fine

You can use it in functions.php

https://rehubdocs.wpsoul.com/docs/rehub-theme/child-themes/how-to-customize-your-theme/


Сб, 9 окт. 2021 г. в 19:53, Sizam Support Help Desk <
sizamtheme+E9PZbBO4GrJl6XVWYk0y@mail.support-hub.io>:

Ivan Gacesa
3 years ago

They sent us the snippet (and the comment below) , but we have the same issue. Do you have any suggestion how to change the snippet?

function _additional_woo_query( $query ) {
    if ( wcmp_is_store_page() ) {
        $products = array();
        $store_id = wcmp_find_shop_page_vendor();
        $vendor = get_wcmp_vendor($store_id);
        $vendor_product_ids = wp_list_pluck( $vendor->get_products_ids(), 'ID' );
        if( isset($vendor_product_ids) && !empty($vendor_product_ids) ) {
            $query->set('post__in',$vendor_product_ids );
        }
    }
}
add_action( 'pre_get_posts', '_additional_woo_query', 999 );

The above code will help you to show the all products on vendor shop page.

If this code is not working then please add your custom code. Using below filter you can change the product query.

Kindly ask to your theme developer.

Igor Sunz Support Agent
3 years ago

this function can help you to show some information on store page, but it will not help to show hidden products, because product loop is controlled by plugin. You need to ask option to change product loop of store page (not just function to detect store page)

Ivan Gacesa
3 years ago

We use WC Marketplace (not WCFM).

They told us you could tell us which hooks we could use?

To show hidden product on shop page you can use below function to check is this a shop page or not.

if (wcmp_is_store_page())

Kindly ask your theme developer to check the page before add their code.


Igor Sunz Support Agent
3 years ago

I think yes, I recommend to ask authors of WCFM for a snippet how to show hidden products ONLY on store pages. They should have it

Ivan Gacesa
3 years ago

When the "Hide Duplicate Products" action is done it will actually set product visibility to "hide from catalog and search" to all products with the same SKU except for the one with the lowest price.

Product visibility is WooCommerce taxonomy, so would it be possible to make use one of the WordPress' hooks, most likely pre_get_posts or parse_query, to alter global query object and display products which are hidden (essentially belong to hidden categories) on shop pages like shop/shop1 (that is dc_vendor_shop taxonomy - WC Marketplace plugin) ?

Igor Sunz Support Agent
3 years ago

you can't deactivate products from general shop page and keep them on store pages. You can deactivate them globally only or keep them visible

Ivan Gacesa
3 years ago

Hi Igor,

Do you have any update how to show products on their shop pages and not to make duplicates products (with same SKU) on category page?

Ivan Gacesa
3 years ago

I'm not sure that we understood each other.

Product X has SKU 123 and this product is sold by shop 1 - price 100, shop 2 - price 200, shop 3 - price 300 (price comparison marketplace).

On the product page we want 3 prices (100, 200 and 300), names of shops that sell this product and this product will be displayed on first shop's page with price 100, on second shop's page with price 200 and on third shop's page price 300.

Also, not to duplicate the products with same SKU on category page like product X - 100, product X  - 200 and product X - 300 (3 times the product with the same sku). We resolved this with 'Hide duplicated products with same SKU' but why this option also removed products from shops pages (it's looks like shop 2 and shop 3 don't have this product for selling)?

Igor Sunz Support Agent
3 years ago

*Under Woocommerce -> Status -> Tools -> Hide button for 'Hide duplicated
products -This tool will hide products which have identical SKU *

second added products with the same sku disappeared from shop page.

The only function of "Woocommerce -> Status -> Tools -> Hide button for
'Hide duplicated" is removing products with the same SKU from shop. So, you
used it, tool hided products, so, why do you ask why it's not available?
Don't use this tool if you want to keep all products. You can edit product
and make it available for shop again
https://monosnap.com/file/5F45YDIhryljfjHpRzWrXpdbt73DWC

Ivan Gacesa commented privately
Igor Sunz Support Agent
3 years ago

.vendor_store_details{display:none}

you can place this in theme options - general options - custom css

2. I guess because you used tool to hide all duplicate products with more
bigger price

Ivan Gacesa commented privately
Igor Sunz Support Agent
3 years ago

we are not able to check without direct links

Ivan Gacesa
3 years ago

Hi Igor,

After hiding duplicate products with the same SKU and selected product layout - Compare Prices by sku on the product page shows 2 vendors logo and their prices, not vendor names in the table?

There's only one vendor under the table, why? (maybe to hide this html element with css)

If I select a brand for product, the vendor's logo is not displayed, only brand logo?

I found issue, if I click on the first price - vendor 1 store link, the product is on the vendor 1 store page, but if I click on the second price - vendor 2 store link this product is not shown on the vendor 2 store page. Is this issue related to the theme or WCMp?
If I open another products the same things with another link for vendors stores.

Igor Sunz Support Agent
3 years ago

currently - yes.

Ivan Gacesa
3 years ago

Hi Igor,

Button solved the issue :)

Under Woocommerce -> Status -> Tools -> Hide button for 'Hide duplicated products -This tool will hide products which have identical SKU after import via WPAI.'

We need to do this after adding any product with the same sku?

Igor Sunz Support Agent
3 years ago

enable RH woo tool plugin

Now in Woocommerce - settings - status you can find button to merge duplicated SKU on products

Ivan Gacesa
3 years ago

Hi,

The ReHub theme is great. We use WCMp and products with same sku will be sold by more vendors. 

We have installed RH Woo Tools and prices are fine on the product page (layouts: Compare Prices by sku or Compare Prices with shortcode).

How to display only one product with minimal price on category page (if there are more than one products with the same sku)?

In WCMp settings we checked Allow multiple vendors to sell the same product. Buyers can choose their preferred vendor. and Show SPMV products by Min Price.

Regards

Additional Info

Link on page with issue: _