Offer 4x6 label downloads alongside A4
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m48s
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m48s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
51c6748894
commit
dff81caaea
@@ -227,11 +227,12 @@ class ShippingController extends Controller
|
||||
$order = collect($orders)->first(fn ($order) => (string) ($order['OrderLineId'] ?? '') === $orderLineId);
|
||||
$hash = $order ? $parcel2Go->labelHash($order) : null;
|
||||
abort_unless($hash, 404);
|
||||
$pdf = $parcel2Go->labelPdf($orderLineId, $hash);
|
||||
$size = $request->query('size') === '4x6' ? '4x6' : 'a4';
|
||||
$pdf = $parcel2Go->labelPdf($orderLineId, $hash, $size === '4x6' ? 'Label4x6' : 'A4');
|
||||
|
||||
return response($pdf, 200, [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'attachment; filename="parcel2go-'.$orderLineId.'.pdf"',
|
||||
'Content-Disposition' => 'attachment; filename="parcel2go-'.$orderLineId.'-'.$size.'.pdf"',
|
||||
'Cache-Control' => 'private, no-store',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user