I rework the shop of a customer of mine, and he wants to generate a PDF of the offers he makes to his customers.
I have made the whole PDF template with FPDF and it works fine with a static variable with the offer number.
On the page are multiple forms, one for each offer. Each offer is generated with shopware, so i can't make different names for each submit button.
I need the value of the submit button or {$offerPosition.offerNumber}
for the PHP.
The HTML form looks like this:
<form method="post" action="fpdf/pdf-creator.php" id="btn">
<input type="submit" class="btn is--primary" value="{$offerPosition.offerNumber}">
</form>
And the PHP like this:
<?php
require('fpdf/fpdf.php');
$offernumber = substr($_POST['submit'], 8, 4);
$cn;
// Instanciation of inherited class
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->SetCreator();
$pdf->SetTitle("Angebot Nr. " . $offernumber);
$pdf->setOffernumber($offernumber);
$pdf->setCustomernumber($cn);
$pdf->AddPage();
...
$pdf->Output();
?>
I hope somebody can help me.