We finished up a very interesting project the other day. The client basically required a way to link dates to individual products, thereby allowing his customers to select a date as an attribute.
Really very easy, if you think about it. Just add the dates as options then apply to each product as required. Then the customer will see a dropdown box in the product_info page. Easy as 123.
But what if the shop owner wants a better experience, both in the admin side and in the shop side?
An example would be adding a date range – imagine you wanted to add the whole of August – you’d need to insert 31 product attributes (the dates in August 1st to 31st) then add these one by one to the product you want to add them to. What a nightmare. Instead, why not have the ability to select a date range, press insert and all this is done automatically in the background. With a bit of thought, it’s do-able.
Step 1 was to change the product_attribute page in admin to allow the ability to add a date (or dates) to a product.
In the example, I am adding the the whole of August to the product called “Lethal Weapon” (which is a standard product in the base install of osCommerce). This functionality is achieved using Kelvin Lucks datepicker project.
if we now look at the product page, the dates of August now are available as an attribute dropdown;
But, that is very ugly and not all nice for the customer to select his chosen date…so, changes needed;
Step 2 was to make the attribute dropdown into a text box, which when clicked will popup the datepicker allowing the buyer to select a date.
If this is clicked, up pops the datepicker;
showing the selectable dates (in green, using .css). If I select the 14th August, then this shows in the input box;
The customer can now add to cart and checkout as normal;
If you need something similar, contact me via email.