VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: autodafe on August 29, 2016, 17:29:06 PM

Title: Multi -Variant with date - show only future dates
Post by: autodafe on August 29, 2016, 17:29:06 PM
VM 3.0.16
Joomla 2.5.19
PHP 5.4

I have set up a multivariant (we sell courses) with City and Date as Option and it works perfectly

I was wondering if there could be any way to display only futire dates in the dropdowns and hide past courses.

I think it should be possible by modifying the file responsible for generating dropdowns...but where is it located? any hint?
Title: Re: Multi -Variant with date - show only future dates
Post by: GJC Web Design on August 29, 2016, 17:40:10 PM
haven't tried in a multivar but in a shopper field datepicker I overide in the template with something like this:


jQuery(document).on( "focus",".datepicker", function() {

if(this.id == 'vm_deliver_date_field_text'){ //add the id of the datepicker
jQuery( this ).datepicker({
firstDay: 1,
changeFirstDay: false,
minDate: +1,
changeMonth: true,
changeYear: true,
dateFormat:"yy-mm-dd",
defaultDate: +1
                  });
}
});



other variables can be set

you can strikethru old dates with

<style type="text/css">
   .ui-state-disabled .ui-state-default, .ui-widget-content .ui-state-disabled .ui-state-default, .ui-widget-header .ui-state-disabled .ui-state-default {
     background-image: none;
     opacity: 1;
     text-decoration: line-through;
   }
</style>
Title: Re: Multi -Variant with date - show only future dates
Post by: autodafe on August 30, 2016, 10:38:32 AM
thanks I'll try that!