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

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] Can't execute Magic SEO URLs sitemaps
    I installed Magic SEO URLs Sitemaps Add-On for ZenCart MSU4.x/MSU5.x 2.0 on my server, when I try to generate sitemaps using: https://www.pechesudv155.owally.com/sitemaps.php I received :...
    by peter@pechesud.com
  • [phpBB3] Sharing users between phpBB / PrestaShop
    Hi i have 2 question 1- prestashop module support phpBB 3.3 ? 2- why we can not login in prestashop and phpbb with same user?
    by zohall
  • [phpBB3] AJAX Userinfo Extension
    Hi! I'm having trouble with this extension: https://www.phpbb.com/customise/db/exte ... _userinfo/ I tried asking support from the author but for no avail, since now. My request for support...
    by Lord Phobos
  • [phpBB3] Upgrade to phpBB 3.2.3
    Hello.. after Upgrade to phpBB 3.2.3 I am getting this message.. How can I solve this issue..? Thank you
    by ingbrzy
  • [phpBB3] URL path changed
    Hello.. I have changed my site path after moving to new hosting and now can not activate SEO module.. new path http://www.miuios.cz/domains/miuios.cz/ could you help me? thank you
    by ingbrzy2
Join our support forum » Pre-Sales Questions »
Featured Testimonials

AWESOME! Worked like a charm. I now understand why you used the word Magic in its name. Quick, easy, painless, gets the job done, and beautiful. Thanks a Million for creating this fantastic tool and for the quick excellent support.

Mohammad, the owner of TradersCity

Skeptical at first as I am with all new purchases that can dramatically effect traffic, but this one comes highly recommended. And not just for the product, the support is second to none and all issues are dealt with politely and efficiently. Top Marks!

Phillip, the owner of Sexy Ladies Fancy Dress Costumes

More Testimonials »