• Resolved davidwjw

    (@davidwjw)


    Hello,

    Loving your plug-in so far. It’s so easy to use and appreciate you delevoping it. I currently have a subscription box plug-in that has your main product but within that product there are sub products. At the moment the PDF is showing the name of the subscription box (single product). Is there any setting that can show all the items within the box also on the PDF?

    I will be giving your plug-in a great review.

    Regards, David W.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor dwpriv

    (@dwpriv)

    If these are custom data for the products, you can try the guide here to print them with a code snippet.

    Thread Starter davidwjw

    (@davidwjw)

    Thank you for your reply. We managed to create a MU Plugin to help with this.

    The key finding was that the subscription box contents were not stored as normal product custom fields. They were stored on the WooCommerce order line item by YITH, inside the order item meta _subscription_info, specifically under box_data['content'].

    Our plugin hooks into the WP Overnight PDF invoice output using:

    wpo_wcpdf_after_item_meta

    That hook runs underneath each product line on the PDF invoice. For each invoice line item, we check whether the WooCommerce order item has YITH subscription box content data. If it does, we read the selected products and quantities from the order item meta, load the product names/images, and print them underneath the parent subscription box product on the invoice.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.