My store creates a pdf download as the product. The pdf includes the customer’s name and products options. Worked great with one product option, but now I have five product options. The pdf is now generating one page per product option. I need all product options together.
Please help.
<?php require_once 'CreateVoucher.class.php'; $order_id = (int)$_GET['order_id']; $exp_date = date("M d Y"); $control_number = $order_id; $con = mysql_connect("75790230572340-5.db.75790230572340-5.not-here.com", "75790230572340-5", "not-this"); mysql_select_db("75790230572340-5", $con); $query = " SELECT O.billing_name as customers_name, OP.products_name, OPA.products_options_values FROM orders O INNER JOIN orders_products AS OP ON OP.orders_id = O.orders_id INNER JOIN orders_products_attributes AS OPA ON OPA.orders_products_id = OP.orders_products_id WHERE O.orders_id = " . $order_id; $result = mysql_query($query); $pdf = new CreateVoucher(); while ($row = mysql_fetch_assoc ($result)) { $name = $row['customers_name']; $pkg = $row['products_name']; $persons = substr($row['products_options_values'], 0, 100); $pdf->addNewVoucher($pkg, $name, $persons, $control_number, $exp_date); } $pdf->outputPdf(); ?>