Author Topic: Date field not working for shopper field  (Read 2552 times)

palandre

  • Beginner
  • *
  • Posts: 7
Date field not working for shopper field
« on: March 25, 2018, 13:12:02 PM »
Hi mates,

I've added a new field "Data di nascita" for shoppers, with type "date". It appears when the user wants to register, but not with date picker, but with a simple text-area, even if in the firebug I can see the class datepicker.

The link is here:
http://shop.gallerialamongolfiera.it/shop/user/editaddresscartBT

Do you have any idea for this?

I use Joomla 3.8.6 and VM 3.2.13

Thanks a lot in advance,
Andrea

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4728
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Date field not working for shopper field
« Reply #1 on: March 26, 2018, 03:38:35 AM »
You have perhaps disabled datepicker file loading, because all code is here but datepicker or jquery.ui  is missing

palandre

  • Beginner
  • *
  • Posts: 7
Re: Date field not working for shopper field
« Reply #2 on: April 04, 2018, 21:49:07 PM »
Hi Studio 42,
Thanks for your feedback!

I was actually able to show the datepicker by checking "Use Virtuemart jQuery libraries". But I can see only future dates.

Can you suggest me where to setup datepicker inside Virtuemart jQuery?

Thanks again and regards,
Andrea

palandre

  • Beginner
  • *
  • Posts: 7
Re: Date field not working for shopper field
« Reply #3 on: April 04, 2018, 22:35:28 PM »
Found:

administrator/components/com_virtuemart/helpers/vmjsapi.php

Before:
self::addJScript('datepicker','
      jQuery(document).ready( function($) {
         $(document).on( "focus",".datepicker", function() {
            $( this ).datepicker({
               changeMonth: true,
               changeYear: true,
               '.$yearRange.'
               '.$minMax.'
               dateFormat:"'.$jsDateFormat.'",
               altField: $(this).prev(),
               altFormat: "yy-mm-dd"
            });


add:
$yearRange = 'yearRange: "1918:2018",';
$minMax = 'minDate: "-100Y", maxDate: "+1Y",';

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10663
  • VM4.0.232 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 4 on joomla 3
Re: Date field not working for shopper field
« Reply #4 on: April 06, 2018, 13:39:00 PM »
Please check the new version, I did changes there.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/