Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter mom4i911024

    (@mom4i911024)

    That’s awesome, thank you!

    Thread Starter mom4i911024

    (@mom4i911024)

    Hi,

    I have a follow-up question regarding VAT validation in Germanized. Specifically, is it possible to configure the validation process to always use the billing_vat_id field, even when a different shipping address is provided?

    I attempted to use the woocommerce_gzdp_checkout_supports_shipping_vat_id filter, but it seems to disable the shipping VAT field entirely, which in turn stops VAT validation when a separate shipping address is used.

    Is there an alternative approach provided by Germanized to achieve this, or would a custom solution be necessary?

    Thank you for your help!

    Thread Starter mom4i911024

    (@mom4i911024)

    Yes, it differs, but for some reason, it wasn’t working as you described on my production installation, even with only Germanized and WooCommerce active. I tested it locally on a fresh installation and saw how it’s supposed to work. I’ll need to troubleshoot the issue on the production site, but it seems that the problem might be related to the different billing and shipping addresses. Thank you for pointing me in the right direction!

    Thread Starter mom4i911024

    (@mom4i911024)

    Are you referring to the VAT ID cache option in Germanized’s settings? It was set to 7 days, but I’ve now disabled/cleared it. Do you think this will resolve any future issues?

    The shipping address for the order is indeed different, and the VAT ID field is empty there. However, I just tested a new order where the billing address had a VAT ID, while the shipping address did not, and the taxes were still excluded correctly so unfortunately it seems this isn’t the root of the issue.

    We’re using the classic checkout shortcode.

    Thread Starter mom4i911024

    (@mom4i911024)

    Thank you! I guess you meant I should remove all three of them or? Seems like the actual fields disappear by removing prepare_order_shipments function in particular. I’ve used this which seems to do the trick:

    add_action( 'wp_loaded', 'germanized_remove_shipment_filters', 1000 );
    
    function germanized_remove_shipment_filters() {
        // Ensure the class and method exist before attempting to remove the filters.
        if ( class_exists( 'Vendidero\Germanized\Shipments\Api' ) ) {
            remove_filter( 'woocommerce_rest_shop_order_schema', array( 'Vendidero\Germanized\Shipments\Api', 'order_shipments_schema' ), 10 );
            remove_filter( 'woocommerce_rest_prepare_shop_order_object', array( 'Vendidero\Germanized\Shipments\Api', 'prepare_order_shipments' ), 15 );
            remove_filter( 'woocommerce_rest_pre_insert_shop_order_object', array( 'Vendidero\Germanized\Shipments\Api', 'insert_order_shipments' ), 10 );
        }
    }
    Thread Starter mom4i911024

    (@mom4i911024)

    Hello
    I’m using version number 3.3.3 of the PRO plugin. I’ve just tested with the free plugin and it works properly. I’ll check with my client if there’s a newer version of the PRO plugin I need to install?

    Also, could you please tell me why when I filter, the number of results/products on the page changes? By default i’ve set 60 products to show per page, but when I filter I get only 10?

    Thread Starter mom4i911024

    (@mom4i911024)

    Spot on! Thank you very much. Seems like all I had to do is this and now it works

    function myproject_combine_address_shipping($args, $object, $order_shipment) {
    	
    	$args['address']['address_1'] = $args['address']['address_1'] . ' ' . $args['address']['address_2'];
    	
            //Hide field on shipping label
    	$args['address']['address_2'] = '';
    
            return $args;
    }
    
    add_filter('woocommerce_gzd_shipment_sync_props', 'myproject_combine_address_shipping', 100, 3);
    • This reply was modified 10 months, 2 weeks ago by mom4i911024.
    Thread Starter mom4i911024

    (@mom4i911024)

    Awesome work Adam… thank you very much! Excellent solution, the speed improvement is very noticeable and I can keep the pagination. Thanks again!

    Thread Starter mom4i911024

    (@mom4i911024)

    As far as I can tell it doesn’t work if I keep the pagination and use Field Groups because of the way my form is structured right now.

    It works if I remove the pagination and use Field Groups but then the flow of the form becomes different – it shows the next field group on a click instead of with a “Next” button. Is there a way to use Field Groups and still have the Previous/Next button functionality like pagination does?

    Also, for the time being, is there a way to add some sort of loading spinner on the button to indicate that the next page in the pagination is loading after I click “Next”?

    Thread Starter mom4i911024

    (@mom4i911024)

    Hi Saurabh,

    Thank you for taking a look at my form. However, after checking the Field Group feature, i’m not sure it’s going to work in my case. Indeed I do have the same visibility conditions on multiple radio fields, but they are all in different “pages” from the pagination. Is there a way to group them and maintain the current visibility conditions like that? Or did you mean I should replace the pagination with Field Groups?

    If I am to remove the page breaks the form speeds up quite a lot. And to explain the form a bit further, all my visibility conditions depend on the selection of the first radio group. Then in each separate page break the same visibility rules are ran, so it’s pretty much the same thing over and over again in each page break. First radio selection group has let’s say 16 options. If the user selects an option from the first eight predefined ones – show this field and if he selects an option from the other 8 predefined ones, show that field.

    I was wondering why it’s slowing down so much if the conditional visibility logic is not that complex and it only depends on the first radio field selection.

    Kind Regards,

    Thread Starter mom4i911024

    (@mom4i911024)

    Hey,
    I thought it’s pretty clear. I just want to move the checkout button to another location on the checkout page and was wondering what’s the best way to do it. This is what I’ve done, please let me know if there’s a more efficient way.

    //Remove the plugin action from their class
    remove_filters_with_method_name( 'woocommerce_review_order_after_payment', 'eh_express_checkout_hook', 10 );
    
    function remove_filters_with_method_name( $hook_name = '', $method_name = '', $priority = 0 ) {
        global $wp_filter;
        // Take only filters on right hook name and priority
        if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) {
            return false;
        }
        // Loop on filters registered
        foreach ( (array) $wp_filter[ $hook_name ][ $priority ] as $unique_id => $filter_array ) {
            // Test if filter is an array ! (always for class/method)
            if ( isset( $filter_array['function'] ) && is_array( $filter_array['function'] ) ) {
                // Test if object is a class and method is equal to param !
                if ( is_object( $filter_array['function'][0] ) && get_class( $filter_array['function'][0] ) && $filter_array['function'][1] == $method_name ) {
                    // Test for WordPress >= 4.7 WP_Hook class (https://make.www.ads-software.com/core/2016/09/08/wp_hook-next-generation-actions-and-filters/)
                    if ( is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
                        unset( $wp_filter[ $hook_name ]->callbacks[ $priority ][ $unique_id ] );
                    } else {
                        unset( $wp_filter[ $hook_name ][ $priority ][ $unique_id ] );
                    }
                }
            }
        }
        return false;
    }
    
    //Use a non-static method from the plugin class
    add_action('woocommerce_review_order_before_cart_contents', 'express_checkout_button_function', 40);
    
    function express_checkout_button_function() {
    	$class = new Eh_Paypal_Express_Hooks;
    	
        return $class->eh_express_checkout_hook();
    } 
    Thread Starter mom4i911024

    (@mom4i911024)

    Yes seems like the issue was coming from somewhere else, maybe caching or not sure but it looks fine now on the fresh installation. Thank you for checking!

    Thread Starter mom4i911024

    (@mom4i911024)

    Hey,
    Seems to work fine now, ty!

    Thread Starter mom4i911024

    (@mom4i911024)

    Hi @andrescifuentesr
    It’s already happening on the sandbox you’ve linked. Just select Euro from the dropdown in WooCommerce->Reports and then click on “Go”. The results returned and dropdown selection default to US instead of Euro https://imgur.com/a/puv3CQx

    Thread Starter mom4i911024

    (@mom4i911024)

    Got it, thank you! I’ve used this code, not sure if it’s the best approach but it seems to work fine for me.

    
    use Vendidero\StoreaBill\WooCommerce\Helper;
    
    add_filter('woocommerce_email_attachments', function ($attachments, $email_id, $object, $email) {
    	
    	//WooCommerce Order Status Manager email ID
    	if ( $email_id === 'wc_order_status_email_54059' ) {
    		if (is_a($object, 'WC_Order') && $order = Helper::get_order($object)) {
    			\Vendidero\StoreaBill\WooCommerce\Automation::sync_invoices($order, array('allow_defer' => false));
    			
    			$cancellations         = $order->get_finalized_cancellations();
    			$latest_cancellation = end($cancellations);
    
    			if ($latest_cancellation->has_file()) {
    				$attachments[] = $latest_cancellation->get_path();
    			}
    		}
    	}
    }
Viewing 15 replies - 1 through 15 (of 19 total)