Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @clinic

    If you’re talking about the PDF document, and assuming that the plugin adds custom meta to the order, you can, by either using our Premium Templates extension adding a custom block, or creating a custom template.

    Thread Starter clinic

    (@clinic)

    Yes to PDF invoice, at this moment in invoice.php <td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td> this code add pickup date and time to invoice but it’s at bottom together with subtotal and total, so even if I move this to top above table with products, then if move everything and I want only keep pickup time or date and pickup time. What I know this plugin use delivery_time, pickup_date, pickup_time and delivery_date.

    In code I found also coderockz_woo_delivery_pickup_time and woo_delivery_pickup_time

    but I don’t know how to use this to show in PDF

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @clinic

    You can find the custom fields used by that plugin reading this documentation: Finding WooCommerce custom fields.

    Then you just need to display the custom field, by either using our Premium templates extension or creating a custom theme.

    Thread Starter clinic

    (@clinic)

    Okay, will try figure out how to do this.

    Also can you tell me if it’s any chance in invoice pdf have only products from specific category?

    what I mean it’s my online shop sell food for e.g. pizza, burgers, salads, drinks, and on invoice I want only show products from pizza category, it’s this possible to do?

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @clinic

    Try the snippet below inside your theme functions.php:

    add_filter( 'wpo_wcpdf_order_items_data', 'wpo_wcpdf_hide_products_not_allowed_categories', 10, 3 );
    function wpo_wcpdf_hide_products_not_allowed_categories( $items, $order, $type )
    {
    	$allowed_categories = array(19,2); // Replace with your allowed categories IDs
        if ( $type == 'invoice' ) {
    		foreach( $items as $key => $item ) {
    			$product = wc_get_product($item['product_id']);
    			$categories_ids = $product->get_category_ids();
    			foreach( $categories_ids as $category_id ) {
    				if( ! in_array($category_id, $allowed_categories) ) {
    					unset($items[$key]);
    				}
    			}
    		}
    	}
    	
        return $items;
    }

    If you never worked with actions/filters please read this documentation.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Pickup time on invoice’ is closed to new replies.