Post by lahoregifts » Sun Jun 15, 2025 10:28 pm

Options Appear on product page. I have Delivery Date. On Calendar i want to customer should not be able to select previous dates. can i control current date with cut off time.
Is there any solution other than extension. Version 4.1.0.0

Newbie

Posts

Joined
Sun Feb 09, 2025 3:44 am

Post by by mona » Sun Jun 15, 2025 10:58 pm

Untested but you could try adding this to your catalog/view/theme/default/template/product/product.twig file. Before {{ footer }}
Double check that it has no datepicker function already, it will be somewhere at the end of the file. It used to be in the product file.

Code: Select all

<script>
   $(document).ready(function () {
        $('#datepicker').datepicker({
            startDate: new Date()
        });
    });
    </script>
A quick google search gave another solution you could try

Code: Select all

<script>
$(document).ready(function () {
$('#datetimepicker').datetimepicker({  
 minDate:new Date(),
 disabledDates: [new Date()]
});
  });
    </script>

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: No registered users and 1 guest