Your question is a little vague. Would you like the customer to select a delivery date that THEY would prefer or are the ADMIN to be able to indicate a delivery date that the customer can expect to receive his/her order.
I'm assuming the latter:
You can set up a custom attribute via:
Catalog->Attributes->Manage Attributes
- Click Create New Attribute on the top right hand side of the page
- Set up the attribute as Date under Catalogue Input Type for Shop Owner
- Visible on Product View Page on Front-end should be set to Yes
- Used in Product Listing should be set to Yes
- Give it an appropriate label under Label Options
Obviously managing this attribute over your whole catalogue isn't really going to be a viable option, and as such it would be wiser to set up a Cron Job which runs daily to populate the date fields.
Your cron job script should look something like (note that the $mageFilename should be the directory path to your Mage.php file under the app directory)
<?php
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
umask(0);
Mage::app('admin');
Mage::register('isSecureArea', 1);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$date = Mage::getModel('core/date')->timestamp(time());
$date = date('Y/m/d H:i:s', strtotime($date . ' + x days')); //x should be the numeric value of how many days from now delivery would be possible
$connection = _getConnection('core_read');
$sql = 'SELECT * FROM catalog_product_entity';
$products = $connection->fetchAll($sql);
$connection = _getConnection('core_write');
foreach ($products as $product){
$sql = 'UPDATE catalog_product_entity_date SET value = ? WHERE attribute_id = ? AND entity_id = ?';
$connection->query($sql, array($date, your_attribute_id, $product['entity_id']));
}
function _getConnection($type = 'core_read'){
return Mage::getSingleton('core/resource')->getConnection($type);
}
?>
You can figure out what your_attribute_id is after saving the attribute and looking at the URL on the page, it'll be something like:
catalog_product_attribute/edit/attribute_id/599/key/
In the above EXAMPLE the attribute_id is 599, you must find out what YOUR attribute ID is.
The reason you should use SQL like this to perform the task as opposed to ORM is because using ORM across your whole catalog selection will probably be quite time & resource intensive, this script on the other hand will function very efficiently.
You'll need to make this attribute visible on your product template page as well. (https://stackoverflow.com/questions/3110076/magento-echo-attribute-on-product-page)
You'll also want to edit your default templates to reflect this value on the order confirmation/delivery & invoice email template (http://www.magentocommerce.com/boards/viewthread/15411/)
Good luck.
Yes, quite simple: Create your gifts as virtual products. If the cart contains only virtual or downloadable items, you will not have to enter any shipping address at checkout.
NOTE: Using virtual products will skip the shipping address during checkout. It will also skip the shipping method, and the associated shipping cost. Removing the shipping address step for normal simple products (without affecting the shipping method or cost) would be much, much more complicated.
Creating a virtual product
You can create a virtual product by going to Admin > Products > Catalog
, clicking the arrow on the 'Add Product' button, and clicking 'Virtual Product'.
You can also change an existing simple product to virtual by editing it and finding the 'Weight' attribute under General settings. Change 'Does this have a weight?' from Yes to No.
Best Answer
I think you need something like book your table.
I guess this can be done via attribute:
You can create around 10 options under Booking attribute.
Then based on the current time of server/system whatever suits you best, you can display the attributes.
Say you found via code current time = 3 , then you will need to add the condition that the drop down wil be shown from 5-7 pm-today, 7-9pm-today and so on..
I mean this logic can be used. Will need to write the code accordingly