Skip Navigation

[Resolved] How to convert a date type CF into 3 different CF / taxo (year, month, day)

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 1 voice.

Last updated by catherineB 1 day, 13 hours ago.

Assisted by: Minesh.

Author
Posts
#2794008

I’m trying to build a multi-vendor bilingual webiste, using different subscription level to limit number of products a vendor can have, whose product are reservations (Service X Monday 13 feb 11a.m.). Also, the website will be a One product / multi-vendor type, as the vendors will have to choose among a specific list of products.

If the vendor enters a date in a date type CF, is it possible to automatically auto-populate other custom fields as per say date-year, date-month, date-day while “extracting” data from the date CF?

Can a date type CF be dealt as a text field and so we pick up the “4 first digts” as the Year, or we need to access the configuration YY/MM/DD?

And could this be done if the case of date-year, date-month, date-day were taxonomies instead of custom fields?

Thanks,

Catherine 🙂
N.B. I have many questions that I’ve separated in different posts to make it easier to answer 🙂

What is the link to your site?
Still on planning mode, so no dev link yet.

#2794160

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You will require - three different taxonomy one for each Year, Month and Days and Hours if you require and add it terms accordingly to these taxonomies.

For instance:

- Years ( will include terms like 2022, 2023, and so on )
- Months ( will include terms like Jan, Feb, Mar, and so on )
- Day ( will include terms like 01 to 31st )
- Day Name ( will include terms like Sat, Sun, Mon, and so on )
- Hours ( will include terms like 01:00 - 02:00, 02:00 - 03:00, 03:00 - 04:00, and so )

You can check the following related ticket for the same:
- https://toolset.com/forums/topic/booking-appointment-plugin-for-woocommerce/#post-2498025

#2794265

Hi Minesh, thanks for the answer 🙂

I've read the tread you shared. But my question is, that within a product submission, can I set up hiden rules that auto-link the corresponding Year / Month / Day taxonomies regarding the date the vendor entered, (no time needed), or the vendor needs to manually add theses taxonomies?

Thanks

Catherine

#2794370

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Do you have product submissiuon form using Toolset post form?

If you have a custom date field on the post add/edit form - then yes based on the date value available with the custom date field we can extract the year/month/day and based on that value we can assign those terms to Year/Month/Days taxonomy.

If we have real world example setup I can better guide you but as you are just still on planning stage its really hard to tell what you can able to do and what not.

#2794514

Ok, perfect, thanks.
I though of creating a Toolset new product form allowing the vendor to create a new product for each availability and link it to the "real" Product taxonomy, but then, I realized that would prevent me to limit the number of products with the subscription because with only 1 "product" with 3 availabilities, the vendor would reaches it's maximum. So I'm not sure this will be the plan, but it's good to know that it can be done 🙂

Happy Tuesday,

Catherine