Date based price | WordPress.org

[ad_1]

Hello @lfedele

Yes, of course. That’s possible. But, you must sum the price per day. For example, assuming the from and to dates fields are the fieldname1 and fieldname2, respectively, you can implement the equation as follows:

(function(){
var _from = MIN(fieldname1, fieldname2),
_to = MAX(fieldname1, fieldname2);
_price = 0;

while(_from < _to){
if(MONTH(_from) < 4 ) _price += 100;
else _price += 120;

_from++;
}
return _price;
})()

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer