Our Wordpress website is a Woocommerce ecommerce platform which sells products.
We have a Wishlist plugin which allows our customers to set up a list of products which they would like other people (friends, family etc) to purchase on their behalf.
To reward our customers for setting up a Wishlist, we have promised them a voucher for 20% of all orders placed through their Wishlist.
We need to create a new plugin which extends the functionality of our Wishlist plugin, so that we have the following features:
(1) The creation of an admin interface where we can view all of our customers Wishlists. The data is already stored in the database but we don’t have a way of viewing Wishlists.
(2) Automation of the voucher generation. 90 days after any order is placed through a Wishlist, a Woocommerce voucher is created and sent by email to the user who created the Wishlist (we wait 90 days to make sure that there were no issues with the order/ claims for refund by the person who purchased the item.
(3) When an order is placed through a Wishlist, the person placing the order is asked to tick a box which says ‘Send order to Wishlist owner’. The address of the Wishlist owner is not shown to the customer, to protect their identity. Our current Plugin achieves this by including in the Order Notes a note saying “Send Order to Wishlist Owner”. In the admin order interface, we can see the Wishlist owner’s address as a custom field, but only admin users can see this. It does not update the shipping address because if it did this, then the person who made the purchase would see the address of the Wishlist owners. However, this is a problem for us because presently our orders are sent via an API to our wholesaler, and this API only extracts the shipping address. This API also only extracts orders which have a status of ‘Order_Processing’. So, presently, we have no way of getting our wholesaler to send the order to the Wishlist owner and they will instead send it to the person who placed the order. Our proposed solution is to ensure that all new orders which are made through a Wishlist are given a status ‘Wishlist_Order_Processing’. We would then need to automatically duplicate the order in the database, but (i) change the whipping address of the duplicate order to the Wishlist owner’s address and (ii) Set the order status to ‘Order-Processing’. We need the make sure that only admin’s can view these duplicate orders, and also our wholesalers.
(4) We have to consider what would happen if someone placed an order from our site which contained both a Wishlist product (for a Wishlist owner) and another product for themselves. We would like to stop people checking out their cart if it contains both Wishlist items and non-Wishlist items. We could display an error message: “You cannot ship to two different addresses, and this order is set to be sent to a Wishlist owner.”