Home Forums WoodMart support forum Checkout Fields – Compatibility with YITH Point of Sale – VAT Number Field

Checkout Fields – Compatibility with YITH Point of Sale – VAT Number Field

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #582101

    Jeriss Cloud Center
    Participant

    Reopening the below ticket :

    https://xtemos.com/forums/topic/checkout-fields-editor-compatibility-with-yith-point-of-sale-vat-number/

    Please check the screenshot attached where you’ll see the reply from YITH Support Team.

    Both WoodMart and YITH are sending the problem back to each other.

    Attachments:
    You must be logged in to view attached files.
    #582121

    Artem Temos
    Keymaster

    Hello,

    We also use the same hook, but it still doesn’t work. Did you test how it works with other checkout field editor plugins?

    Kind Regards

    #582128

    Jeriss Cloud Center
    Participant

    I’m not using any other plugin. I’m using only your WoodMart checkout editor.

    And even if I use other plugins, it doesnt make any point because it’s something not provided by default in WordPress and WooCommerce.

    Usually you always ask us to try with default install, which we do. But here trying with other systems doesnt make sense because it’s a third-party customization.

    So please contact YITH support because you are both rejecting responsability, but someone has to fix something in here.

    #582147

    Artem Temos
    Keymaster

    In this case, we can mark this plugin as incompatible with our checkout manager as it doesn’t work with this mechanism in general. We can’t do anything in our theme’s code to fix this. The issue seems to be a conflict that arises from the way the YITH Point of Sale plugin and all checkout fields managers.

    #582218

    Jeriss Cloud Center
    Participant

    I’ve just tested the below free plugin Checkout Fields Editor :
    https://fr.wordpress.org/plugins/checkout-field-editor-and-manager-for-woocommerce/

    And this FREE plugin is perfectly capable of detecting the “VAT Number” field from YITH Point of Sale.

    So if this plugin can do it, then WoodMart Checkout Fields editor can do it.

    Look at the staging below.

    Attachments:
    You must be logged in to view attached files.
    #582902

    Artem Temos
    Keymaster

    To fix this issue, you need to edit the file wp-content\themes\woodmart\inc\integrations\woocommerce\modules\checkout-fields\class-helper.php and add the line as shown on the screenshot https://monosnap.com/file/lIVsLcC1aSWVMIQ7nQbnFEwtuxQHaj

    $fields = apply_filters( 'woodmart_default_checkout_fields', $fields, $current_tab );

    After this, add the following snippet to the functions.php file in your child theme

    add_filter(
    	'woodmart_default_checkout_fields',
    	function ( $fields ) {
    		if ( ! function_exists( 'yith_pos_get_vat_field_label' ) ) {
    			return $fields;
    		}
    
    		$fields['billing']['billing_vat'] = array(
    			'field_name'  => 'billing_vat',
    			'label'       => yith_pos_get_vat_field_label(),
    			'description' => '',
    			'required'    => false,
    			'status'      => 'yes' === get_option( 'yith_pos_show_vat_field_on_frontend', 'yes' ),
    			'type'        => 'text',
    			'class'       => array( 'form-row-wide' ),
    			'priority'    => 35,
    		);
    
    		return $fields;
    	}
    );

    Now you need to reset all the configurations to the default and configure it from scratch.

    #582913

    Jeriss Cloud Center
    Participant

    So this code will go in my functions.php for now, but afterwards you will add this by default in your theme right?

    #582921

    Jeriss Cloud Center
    Participant

    The code works fine now. But please integrate this by default in your theme in next release.

    #582944

    Artem Temos
    Keymaster

    We will add the filter to our theme’s code, but you will need to keep the code in the child theme anyway.

Viewing 9 posts - 1 through 9 (of 9 total)