As part of the application process, you’ve been requested to complete the following challenge.
If you have any questions please respond to hire@launchandsell.com.
Task Overview
Task: Develop a Custom WordPress Plugin
Objective: WooCommerce Subscriptions Delivery Date Feature
Create a simple plugin that adds a “Delivery Date” field to both simple and variable subscription products. This field will allow admins to set a recurring delivery date (e.g., the 3rd day of every week or 1st day of every month). The next 3 recurring dates should be displayed on the product page in a drop-down menu. The selected date should be displayed and editable in the cart page.
You can find the WooCommerce Subscriptions plugin here: DOWNLOAD
Requirements
- Add Delivery Date Field:
- Add a new field called “Delivery Date” in the product editor for simple subscription products and each variation of variable subscription products.
- The field should allow admins/shop managers to choose a recurring period (e.g., every 3rd day of every week, or every 1st day of every month, or 6th day of every month). These are only examples, it needs to be a flexible robust field.
- Display Recurring Dates:
- Calculate and display the next three recurring dates in a drop-down field on the product page.
- Cart:
- Display the selected delivery date in the cart.
- Allow customers to change the delivery date in the cart page and select from the same three dates previously calculated.
- Bonus feature – Checkout (optional):
- Display the selected delivery date in the checkout page.
- Allow customers to change the delivery date in the checkout page and select from the same three dates previously calculated.
Instructions
- Backend Development:
- Use PHP to add the new field to the WooCommerce Subscription product editor
- Ensure the new field is saved upon product update.
- Write the function to calculate the dates based on the set recurring period.
- Ensure the selected date on the product page is passed to the cart
- Frontend Development:
- Use PHP and JavaScript/jQuery to display the recurring dates on the product page.
- Use PHP and JavaScript/jQuery to ensure the selected date is editable in the cart page.
Additional Guidelines:
- Ensure to properly escape, sanitize, and validate data in each step as appropriate using built in PHP and WordPress functions.
- Ensure all user facing strings/text are translatable.
- The code you submit should not be built with/by/from nor use boilerplate templates/libraries/code.
- Use modern PHP approaches/architecture (example: OOP, autoloading, PSR4, Composer, etc).
- Your submission should be a fully functional WordPress plugin meeting the requirements listed above.
- Do not rush! Your code will be used to gauge your abilities and your attention to detail (one of our core values).