Files
dojo/templates/proc/storep.html.ep
2020-01-15 23:42:58 -06:00

61 lines
2.0 KiB
Plaintext
Executable File

<!--<head>-->
<!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge" />-->
<!--</head>-->
%stash css=>["/home/storep/storep.css"];
<section class="item"> <section class="transp flex">
<article class=iimage>
<img class="small" src= "/home/store/img/<%= $imagen %>">
</article>
<article class=iinfo>
<p class="txt"><%= $subnombre %></p>
<p class="txt"><%= $descripcion %></p>
<p class="promo"><%= $promocion %></p>
<p class="precio">Precio:$<%= $precio %> pesos</p>
<p class="existencia">
<% if ($existencia > 10) { =%> <p class="eok"></p> <% } =%>
<% elsif ($existencia >= 1) { =%> <p class="elow">¡Nos quedan pocos!</p> <% } =%>
<% elsif ($existencia == 0) { =%> <p class="eldep">¡Agotado!</p> <% } =%>
<div class=ppl>
<div id="paypal-button-container"></div>
</div>
</article>
</section> </section>
<section class="ibottom">
<p class="nombre"><%= $objeto %></p>
<p class="tit"><%= $nombre %></p>
</section>
<section class="bdat"> </section>
<script src="https://www.paypal.com/sdk/js?client-id=AQdZ1JJL-GNBgGTI3W6cXChmj6MnZsInRGlWeHw1kbGiE_49eTtZ2fPvEq9ersU2y6O5WpxccdsyAQw7&currency=MXN"></script>
<script>
paypal.Buttons({
// Set up the transaction
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '0.18'
}
}]
}); },
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
return fetch('/tst', {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
orderID: data.orderID
})
})
// .then(response=>response.json())
// .then(data => {alert(data)})
});
}
}).render('#paypal-button-container');
</script>