JS – Create an array with years

Call the function passing a starting Year and it will return an array containing all years from the starting year to the current  // //build a list of years function getYearsList(fromYear) { var arrYears = []; var oDate = new Date(); //add next year in the list if in...

JS – strip parameters from URL

Get the parameter contained in the page Url. Call the function passing the parameter name as: getUrlParameter(« UserName ») // strip parameters from URL function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables =...

JS – Calculate dates difference

Call the function passing 2 dates and it returns the difference in days // function diffdate(d1,d2){ var WNbJours = d2.getTime() – d1.getTime(); return Math.ceil(WNbJours/(1000*60*60*24));...

Get the top level category

Used to get the most top level category of the current product categories.   The following code must be inserted in the function.php contained in your child theme (**). Since the action target is ‘wp_head’, all Echo content will be printed in the...