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
  • [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
  • [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
Join our support forum » Pre-Sales Questions »
Featured Testimonials

AWESOME! One of the best support service i ever had online! I purchased the PrestaShop Theme Provider and Inveo team was so supportive and helpful to install the module! The module is working super well and gives a professional looking to my blog right now! Thank you so much!

Florence, the owner of Timeless luxury - Florenz

Magic SEO URLs for ZenCart were an excellent investment for our medium-sized business, and the support team revised the software to get our non-standard Zen Cart working. It does everything we need it to, and overall I have been thrilled with Magic SEO URLs. I mean every word of that. Thanks again.

Dimitri, the owner of Headphones - Headsonic Australia

More Testimonials »