Hide/Show WooCommerce Products

Home Forums Community Hide/Show WooCommerce Products

This topic contains 3 replies, has 2 voices, and was last updated by  2KDesign 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31661

    dlcred
    Newbie

    Hello!

    I know there is a shortcode that one can use to show/hide content based on the number of points a user has. I was wondering though, if that can be extended to WooCommerce products. I would like to be able to hide or show WooCommerce products in the same. Is this possible?

    Thanks!

    #31703

    2KDesign
    Member

    Hello!
    i guess it is.. just use the mycred_show_if shortcode around a woocommerce product.. this should work
    example

    [mycred_show_if balance=10 ctype="mypoints"]woocommerce product here[/mycred_show_if]

    This will show the given product only to users with an amount of 10 of “mypoints” pointtype

    #31714

    dlcred
    Newbie

    Thanks for the reply.

    I’m not sure how that can be done as Woocommerce products are a custom post type and when they are displayed on a page, they are displayed dynamically. Even if I was to use Woocommerce shortcodes to display a product and then use the Mycred to hide them, it would only hide that access point but if a user has the permalink for that product, they could still access it.

    Hope that makes sense. I’m trying to restrict access using Mycred. Not sure if it can be accomplished with that shortcode.

    Thanks again!

    #31716

    2KDesign
    Member

    Hm, well that’s another case….

    With using only Mycred for this case i would try to use the “sell content” addon and sell the page for “0.01” points. This way it opens up only for logged in users…But.. it could be that the products embedded by woocommerce are not hidden, due to the fact that mycred can not hide embedded content.. but i would give it a try. If it not hides the content you can use a little trick for this..

    Make a new page. call the shop page inside this page via an “iframe” and sell this new page for 0.01 points. it will surely hide anything in the iframe from being viewed 🙂

    If people are arguing that they need to pay 0.01 points for seeing something.. use the mycred shortcode “give” to give them the needed 0.01 points when entering any page with a “0.01” access-point.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Last edited December 13, 2016