• Resolved aaron19888

    (@aaron19888)


    Hi,

    So we have some products which have been Archived by shop vendors and because the Catalog Visibility it set to: Shop and Search Results when you view the vendors shop it looks like she has 1 missng product as theres a gap.

    So if there a way for Archived Products inside wcfm to have Catalog Visibility set to Hidden by default?

    Thanks
    Aaron

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Sure, add this snippet to your site –

    add_action( 'wcfm_after_product_archived', function( $product_id ) {
    	$product = wc_get_product(	$product_id );
    	$product->set_catalog_visibility( 'hidden' );
    	$product->save();
    });

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin –?https://www.ads-software.com/plugins/code-snippets/

    Thread Starter aaron19888

    (@aaron19888)

    Thanks for that works perfectly :).

    One other thing which i find weird for Older products which are archived but are set to Search and Shop Results can these be updated as well some how?

    Reason i ask this is because if you edit an archived product then change that visiblity manually then Submit. it puts the product back to published so then the customer has to Archive it again.

    Thanks
    Aaron

    Plugin Author WC Lovers

    (@wclovers)

    One other thing which i find weird for Older products which are archived but are set to Search and Shop Results can these be updated as well some how?

    – Please do this using WooCommerce Bulk Edit option. Check this – https://www.loom.com/share/e0d6c94995d74ecc94d9258723f9072d

    Thread Starter aaron19888

    (@aaron19888)

    Thanks :).

    I got a weird thing happening on particular store thay have about 93 products in stock. but only 40 are showing. i did a bulk edit by filter that particular store inside WCFM to change all published to: Catalog and Search. Cleared WP rocket cache inside wp-content/cache but still the same.

    Any ideas what could be causing this?

    Thanks
    Aaron

    Thread Starter aaron19888

    (@aaron19888)

    Just did a test and i went to one of the shops and did: Bulk Edit. changed Visibility from Catalog and Search to just Catalog then back to Catalog and Search.

    Then the shop on front-end startedto show the correct amount of products, any idea why this happened?

    Also is there a SQL query i can run to say Update Products where published and set visibility to Catalog. then i can do the same but change to Catalog and Search.

    Thanks
    Aaron

    Plugin Author WC Lovers

    (@wclovers)

    Just did a test and i went to one of the shops and did: Bulk Edit. changed Visibility from Catalog and Search to just Catalog then back to Catalog and Search.

    – Maybe this was caching issue, taking some time refresh!

    Or, maybe WooCommerce transient issue.

    Thread Starter aaron19888

    (@aaron19888)

    Ok, another thing maybe you can help we have created a new endpoint: to add some functionality for Shop Categories for each Vendor.

    So we have created 2 pages in a plugin instead of functions.php and have:

    views/wcfm-shop-category-list.php &
    views/wcfm-shop-category-manage.php

    Now inside these it has endpoints but how would i get the category name on fronend from: wcfm-shop-category-list.php ? wouldi just use shortcode [endpoint name] ?

    Thanks
    Aaron

    Plugin Author WC Lovers

    (@wclovers)

    Now inside these it has endpoints but how would i get the category name on fronend from: wcfm-shop-category-list.php ? wouldi just use shortcode [endpoint name] ?

    – Sorry, don’t under this. Kindly know me what exactly you are trying to do with these new endpoint.

    Thread Starter aaron19888

    (@aaron19888)

    So Basically we have created a new section inside WCFM called: Shop Category.

    So shop vendors can add categories based on there own shop, so on this page as an example:

    https://thebritishcrafthouse.co.uk/shop/joysofglass/ on the left where we have Featured Products we would like to add these categories which have been created and selected. Please find attached both files which makes it work inside the backend, just not sure how to get the shortcode working on frontend.

    Zip of both files https://we.tl/t-YsZUHJOec2 if you could take a look that would be great, as if we can do shortcode on frontend then can use a widget ??

    Thanks

    • This reply was modified 4 years, 2 months ago by aaron19888.
    Plugin Author WC Lovers

    (@wclovers)

    So Basically we have created a new section inside WCFM called: Shop Category.

    – Is this different than product categories? Or, using this you are allowing vendors to create their product categories?

    https://thebritishcrafthouse.co.uk/shop/joysofglass/ on the left where we have Featured Products we would like to add these categories which have been created and selected.

    – This vendors store page, right? So just create a shortcode and add under this sidebar using text widget.

    Now, process that shortcode and show this vendor’s created categories.

    Thread Starter aaron19888

    (@aaron19888)

    We are doing it to allow vendors to create there own categories ?? what shortcode would i create / use is what i am stuck on ??

    Plugin Author WC Lovers

    (@wclovers)

    You may create any shortcode using WP “add_shortcode” function – https://developer.www.ads-software.com/reference/functions/add_shortcode/

    Thread Starter aaron19888

    (@aaron19888)

    Thanks managed to do that, also whats the easiest way to add a delete button function inside a new wcfm endpoint for the files we have done above? so the vendors or admins can delete there categories?

    Plugin Author WC Lovers

    (@wclovers)

    Kindly show me your added endpoint page screenshot.

    Thread Starter aaron19888

    (@aaron19888)

    Hi, its all sorted now ??

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Catalog Visibility archived products’ is closed to new replies.