• I’m wondering if you plan to add any compatibility for composite products? For example, we have a variety pack of our product where the customer selects three flavors to be included in their variety pack. The flavors display below the product title on the PDF invoice, however, there’s no way to indent those flavor choices under the main product title.

    The PDF invoice treats the main product as well as the flavors all as <tr class="product"> with no distinguishing classes that would group the main product and flavors together.

    Is there a way to add the additional classes like you’ve done with the product bundles and the chained products? I started digging in the code and wasn’t sure how to apply a class to those items. Any help or ideas would be greatly appreciated. Thank you!

    https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Eli,
    It’s certainly possible, by using the wpo_wcpdf_item_row_class filter. However, I don’t have the Composite Products plugin, so you need a bit more information about how to detect a composite product (and whether composite products is installed).

    Let me know and I’ll do my best to help!
    Ewout

    Thread Starter eli0086

    (@eli0086)

    Hi Ewout,
    I see in the file “class-wdpdf-export.php” that you have added functions to detect the various product/order types:

    // WooCommerce Product Bundles compatibility (add row classes)
    			if ( class_exists('WC_Bundles') ) {
    				add_filter( 'wpo_wcpdf_item_row_class', array( $this, 'add_product_bundles_classes' ), 10, 4 );
    			}

    However, I’m not sure which class would be detectable by the Composite products. I don’t know if there’s a way for you to be able to look at the plugin itself…I would be able to provide that for you, of course.

    In looking through the code, it seems that the composite products are using this class definition: WC_Composite_Products

    Let me know if there’s a certain place or bits of code that I can provide that would be more helpful for you. Thanks!

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! The assignment of that filter (based on whether the plugin is active or not) is only part of the solution, the difficult part of this is getting the data from the products/line items themselves to see how they should be grouped/styled. Send me an email at support@wpovernight.com and I’ll see what I can do for you!

    Ewout

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

The topic ‘Compatibility for Composite Products?’ is closed to new replies.