Editing Shop page WooCommerce
-
Hello,
I’m using Astra as a child theme and also WooCommerce plugin.
When I access to the Shop page, I want to check if the user is logged in and the role is “Example”. If conditions are true, I want to filter the products before loading the page and only show the article with an attribute with the “User” = “Example”.
How can I modify it? I think that the easy way is to use a custom plugin or functions.php file. In the second option, if I need other changes, I could create a specific file and load it in the funtions.php and use this file to group all the changes in one specific file, like a “page-shop.php”.
I don’t know how I can modify it.. using hooks or if It’s a good way to copy the template and editing… I think that the 2nd way is not the best one… Which one do you recommend? If there is another better way, I really appreciate it if you could explain it.
If I wanted to modify a lot more things on the page, should I overwrite the template? I’m a bit worried about doing that because I think that if there is something new in new versions (kind of security topics) I won’t have them, is that correct?
So, I have two questions. I don’t know the best way to execute it and also, the code to check the user and filter the products.
Thanks you so much!
- The topic ‘Editing Shop page WooCommerce’ is closed to new replies.