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
  • [phpBB3] How to disable Magic SEO URL for phpBB?
    Hello ! permanently disable Magic SEO URL for phpBB v3.0 / 3.1 5.0 is it possible ? please Could you explain to me ? Delete directory www/cache-msu/ and all files ? Delete directory...
    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
  • [phpBB] Magic SEO URLs and phpBB 3.1.6
    Hi, I uploaded the files on my dev server for test before install on the live forum. But in STEP 6 nothing happened - http://dev.flowersnet.info/?inveoActivation . In other steps happened...
    by emil.kozhuharov
  • [Swift Mailer] Swift Mailer lib files missing
    Hi I got the Swift mailer and tried to install it but ended up withnmissing files. I cant find them at github, the provided link is not valid. Please advice. I have a screenshot but it seems it...
    by Vegaanders
Join our support forum » Pre-Sales Questions »
Featured Testimonials

Magic SEO URLs for PrestaShop is amazing product, it help me a lot with SEO, and the customer service is very nice and patient! I will built a new website, and I will buy this module again.

Joseph, the owner of Focus Vows

We have a fully customizable website based in osCommerce, we work with it since our start in 2005. When we want to expand our business to other countries near Spain, we know that we would have several problems with SEO and Google. We found Magic SEO URLs luckily and in fact Magic SEO URLs provide us a complete solution to solve our...

Ruben, the owner of MASmuscolo

More Testimonials »