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

    (@barnabas1)

    Sorry, the title of my first question really reflected another question:

    For orders that had a previous issued invoice by Yith Woocommerce PDF invoice, there are fields that show up on the Challan invoice: Please see the screenshot how the Challan invoice looks when Yith Woocomerce PDF plugin is disabled: https://snipboard.io/3NiAsP.jpg

    How can I completely remove all the traces of my previous invoice plugin? If the Yith Invoice plugin is enabled then the Challan Invoices are clean, but when I disable Yith all these fields appear for each product and the invoice looks messy.

    Could you also answer me on how I can just translate one string from the invoice with a filter? I want to change all the “TAX” strings to “VAT”.

    • This reply was modified 3 years, 4 months ago by barnabas1.
    • This reply was modified 3 years, 4 months ago by barnabas1.
    • This reply was modified 3 years, 4 months ago by barnabas1.
    Thread Starter barnabas1

    (@barnabas1)

    For past orders when I delete the Yith invoice, then the Challan Invoice is nice and clear. Is it the case that I must delete all the past invoices generated by Yith do get nice clean invoices with Challan invoice plugin?

    • This reply was modified 3 years, 4 months ago by barnabas1.
    • This reply was modified 3 years, 4 months ago by barnabas1.
    • This reply was modified 3 years, 4 months ago by barnabas1.
    Plugin Author Ohidul Islam

    (@wahid0003)

    Hi, @barnabas1,
    Challan free version doesn’t support third-party plugins. You can translate any string of invoices with this filter.

    add_filter('woo_invoice_filter_template_label', 'woo_invoice_filter_template_label_callback', 10, 3);
    
    function woo_invoice_filter_template_label_callback($label, $order, $template){
    	
    	if($label == 'VAT'){
    		
    		return "TAX";
    	}else if ($label == 'Cost'){
    		
    		return 'Price';
    	}
    	
    	return $label;
    }
    Thread Starter barnabas1

    (@barnabas1)

    Thanks for the snippet.
    I actually have the pro version of the Challn invoice, but I don’t use a translation plugin.
    A snippet comes in handy to translate just one word.

    Plugin Author Ohidul Islam

    (@wahid0003)

    Thank you @barnabas1 for confirmation.

    Thread Starter barnabas1

    (@barnabas1)

    I’m using this code below to change the strings

    add_filter('woo_invoice_filter_template_label', 'woo_invoice_filter_template_label_callback', 10, 3);
    
    function woo_invoice_filter_template_label_callback($label, $order, $template){
    	
    	if($label == 'Tax'){
    		
    		return 'VAT';	
    	} 
    	if ($label == 'Cost'){
    		
    		return 'Price';
    	}
    	return $label;
    }

    However, you can see the screenshot https://snipboard.io/1HStlb.jpg that the last string “Without Tax” does not change. Ideally, to be best formated it could be as (excl. Tax). But how to change the “Tax” word on that line?

    Plugin Author Ohidul Islam

    (@wahid0003)

    Hi @barnabas1,
    Challan Free doesn’t have a feature to show shipping total with “excl. Tax” and “incl. Tax”.
    For translation, you have to paste in the condition the whole string, not part of it. For example, you want to translate “Items Subtotal” then you have to paste it in a condition just like this.

    add_filter('woo_invoice_filter_template_label', 'woo_invoice_filter_template_label_callback', 10, 3);
    
    function woo_invoice_filter_template_label_callback($label, $order, $template){
    	
    	if($label == 'Items Subtotal'){ // String is case sensetive.
    		
    		return 'Items Subtotal';	
    	} 
    	
    	return $label;
    }
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Yith PDF fields on invoice’ is closed to new replies.