Okay
  Public Ticket #2617791
Hiding shop modules in other pages than shop?
Closed

Comments

  • Orestis started the conversation

    Hello, I really like your plugin, its simple and powerful. 

    The scenario I am trying to recreate is to hide the store for all visitors, allow registered users to see the shop (I use an Easy Registration Forms to enable users), and when a user is finally logged in I want them not to see and prices or Add to Cart button. The last option to hide from logged in users the prices is done with a Pricing Rule but I dont see a way to hide the Add to cart and quantity also.

  •  2,219
    WebWizards replied

    Hello Orestis,


    1)

    I am sorry, I could not verify the purchase code you gave us, I think you probably sent us something else by mistake.

    For the purchase code please do the following,
    -> Go to https://codecanyon.net/downloads
    -> Click as it's shown in this image:
    0?ui=2&ik=5a46e45e67&attid=0.3&permmsgid=msg-a:r-1923782612169588203&th=1761c0675bf89b03&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ-zLMjn4syMQHE8EgxICLzCEo7MY-gzbNtDXzEyXGlgWDd6b9aUEtZexm03yOgZ9BwG43TM_dt9_phxajGStl_b05qEzbxpr_RgkODtTU2sZdzVgX9lOFBZyAY&disp=emb&realattid=ii_ki5by8ks2

    -> The text file downloaded should have something like this inside:
    Item Purchase Code:
    b3e5fe72-00b0-4019-a8e2-06fb26264742

    Thank you for the help,


    2) Regarding your question:

    The scenario I am trying to recreate is to hide the store for all visitors, allow registered users to see the shop (I use an Easy Registration Forms to enable users), and when a user is finally logged in I want them not to see and prices or Add to Cart button. The last option to hide from logged in users the prices is done with a Pricing Rule but I dont see a way to hide the Add to cart and quantity also.


    I think you are referring to Variable Products.

    For Simple Products, it should look like this, no add to cart button or quantity input:

    8187295962.png

    For Variable Products, indeed, these are not hidden. Instead, the button is grayed out + if the user clicks add to cart it will not work.

    9002643493.png



    This is not directly controlled by our plugin. This is controlled partially by the theme. 


    I have a solution for you with a code snippet. Please add the following code snippet to functions.php (or to any snippets plugin):

    remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20 );
    

    This will remove the add to cart + quantity button.



    Kind Regards,

    Stefan


  • Orestis replied

    Thank you for your informative answer and the snippet.

    My purchase code is c60253c6-9ad2-4613-b647-1997e060db4e


  •  2,219
    WebWizards replied

    My pleasure. And thank you for providing the code. 

    If I can help with anything, let me know.


    Have a good day,

    Stefan