JeanPaul1
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Shortcode in short product descriptionStrange, I replied to your email on Saturday 1 Apr. 06:07, but never got a response. The problem is still there, but I found what the problem is.
I add to all pages a tag, taxonomy I registered. It works on all pages except on the shop page. Don’t know why it doesn’t show up there.
Jean PaulForum: Fixing WordPress
In reply to: add new menu item to appearance Menus pageThanks Deviant, I use Snippets to insert the code. Got it to work. I used a new snippet and now it shows up. Great, thanks again. Works perfect now.
Forum: Fixing WordPress
In reply to: add new menu item to appearance Menus pageThank you for your code example. Did not get it to work, but it helped. I did not realize that it was just another meta_box. I saw that you use ‘nav-menus’ so I was able to get a working start.
ThanksForum: Plugins
In reply to: [Falang multilanguage for WordPress] Falang not workingProblem solved.
?? ?? ?? ?? ??Forum: Plugins
In reply to: [Falang multilanguage for WordPress] Falang not workingHello Stéphane,
Well that was an easy and quick fix. I could have thought of that one myself.
Thank you very much.
All is working as should.Hello, yes I found the problem.
It has to do with some code in twenty seventeen, either the panels in the home page template or the cards code I added to surround the content.
The code to display the text inside cards worked on every page except the home template. Translate added on the second a link code ….
I changed the front page to the shop page so people would not see this.I have changed the theme to storefront and now the cards are working fine.
The translation plugin works like a charm now.Thank you
Thank you, the cart_shipping.php was the problem.
I did as mentioned and it works again.
Thank you.
Jean PaulForum: Plugins
In reply to: [EU/UK VAT Compliance Assistant for WooCommerce] is_vat_exempt is not workingOkay my mistake.
Thank you
JPFatal error: Uncaught Error: Call to a member function get_billing_country() on null in /home/janjari93/domains/tecuro.uk/private_html/wp-content/plugins/woocommerce-country-based-payments/woocommerce-country-based-payments.php:88 Stack trace: #0 /home/janjari93/domains/tecuro.uk/private_html/wp-includes/class-wp-hook.php(287): WoocommerceCountryBasedPayment->available_payment_gateways(Array) #1 /home/janjari93/domains/tecuro.uk/private_html/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array) #2 /home/janjari93/domains/tecuro.uk/private_html/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(160): apply_filters('woocommerce_ava...', Array) #3 /home/janjari93/domains/tecuro.uk/private_html/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()'d code(244): WC_Payment_Gateways->get_available_payment_gateways() #4 /home/janjari93/domains/tecuro.uk/private_html/wp-includes/class-wp-hook.php(287): remove_bacs_from_thank_you_page('') #5 /home/janjari93/domains/tecuro.uk/private_html/ in /home/janjari93/domains/tecuro.uk/private_html/wp-content/plugins/woocommerce-country-based-payments/woocommerce-country-based-payments.php on line 88 There has been a critical error on your website.
I get an error when I add a new page or when I want to update a new page, not saving.
I checked the console and found above error listed.
When I deactivate the plugin all works fineForum: Plugins
In reply to: [WooCommerce] ajax-error 500 checkout pageHello Jmamar, the error was caused by the states dropdown which was not showing up.
I started again with a clean checkout and added new fields one by one until it worked as it should. That was it. So nothing complicated, just testing the code step by step.Take care.
Jean PaulForum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] tax displayed is incorrectOkay I found a solution that seems to be working now.
Order 576 without tax exempt applied
Order 575 with tax exempt applied
I used this code snippet By LoicTheAztec
I changed it a little bit to show ‘label’ => __( ‘Tax Exempt’, ‘woocommerce’ ),
Removed the default tax line and added the new one with the code.and I found this code online EXAMPLE #13
I just copy and paste it to do a trial run with it and it just worked.
Nice bonus, the code for adding text to the invoice did not work before but now it does.
You can see the text in the images, before this never showed up.Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] tax displayed is incorrectI have this filter
add_filter( ‘woocommerce_cart_hide_zero_taxes’, ‘__return_false’, 100 );
So I think this will make sure that zero tax is displayed.I’m not using a plugin for tax exempt.
I wrote my own code.
To set customer tax-exempt I use this/* * Update cart with VAT_EXEMPT */ add_action( 'woocommerce_checkout_update_order_review', 'taxexempt_checkout_based_on_checkbox'); function taxexempt_checkout_based_on_checkbox( $post_data) { global $woocommerce; $woocommerce->customer->set_is_vat_exempt( false ); parse_str($post_data); if ( $billing_taxexempt === '1' && $billing_confirmed === '1' && !empty($billing_signature) && ! empty($billing_declaration)){ $woocommerce->customer->set_is_vat_exempt( true ); add_filter( 'woocommerce_countries_tax_or_vat', function () { return __( 'Tax Exempt', 'woocommerce' ); }); } }
This will display the tax total line. I added a filter to change the ‘VAT’ to ‘Tax Exempt’
Then I added this code
add_filter( 'woocommerce_get_order_item_totals', 'wc_get_order_item_totals', 10, 5); function wc_get_order_item_totals( $total_rows, $order_id, $tax_display ) { $order = wc_get_order( $order_id ); $taxexempt = get_post_meta( $order->get_id(),'_billing_taxexempt', true ); if($taxexempt == 1){ $total_rows['tax'] = array( 'label' => __( 'Tax Exempt', 'woocommerce' ), 'value' => wc_price( $order->get_total_tax() ), ); } else{ $total_rows['tax'] = array( 'label' => __( 'VAT', 'woocommerce' ), 'value' => wc_price( $order->get_total_tax() ), ); } return $total_rows; }
To make it change everywhere else.
As you wrote “This “tax” label comes directly from WooCommerce by calling the function WC()->countries->tax_or_vat(): ”
There is a filter available to change the label, which I used in the code.
When you follow your link you will see it at the bottom./**
* Filter WooCommerce formatted order total.
*
* @param string $formatted_total Total to display.
* @param WC_Order $order Order data.
* @param string $tax_display Type of tax display.
* @param bool $display_refunded If should include refunded value.
*/
return apply_filters( ‘woocommerce_get_formatted_order_total’, $formatted_total, $this, $tax_display, $display_refunded );So what am I doing wrong?
Should this not be visible everywhere, including invoices?
Or am I using the wrong hook?
Will try an other one and let you know.- This reply was modified 5 years, 5 months ago by JeanPaul1.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] tax displayed is incorrectOne more thing, since the last update of Woocommerce this code snippet is not working anymore.
add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_custom_text', 15, 5 ); function wpo_wcpdf_custom_text ($template_type, $order) { if ($template_type == 'invoice') { ?> <div class="custom-text"> <?php _e(sprintf('Bedankt voor je bestelling %s, we gaan snel aan de slag om deze bij je thuis te leveren.',$order->get_billing_first_name()));?> </div> <?php } }
Is this function not valid anymore with the new update?
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] tax displayed is incorrectImage form the invoice.
Image invoiceForum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] tax displayed is incorrectHello Ewout
I have in the backend woocommerce set the option ‘Display tax totals’ As a Single total.
So I believe this is standard btw: €0.00, €totaal: €103.50) behaviour when this option is selected.
see official ducumentation of woocommerce
Setting up Taxes in WooCommerce
But maybe I’m wrongHere are the screenshots, hope I have the correct one’s now.
All is standard, removed everything from my theme folder so it uses directly the files from the plugin without any alteration. Except that I enabled images in the emails but this is a oneliner code.
On checkout and order-review and thankyou page and in acccount page it all shows the same BTW-vrijgesteld.
I think the problem is that the &tax_label is not taken from woocommerce directly but that this is done inside pdf invoices and packing slips
I saw in your code function get_order_taxes(), get_order_grand_total( $tax = ‘incl’ ), get_formatted_item_price ( $item, $type, $tax_display = ” ) and they all add there own labels. Is there no hook like ‘woocommerce_get_order_item_totals’ so I can change the label accordingly?