Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thrown in /home/devspedi/public_html/wp-content/themes/additrans/lib/php-barcode-generator/src/BarcodeGenerator.php on line 140 #177

Closed
rux2 opened this issue Apr 18, 2023 · 1 comment

Comments

@rux2
Copy link

rux2 commented Apr 18, 2023

i have this piece of code :
require_once get_template_directory().'/lib/php-barcode-generator/src/BarcodeGenerator.php';
require_once get_template_directory().'/lib/php-barcode-generator/src/BarcodeGeneratorHTML.php';

add_action( 'woocommerce_email_order_meta', 'aggiungi_codice_a_barre_email_conferma_ordine', 10, 3 );
function aggiungi_codice_a_barre_email_conferma_ordine( $order, $sent_to_admin, $plain_text ) {
$string = $order->get_order_number(); // Utilizza il numero dell'ordine come stringa per generare il codice a barre
$bar_code= genera_codice_a_barre( $stringa ); // Genera il codice a barre
$colli = $_POST['peso_colli'];
for ($i = 0; $i < count($colli); $i++){
if ($colli[$i]){
$stringa_per_codice_a_barre = $POST['codice_collo'.$i];
echo '

Bar code

';
echo $bar_code;
}
}
}
function genera_codice_a_barre( $string ) {
$generator = new Picqer\Barcode\BarcodeGeneratorHTML();
$bar_code= $generator->getBarcode($string, $generator::TYPE_CODE_39);
// Restituisci il codice a barre HTML
return $bar_code;
}
that generates the error : thrown in /home/devspedi/public_html/wp-content/themes/additrans/lib/php-barcode-generator/src/BarcodeGenerator.php on line 113.

@casperbakker
Copy link
Member

Without the error itself and the value in $string, I cannot start to debug this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants