WCMp Core
Tagged: hidden products
-
AuthorPosts
-
-
October 4, 2021 at 6:30 PM #128601igParticipant
I’m using ReHub theme and allow Allow multiple vendors to sell the same product – Single Product Multiple Vendors (SPMV) is checked.
ReHub theme has the function “Woocommerce -> Status -> Tools -> Hide button for ‘Hide duplicated” is removing products with the same SKU. It works fine for product pages and category pages but also hide products on shop pages except for the one with the lowest price which is a problem.
ReHub theme recommended ‘to ask authors of WCMP for a snippet how to show hidden products ONLY on store pages. They should have it.’
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) ?
-
October 4, 2021 at 8:17 PM #128609NerdySupportExpert MoumitaKeymaster
Hi @Ivan Gacesa, we have forwaded this to our developers.
They will get back to you soon. -
October 5, 2021 at 7:02 PM #128644MVX Support NinjaKeymaster
Hi,
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())
CopyKindly ask your theme developer to check the page before add their code.
Regards,
-
October 7, 2021 at 2:18 PM #128739igParticipant
Hi @Abhirup,
Thank you for the answer, I asked theme developer and they sent
‘This function (wcmp_is_store_page()) 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)’
Which WordPress hooks can we use (pre_get_posts or parse_query, to alter global query object and display products which are hidden on shop pages?
-
October 7, 2021 at 5:44 PM #128749igParticipant
Hi,
Thank you for the zip file. This is wcmp plugin update or wcmp vendor membership plugin update?
Do we need to install wcmp vendor membership plugin to show hidden products on vendor shop pages?
Can we only add snippets for hidden products?
-
October 7, 2021 at 7:27 PM #128757MVX Support NinjaKeymaster
Hi,
Sorry for the inconvenience. There was a miscommunication.As per your requirement you have to use below action to change the query
pre_get_posts
CopyRegards,
-
October 7, 2021 at 7:37 PM #128759igParticipant
Hi,
It’s not necessary to install wcmp vendor membership plugin?
Can you send the snippet for show hidden products for pre_get_posts?
Regards
-
October 8, 2021 at 6:38 PM #128816MVX Support NinjaKeymaster
Hi,
Please add this code in the function.php of the current active theme :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 );
CopyRegards,
-
October 8, 2021 at 7:22 PM #128822igParticipant
Hi Abhirup,
Thank you for the snippet, but we have the same issue.
There is one product with 2 prices from 2 vendors (shop pages). The product is displayed on the vendor shop page which has minimal price, on another shop page (who also sells this product with higher price) product is not displayed (it’s hidden with ReHub theme function “Woocommerce -> Status -> Tools -> Hide button for ‘Hide duplicated” is removing products with the same SKU.)
-
October 9, 2021 at 5:45 PM #128875MVX Support NinjaKeymaster
Hi,
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.Regards,
-
October 11, 2021 at 11:55 PM #128956igParticipantThis reply has been marked as private.
-
October 13, 2021 at 9:10 PM #129025NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
October 14, 2021 at 12:34 PM #129048igParticipantThis reply has been marked as private.
-
October 18, 2021 at 5:52 PM #129178NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
November 2, 2021 at 2:50 AM #129951igParticipant
@Moumite do you have update from the team, expected time to resolve this?
-
November 2, 2021 at 1:44 PM #129967NerdySupportExpert MoumitaKeymaster
This is the response from the theme :
“The code which you provided him is correct, we use similar in some of the functionality, but maybe he didn’t insert it properly ”
Can you share a temporary admin, FTP access so we can check?
While sharing the access, don’t forget to mark the response as private. -
November 2, 2021 at 8:43 PM #129986igParticipant
Hi @Moumita,
Thanks for your reply. The code is inserted using Code Snippet plugin (see screenshot).
Please read settings carefully (the first post in this topic), maybe issue is caused by hiding duplicate products (with the same SKU) on category pages.
ReHub theme has the function “Woocommerce -> Status -> Tools -> Hide button for ‘Hide duplicated” is removing products with the same SKU. It works fine for product pages and category pages but also hide products on shop pages except for the one with the lowest price which is a problem.
I can add an admin user for you, but just to be sure, this is not to disable all plugins and theme which you did it on another website.
-
November 3, 2021 at 7:29 PM #130024NerdySupportExpert MoumitaKeymaster
@Ivan Gacesa, yes please create a staging site and share the FTP, admin access.
While sharing the access don’t forget to mark the response as private.
-
November 4, 2021 at 5:56 PM #130067igParticipantThis reply has been marked as private.
-
November 5, 2021 at 11:29 AM #130065igParticipantThis reply has been marked as private.
-
November 5, 2021 at 11:29 AM #130066igParticipantThis reply has been marked as private.
-
November 8, 2021 at 10:38 AM #130162NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
November 8, 2021 at 9:35 PM #130210NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
November 9, 2021 at 2:21 AM #130237igParticipantThis reply has been marked as private.
-
November 9, 2021 at 8:48 PM #130315NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
November 10, 2021 at 10:17 PM #130402igParticipantThis reply has been marked as private.
-
November 11, 2021 at 4:04 PM #130431NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
November 16, 2021 at 9:09 PM #130657NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
November 16, 2021 at 9:33 PM #130661igParticipantThis reply has been marked as private.
-
November 17, 2021 at 8:02 PM #130720NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
-
AuthorPosts
The topic ‘Show hidden products on vendor shop pages’ is closed to new replies.