PrestaShop: Adding a datepicker to Invoices and Delivery slips

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!

Leave a Reply

Your email address will not be published. Required fields are marked *

Cart  
(empty)

Cart Check out  »

Prices are tax inclusive.

The VAT rate for your country (US) * is 0,0 % because it is not a member of the European Union (EU).

* Please create an account if your country does not match.

Community feed
  • [WordPress] Accelerator issue
    I have installed the plugin, but when activated, the website goes down and appears this message : Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in...
    by flynet
  • [PrestaShop] Theme Provider FREE 1.4
    where I can download this plugin for testing mode before I byu it? thank you. DB
    by daryl0
  • [phpBB3] How to disable Magic SEO URL for phpBB?
    Moderator note: A new update of the Magic SEO URLs for phpBB 3.0/3.1/3.2 has been released. It comes with the phpBB 3.0/3.1/3.2 support as well as PHP 7.0 support. Hello ! I want to...
    by Binano
  • [Zen Cart] How to add .html to urls
    How do I get .html added to the product url? I could not find any mention in the documentation.
    by jekingwws
  • [Zen Cart] .htaccess file will not generate
    I have version 6 installed on a development server for a client. Installation went smoothly, no issues or errors. Files all uploaded in binary. Yet the htaccess file will not generate....
    by jekingwws
Join our support forum » Pre-Sales Questions »
Featured Testimonials

I installed the WordPress Accelerator plugin! Great result! I'm really satisfied!

Benoit, the owner of World Else

Just wanted to let you know that I got it working :-) It's an awesome product you've got there!

Justin, the owner of Fokvereniging VWF

More Testimonials »