Support » Plugin: WooCommerce Cart PDF » Add Product Attributes

  • Resolved westham00

    (@westham00)


    Hi,

    Just found this plugin, it looks great and very customizable.

    I have added custom fields (not acf) to my product variations which works in the single page. How can I display this information under the product in the PDF:

    Custom Fields: https://imgur.com/a/I5OWlC6

    Thanks

    • This topic was modified 1 year, 7 months ago by westham00.
    • This topic was modified 1 year, 7 months ago by westham00.
    • This topic was modified 1 year, 7 months ago by westham00.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter westham00

    (@westham00)

    I have tried this line, but it does not work for me. Can anyone help? Thanks

    <?php echo esc_html( $product->get_attributes() ); ?>

    Plugin Author Seattle Web Co.

    (@seattlewebco)

    The get_attributes() method returns an array, so you would have to loop through each element and then echo this out. But I think what you are actually looking for is the cart item data. This is already displayed by default with this plugin, and if it is not displayed then the cart item data might not be set correctly. Are you seeing the watts/lumens in the normal cart table?

    Thread Starter westham00

    (@westham00)

    Yes I am trying to display the data seen in the fields. However, this data does not display in the cart table directly: https://imgur.com/a/dneURvV

    If I can pass the data to display in the cart itself, how will I then output onto the .PDF form?

    Thank you.

    Plugin Author David Jensen

    (@dkjensen)

    That is correct, if the data is saved to cart item and you see it on the cart page, it will also show on pdf

    Thread Starter westham00

    (@westham00)

    Hi David,

    Thanks for your help. I will pursue how to add this meta data to the cart which will surely resolve my issue.

    For anyone interested in how to add the variations data to cart and .PDF, it worked well for me using this in functions.php

    add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' );
    add_filter( 'woocommerce_is_attribute_in_product_name', '__return_false' );
    • This reply was modified 1 year, 7 months ago by westham00.
    Plugin Author Seattle Web Co.

    (@seattlewebco)

    Great thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add Product Attributes’ is closed to new replies.