• Resolved fkoomek

    (@fkoomek)


    Hi. First of all I would like to thank you for your plugin ??
    Now, am I missing something that EU VAT number box and selfcheck box appear no matter what kind of product I’m buying or it’s standard behavior?
    Thanks

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Diego

    (@daigo75)

    Yes, that’s correct, it’s by design. The VAT number is part of the billing information, which applies to the order, not to specific products. It’s always displayed, no matter what products are in the cart.

    If you wish to display the field only in some cases, you can use filter wc_aelia_eu_vat_assistant_show_vat_field for that purpose. Here’s a template, for your convenience.

    add_filter('wc_aelia_eu_vat_assistant_show_vat_field', function($show_vat_field) {
      // Add your custom logic to change the value of $show_vat_field to 
      // true (show field) or false (hide field)
    
      return $show_vat_field;
    });

    If you need assistance developing a customisation for your site, you can post your project here: https://aelia.co/hire_us. We will review your requirements and provide an estimate for the implementation of your customisation.

    Thread Starter fkoomek

    (@fkoomek)

    Thank you for your answer.
    And can I get rid of the selfcheckbox? It’s the main thing I want to achieve actually.

    Plugin Author Diego

    (@daigo75)

    Indeed, there’s a filter for the checkbox as well. It’s wc_aelia_eu_vat_assistant_show_self_certification_field, it works the same way as the one for the VAT.

    Thread Starter fkoomek

    (@fkoomek)

    Great.
    And is there a filter to disable requirement of that field? If I use wc_aelia_eu_vat_assistant_show_self_certification_field filter, it doesn’t disable requirement of that field. Then when I’m trying to buy physical products for which I hide the self check box and my IP address doesn’t match billing country, it wants me to confirm address by ticking the box which isn’t there ??

    Plugin Author Diego

    (@daigo75)

    You’re right, the self-certification field is always required if the location evidence is insufficient. It makes sense, as the EU VAT Assistant was originally designed exclusively for digital sales (like ours, as this is a plugin we wrote mainly for internal use). In such shops, the location evidence is required. Mixed shops, selling digital and physical products, were taken into account at a later stage.

    I will ask to add a filter to override the check for the self certification. In the meantime, you can use a workaround, by telling the EU VAT Assistant that there is sufficient evidence in specific circumstances, by using a filter like the following:

    add_filter('wc_aelia_eu_vat_assistant_location_evidence_countries', function($countries) {
      // Use your custom conditions to decide when to override the list of countries
      if(<your custom conditions>) {
        // Take the first country (the billing country) and add it again to the list. 
        // This will tell the EU VAT Assistant that there are at least two pieces of 
        // evidence proving the location, and the self-certification check won't 
        // be performed
        $countries[] = $countries[0];
      }
      
      return $countries;
    }, 10);
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘VAT boxes display also for physical products’ is closed to new replies.