How to add a datepicker to Invoices and Delivery slips in a few simple steps.
Note: This howto applies only to PrestaShop 1.3.
Open admin/tabs/DeliverySlips.php
file.
Find:
public function displayForm($isMainTab = true) { global $currentIndex; parent::displayForm();
Replace with:
public function displayForm($isMainTab = true) { global $currentIndex; parent::displayForm(); includeDatepicker(array('date_from', 'date_to'));
Find:
<input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Replace with:
<input type="text" size="4" maxlength="10" id="date_from" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Find:
<input type="text" size="4" maxlength="10" name="date_to" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Replace with:
<input type="text" size="4" maxlength="10" id="date_to" name="date_to" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Open admin/tabs/AdminInvoices.php
file.
Find:
public function displayForm($isMainTab = true) { global $currentIndex; parent::displayForm();
Replace with:
public function displayForm($isMainTab = true) { global $currentIndex; parent::displayForm(); includeDatepicker(array('date_from', 'date_to'));
Find:
<input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Replace with:
<input type="text" size="4" maxlength="10" id="date_from" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Find:
<input type="text" size="4" maxlength="10" name="date_to" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Replace with:
<input type="text" size="4" maxlength="10" id="date_to" name="date_to" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
Save and close all files and it’s done!