How to add Brands to PDF
-
Hi, thanks for a great plugin. I have one small problem, I use the WooCommerce Brands plugin for brand management, and I need the brand to be shown in the Packing list PDF. Its really just a plugin that adds Brands to its own category so it does not need to be shown with the rest. I have added brands to the email that goes ut with this code:
function modfuel_woocommerce_before_order_add_cat($name, $item){
$product_id = $item[‘product_id’];
$_product = wc_get_product( $product_id );
$htmlStr = “”;
$brands = “”;
$terms = get_the_terms( $product_id, ‘product_brand’ );
$count = 0;
foreach ( $terms as $term) {
$count++;
if($count > 1){
$brands .= $term->name;
}
else{
$brands .= $term->name . ‘,’;
}
}
$brands = rtrim($brands,’,’);
$htmlStr .= $_product->get_title();
$htmlStr .= “<p>Brand: ” . $brands . “</p>”;
return $htmlStr;
}Can the same be done to the PDF in some way?
- The topic ‘How to add Brands to PDF’ is closed to new replies.