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
  • [Zen Cart] How to exclude words from URLs
    I'd like to know if it's possible to configure some stop words (in italian language) to remove from SEO URL. Thanks
    by incircolo
  • [PrestaShop] Setting-up CDN
    Hi, the url that generates is this: Code: <link href="//static1.peplogar.com/modules/psaccelerator/cache/961263a2bac53db414c080690bc69cfd.css" rel="stylesheet"...
    by PepLogar
  • [PrestaShop] Theme Provider + jQuery
    Hello, I use your module with many websites, I have only one issue : As soon as I activate the option to put the javascript in the footer in Prestashop every jQuery widget or plugin used in the...
    by Akrolab
  • [phpBB] Issue with Activation
    Hi, I just bought the SEO Magic Url Plugin for phpbb 3.2 I am having issue with activation. I have the php 7 install in my site/server. Read me file says its 5.6 , do i need the 5.6 or it...
    by pornera
  • [phpBB] Issue with Tapatalk
    After Installation of Magic SEO URLs for phpBB v3.0/3.1/3.2 5.1 we have an issue with viewing some random threads in Tapatalk app which shows this issue My config: PHP 5.4 PhpBB 3.0.12...
    by ingbrzy
Join our support forum » Pre-Sales Questions »
Featured Testimonials

Wow, thank you there is a huge difference from where it was.

Henri, the owner of TorchSA

We installed the WordPress Accelerator plugin and it's great! With 2 other plugins the website is blazing fast!!

Milko, the owner of Boxershorts Heren

More Testimonials »