I have many products nested within parent categories in WooCommerce. I want to be able to apply a custom field where I can specify a time availability for categories as a admin feature only in Back end.
Theory:
time frame
: for example 11:00-17:00
.time frame
, users will be able to browse all the products within that category.time frame
all the products within that category will stay visible (but inactive) and they will be displayed greyed out or with a 'closed'
banner (something like that).Where can I start with this?
THE BEGINNING
You can start adding 2 plugins to add a custom time picker on product categories admin pages:
This is just he beginning (and I can't confirm that is the best way). So In ACF you create a group and you name it:
Then you set the location (It's going to be a "taxonomy term" for "Product categories"):
Then In options you can chose it like a Metabox on the side (on backend):
After you add a new field and name it. You chose the field type and time only option:
Then now you are going to compile all the other options to fit your needs. Then you can save and add, if you need a 2nd field…
Now if you go to the WooCommerce Products Menu, under categories submenu, you will get this:
Now you can read a little the ACF documentation and also the wooThemes/woocommerce dev. documentation too.
You can customize WooCommerce overriding the templates and use hook filter and actions.
You will find in here on Stack OverFlow and over internet a lot of code, examples and tutorials, to begin and try to achieve your project. When needed you will post questions to get helped, with the code you are using telling what is working and what not…