|
@@ -3816,34 +3816,40 @@ function validate_captcha(form)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function updateProductTotalMessage(billingcycle) {
|
|
function updateProductTotalMessage(billingcycle) {
|
|
|
|
|
+ console.log(billingcycle);
|
|
|
var now = new Date();
|
|
var now = new Date();
|
|
|
var orderDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
|
|
var orderDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
|
|
|
switch(billingcycle) {
|
|
switch(billingcycle) {
|
|
|
case 'monthly':
|
|
case 'monthly':
|
|
|
- console.log(billingcycle);
|
|
|
|
|
billingDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth() + 1, 0));
|
|
billingDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth() + 1, 0));
|
|
|
- console.log(billingDay - orderDay);
|
|
|
|
|
jQuery('#producttotalmessage').html('Monatlich');
|
|
jQuery('#producttotalmessage').html('Monatlich');
|
|
|
break;
|
|
break;
|
|
|
case 'quarterly':
|
|
case 'quarterly':
|
|
|
- console.log(billingcycle);
|
|
|
|
|
- if (now.getMonth() < 4) {
|
|
|
|
|
- billingDay = daysIntoYear(new Date(now.getFullYear(), 2, 31));
|
|
|
|
|
- console.log(billingDay - orderDay);
|
|
|
|
|
|
|
+ if (now.getMonth() < 3) {
|
|
|
|
|
+ billingDay = daysIntoYear(new Date(now.getFullYear(), 2, 31)); // 31.3.
|
|
|
|
|
+ } else if (now.getMonth() < 6) {
|
|
|
|
|
+ billingDay = daysIntoYear(new Date(now.getFullYear(), 5, 30)); // 30.6.
|
|
|
|
|
+ } else if (now.getMonth() < 9) {
|
|
|
|
|
+ billingDay = daysIntoYear(new Date(now.getFullYear(), 8, 30)); // 30.9.
|
|
|
|
|
+ } else {
|
|
|
|
|
+ billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31)); // 31.12.
|
|
|
}
|
|
}
|
|
|
jQuery('#producttotalmessage').html('4teljährlich');
|
|
jQuery('#producttotalmessage').html('4teljährlich');
|
|
|
break;
|
|
break;
|
|
|
case 'semiannually':
|
|
case 'semiannually':
|
|
|
- console.log(billingcycle);
|
|
|
|
|
|
|
+ if (now.getMonth() < 6) {
|
|
|
|
|
+ billingDay = daysIntoYear(new Date(now.getFullYear(), 5, 30)); // 30.6.
|
|
|
|
|
+ } else {
|
|
|
|
|
+ billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31)); // 31.12.
|
|
|
|
|
+ }
|
|
|
jQuery('#producttotalmessage').html('Halbjährlich');
|
|
jQuery('#producttotalmessage').html('Halbjährlich');
|
|
|
break;
|
|
break;
|
|
|
case 'annually':
|
|
case 'annually':
|
|
|
- console.log(billingcycle);
|
|
|
|
|
billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31));
|
|
billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31));
|
|
|
- console.log(billingDay - orderDay);
|
|
|
|
|
jQuery('#producttotalmessage').html('Jährlich');
|
|
jQuery('#producttotalmessage').html('Jährlich');
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(billingDay - orderDay);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function daysIntoYear(date){
|
|
function daysIntoYear(date){
|