| Server IP : 13.126.101.145 / Your IP : 216.73.217.50 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-11-115-0-196 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.3.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/rentals_updated/wp-content/themes/hello-elementor-child/custom/ |
Upload File : |
<?php
global $post;
$id = $post->ID;
$url = get_bloginfo('url').'/wp-content/themes/hello-elementor-child/custom/quotes.php?file=invoice&product_id='.$id;
?>
<a class="button demo_button buy_now_button download_btn" href="javascript:void(0)" onclick="downloadquote()"><i class="fa fa-download" aria-hidden="true"></i> Standard Quote </a>
<script>
function downloadquote(){
// Creating element to download pdf
var element = document.createElement('a');
var quantity = document.getElementsByClassName("qty")[0];
var qty = quantity.value;
var duration = document.getElementsByClassName('wcrp-rental-products-total-days')[0];
var dur_days = duration.innerText;
var days = dur_days.replace(/days/g,'');
if(days == ''){
alert("Please Select Rental Dates");
return false;
}
// Setting the path to the pdf file
element.href = '<?php echo $url;?>'+'&quantity='+qty+'&duration='+days;
// Name to display as download
//element.download = 'GFG.pdf';
element.target = '_blank';
// Adding element to the body
document.documentElement.appendChild(element);
// Above code is equivalent to
// <a href="path to file" download="download name"/>
// Trigger the file download
element.click();
}
</script>