Closed (fixed)
Project:
Commerce delivery times
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2014 at 13:37 UTC
Updated:
27 Jan 2014 at 15:10 UTC
Jump to comment: Most recent
The hook_commerce_delivery_timeslot_alter() will be called for each timeslot before it is rendered.
You can also use hook_commerce_delivery_times_alter() that is called only once with the entire array is loaded.
Example of making the 1'st of Jan unavailable and changing the label to "closed::
<?php
/**
* Implements hook_commerce_delivery_timeslot_alter().
*/
function bulkaco_commerce_delivery_timeslot_alter($key1, &$timeslot, &$title) {
$d = date("Y") . '-01-01';
if ($key1 == $d) {
$title = t('Closed');
$timeslot['deliveries'] = 0;
}
}
?>
Comments
Comment #1
guy_schneerson commentedcommitted http://drupalcode.org/sandbox/guy_schneerson/2152365.git/commit/71696d2