{source}
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1, shrink-to-fit=no”>
<meta name=”description” content=””>
<meta name=”author” content=””>
<!–link rel=”icon” href=”../../../../favicon.ico”–>
<title>Ricerca Partita IVA</title>
<link rel=”canonical” href=”https://getbootstrap.com/docs/4.0/examples/pricing/”>
<!– Bootstrap core CSS –>
<link href=”/templates/ts_news247/css/bootstrap.min.css” rel=”stylesheet”>
<!– Custom styles for this template –>
<link href=”/templates/ts_news247/css/custom.css” rel=”stylesheet”>
</head>
<body>
<div class=”d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow”>
<!–h5 class=”my-0 mr-md-auto font-weight-normal”>Company name</h5>
<nav class=”my-2 my-md-0 mr-md-3″>
<a class=”p-2 text-dark” href=”#”>Features</a>
<a class=”p-2 text-dark” href=”#”>Enterprise</a>
<a class=”p-2 text-dark” href=”#”>Support</a>
<a class=”p-2 text-dark” href=”#”>Pricing</a>
</nav>
<a class=”btn btn-outline-primary” href=”#”>Sign up</a–>
</div>
<div class=”pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center”>
<h1 class=”display-4″>Apri adesso la tua partita IVA</h1>
<p class=”lead”>Cerca adesso la tua professione preferita ed inizia immediatamente il tuo business!</p>
<p><input id=”ebooks” class=”form-control form-control-lg” type=”text” placeholder=”Inserisci qui la tua professione”></p>
</div>
<div class=”d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom box-shadow”>
<h5 class=”my-0 mr-md-auto font-weight-normal” id=”titleEbookSection”>Ultimi ebook inseriti</h5>
</div>
<div class=”container”>
<div class=”card-deck mb-3 text-center”>
<div class=”card mb-4 box-shadow”>
<div class=”card-header”>
<h5 class=”my-0 font-weight-normal” id=”title0″></h5>
</div>
<div class=”card-body”>
<!– h1 class=”card-title pricing-card-title” id=”price0″></h1–>
<div id=”product-image0″ class=”product-image”></div>
<button type=”button” class=”btn btn-lg btn-block btn-outline-primary” id=”buyEbook0″>Acquistami per <span id=price0></span></button>
</div>
</div>
<div class=”card mb-4 box-shadow”>
<div class=”card-header”>
<h5 class=”my-0 font-weight-normal” id=”title1″></h5>
</div>
<div class=”card-body”>
<div id=”product-image1″ class=”product-image”></div>
<button type=”button” class=”btn btn-lg btn-block btn-primary” id=”buyEbook1″>Acquistami per <span id=price1></span></button>
</div>
</div>
<div class=”card mb-4 box-shadow”>
<div class=”card-header”>
<h5 class=”my-0 font-weight-normal” id=”title3″></h5>
</div>
<div class=”card-body”>
<!– h1 class=”card-title pricing-card-title”>$29 <small class=”text-muted”>/ mo</small></h1–>
<div id=”product-image3″ class=”product-image”></div>
<button type=”button” class=”btn btn-lg btn-block btn-primary” id=”buyEbook3″>Acquistami per <span id=price3></span></button>
</div>
</div>
</div>
<footer class=”pt-4 my-md-5 pt-md-5 border-top”>
<div class=”row”>
<div class=”col-12 col-md”>
<img class=”mb-2″ src=”https://getbootstrap.com/docs/4.0/assets/brand/bootstrap-solid.svg” alt=”” width=”24″ height=”24″>
<small class=”d-block mb-3 text-muted”>© 2017-2018</small>
</div>
<div class=”col-6 col-md”>
<h5>Features</h5>
<ul class=”list-unstyled text-small”>
<li><a class=”text-muted” href=”#”>Cool stuff</a></li>
<li><a class=”text-muted” href=”#”>Random feature</a></li>
<li><a class=”text-muted” href=”#”>Team feature</a></li>
<li><a class=”text-muted” href=”#”>Stuff for developers</a></li>
<li><a class=”text-muted” href=”#”>Another one</a></li>
<li><a class=”text-muted” href=”#”>Last time</a></li>
</ul>
</div>
<div class=”col-6 col-md”>
<h5>Resources</h5>
<ul class=”list-unstyled text-small”>
<li><a class=”text-muted” href=”#”>Resource</a></li>
<li><a class=”text-muted” href=”#”>Resource name</a></li>
<li><a class=”text-muted” href=”#”>Another resource</a></li>
<li><a class=”text-muted” href=”#”>Final resource</a></li>
</ul>
</div>
<div class=”col-6 col-md”>
<h5>About</h5>
<ul class=”list-unstyled text-small”>
<li><a class=”text-muted” href=”#”>Team</a></li>
<li><a class=”text-muted” href=”#”>Locations</a></li>
<li><a class=”text-muted” href=”#”>Privacy</a></li>
<li><a class=”text-muted” href=”#”>Terms</a></li>
</ul>
</div>
</div>
</footer>
</div>
<!– Bootstrap core JavaScript
================================================== –>
<!– Placed at the end of the document so the pages load faster –>
<script src=”https://code.jquery.com/jquery-3.3.1.min.js” integrity=”sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=” crossorigin=”anonymous”></script>
<script src=”https://code.jquery.com/ui/1.12.1/jquery-ui.js”></script>
<script>
jQuery( function() {
function log( message ) {
jQuery( “<div>” ).text( message ).prependTo( “#log” );
jQuery( “#log” ).scrollTop( 0 );
}
});
jQuery(“#ebooks”).autocomplete({
source: function(request, response){
jQuery.ajax( {
url: “/templates/ts_news247/json/professions.json”,
dataType: “json”,
data: {
term: request.term
},
success: function( data ) {
console.log(data);
var array = jQuery.map(data, function (item) {
return {
id: item.id,
label: item.name,
value: item.name,
slug: item.slug,
permalink: item.permalink,
price: item.price,
description: item.description,
image: item.images[0].src
};
});
//call the filter here
//response(jQuery.ui.autocomplete.filter(array, request.term));
var matcher = new RegExp( jQuery.ui.autocomplete.escapeRegex( request.term ), “i” );
response(jQuery.grep(array, function(item) {
console.log(item.value);
console.log(item.slug);
console.log(item.permalink);
console.log(item.image);
//console.log(matcher.test(item.value));
return matcher.test(item.value) || matcher.test(item.slug) || matcher.test(item.permalink)||matcher.test(item.description);
}));
}//chiude success
});//chiude ajax
},
select: function( event, ui ) {
console.log( “Selected: ” + ui.item.value + ” aka ” + ui.item.id );
jQuery(“#titleEbookSection”).text(‘Risultati Ricerca’);
resetEbookSearch();
createEbookCard(ui.item.value,ui.item.image,ui.item.price,ui.item.permalink,ui.item.description);
}//chiude source
});
//chiude autocomplete
function resetEbookSearch(){
jQuery(“div.container”).empty();
}
function createEbookCard(title,linkImage,price,linkProduct,description){
var title = title;
var image = linkImage;
var linkProduct = linkProduct;
var price = price;
var description = description;
var htmlToAppend = “<div class=’card-deck mb-3 text-center’>”;
htmlToAppend += “<div class=’card mb-4 box-shadow’>”;
htmlToAppend += “<div class=’card-header’>”;
htmlToAppend += “<h5 class=’my-0 font-weight-normal’ style=’font-size: xx-large;”>”+title+”</h5>”;
htmlToAppend += “</div>”;
htmlToAppend += “<div class=’card-body-1p’>”;
htmlToAppend += “<div class=’product-image-1p’><a href='”+linkProduct+”‘><img src='”+image+”‘ width=’250′ height=’270’ /></div>”;
htmlToAppend += “<div class=’product-description’>”+description+”</div>”;
htmlToAppend += “<button type=’button’ class=’btn btn-lg btn-block btn-outline-primary’>Acquistami per € “+price+”</button>”;
htmlToAppend += “</div></div></div>”;
jQuery( “.container” ).append( htmlToAppend );
}
jQuery(document).ready(function() {
jQuery.ajax({
url: “https://www.lesson1.it/wp-json/wc/v3/products?per_page=6&consumer_key=ck_3411f322e928a3f1749c0c881208e33ae8efd24d&consumer_secret=cs_3dc2d558f30e0e4ef81ec916218ab851eba1f160”
}).then(function(data) {
//$(‘.img1’).append(data.src);
console.log(data);
console.log(data.length);
for (var i = 0; i < 6; i++) {
//alert(data[i].name)
var priceId = “#price”+i;
var titleId = “#title”+i;
var price = data[i].price;
var title = data[i].name;
var productImageId = “#product-image”+i;
var buttonId = “#buyEbook”+i;
console.log(productImageId);
var productImageSrc = data[i].images[0].src;
console.log(productImageSrc);
var link = data[i].permalink;
jQuery(productImageId).html(‘<a href=”‘+link+'”><img src=”‘+productImageSrc+'” width=”166″ height=”230″></a>’);
jQuery(priceId).html(“€ “+price);
jQuery(titleId).html(title);
jQuery(buttonId).attr(“onclick”,”window.location.href='”+link+”‘;”);
}
//$(‘.greeting-content’).append(data.content);
});
});
</script>
<!–script>window.jQuery || document.write(‘<script src=”../../assets/js/vendor/jquery-slim.min.js”><\/script>’)</script>
<script src=”../../assets/js/vendor/popper.min.js”></script>
<script src=”../../dist/js/bootstrap.min.js”></script>
<script src=”../../assets/js/vendor/holder.min.js”></script>
<script>
Holder.addTheme(‘thumb’, {
bg: ‘#55595c’,
fg: ‘#eceeef’,
text: ‘Thumbnail’
});
</script–>
</body>
</html>
{/source}