Answer the question
In order to leave comments, you need to log in
How to save invoice in pdf format?
I need to make it so that in the sale.order.ajax module where the invoice is displayed, so that when the link is generated, a pdf invoice of this receipt is generated. That is, the received data contains the received html layout.
Just a previous developer or a standard solution looks like this
<tr>
<td>
<? if (strlen($arPaySystem["ACTION_FILE"]) > 0 && $arPaySystem["NEW_WINDOW"] == "Y" && $arPaySystem["IS_CASH"] != "Y"): ?>
<?
$orderAccountNumber = urlencode(urlencode($arResult["ORDER"]["ACCOUNT_NUMBER"]));
$paymentAccountNumber = $payment["ACCOUNT_NUMBER"];
?>
<script>
window.open('<?=$arParams["PATH_TO_PAYMENT"]?>?ORDER_ID=<?=$orderAccountNumber?>&PAYMENT_ID=<?=$paymentAccountNumber?>');
</script>
<?=Loc::getMessage("SOA_PAY_LINK", array("#LINK#" => $arParams["PATH_TO_PAYMENT"]."?ORDER_ID=".$orderAccountNumber."&PAYMENT_ID=".$paymentAccountNumber))?>
<? if (CSalePdf::isPdfAvailable() && $arPaySystem['IS_AFFORD_PDF']): ?>
<br/>
<?=Loc::getMessage("SOA_PAY_PDF", array("#LINK#" => $arParams["PATH_TO_PAYMENT"]."?ORDER_ID=".$orderAccountNumber."&pdf=1&DOWNLOAD=Y"))?>
<? endif ?>
<? else: ?>
<?=$arPaySystem["BUFFERED_OUTPUT"]?>
<? endif ?>
</td>
</tr>
$arPaySystem['IS_AFFORD_PDF']) = false
display, but the link turned out to be clumsy, because it does not lead to downloading a pdf file, but to a non-existent page. I don’t understand how to be here Answer the question
In order to leave comments, you need to log in
payment.php
connects after placing an order at the moment of transition to payment, usually displays either a receipt or a form for sending data to the payment gateway.
I need to make it so that in the sale.order.ajax module where the invoice is displayed, so that when the link is generated, a pdf invoice of this receipt is generated.Theory: buffer the html receipts, pass the resulting html to any library that can generate pdf from html. Now about your code: see where $arPaySystem['IS_AFFORD_PDF'] is formed and why it is false.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question