• Resolved maedusabodyjewelry

    (@maedusabodyjewelry)


    Hello there ! First I would like to thank you for this excellent plugin that is easy to use and just perfect ! I have. problem though, the product name are not showing in my documents. Only their attributes. I have variable products, but other than this nothing special. What can I do ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter maedusabodyjewelry

    (@maedusabodyjewelry)

    I only added this custom code to show product link in my order mail. Maybe that can affect your plugin ?

    //Add img +link in woocommerce order mails
    // Displayed by default, so hide!

    function filter_woocommerce_order_item_name( $item_name, $item, $false ) {
    // Only email notifications
    if ( is_wc_endpoint_url() ) return $item_name;

    $item_name = ”;

    return $item_name;

    }
    add_filter( ‘woocommerce_order_item_name’, ‘filter_woocommerce_order_item_name’, 10, 3 );

    // NEW OUTPUT
    function action_woocommerce_order_item_meta_start( $item_id, $item, $order, $plain_text ) {

    // Only email notifications
    if ( is_wc_endpoint_url() ) return;

    // Settings
    $image_size = array( 64, 64 );

    // Get product
    $product = $item->get_product();

    if ( is_object( $product ) ) {
    $sku = $product->get_sku();
    $image = $product->get_image( $image_size );
    }

    // OUTPUT

    // Show image
    echo ” . $image. ”;

    // Product name + link + SKU (if set).
    if ( $sku ) {
    echo ‘‘ . $item->get_name() . ‘ (#’ . $sku . ‘)’ . ‘‘;
    } else {
    echo ‘‘ . $item->get_name() . ‘‘;
    }
    }
    add_action( ‘woocommerce_order_item_meta_start’, ‘action_woocommerce_order_item_meta_start’, 10 , 4 );

    Thread Starter maedusabodyjewelry

    (@maedusabodyjewelry)

    Ok, I just tried removing the custom code and it was indeed the problem. Could you please help solve it so I can have both setting working together pls ? I do not want to give up on showing the photo and the link in my customer’s order emails. Thank you !

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @maedusabodyjewelry,

    Are you using a custom PDF template? You can see this under WooCommerce > PDF Invoices > General > Choose a template.

    If so, try temporarily switching to our default Simple template, and then open a PDF document to see if the product name is displayed.

    Thread Starter maedusabodyjewelry

    (@maedusabodyjewelry)

    I am not using a custom template. Please read up, I have explained where is the problem coming from. Maybe u can help ?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    My apology, @maedusabodyjewelry. I just realized about the message you wrote just seconds before mine.

    Could you please help solve it so I can have both setting working together pls ?

    Try adding this code snippet to your site, and then activate the other code snippets you mentioned above:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Remove WooCommerce customizations on PDF document context
     */
    add_filter( 'wpo_wcpdf_before_html', function( $document_type, $document ) {
    	remove_filter( 'woocommerce_order_item_name', 'filter_woocommerce_order_item_name', 10, 3 );
    	remove_action( 'woocommerce_order_item_meta_start', 'action_woocommerce_order_item_meta_start', 10, 4 );
    }, 10, 2 );
    add_filter( 'wpo_wcpdf_after_html', function( $document_type, $document ) {
    	add_filter( 'woocommerce_order_item_name', 'filter_woocommerce_order_item_name', 10, 3 );
    	add_action( 'woocommerce_order_item_meta_start', 'action_woocommerce_order_item_meta_start', 10, 4 );
    }, 10, 2 );
    Thread Starter maedusabodyjewelry

    (@maedusabodyjewelry)

    OMG thank you so much ! It’s working perfectly. Thank you again. I will make sure to leave a 5 stars review on your plugin <3

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @maedusabodyjewelry,

    I’m very happy to hear that it is working as you expected… but even more happy to read your amazing review: You have made my week! ??

    Do not hesitate to write again, if you need anything!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Product Name not showing on invoice or packing slip’ is closed to new replies.