• Resolved xyzmurali

    (@xyzmurali)


    Thanks for providing this wonderful plugin for marketplace.
    Could you please share a snippet code to add automatic filter for Tax classes while adding product based on the vendor store address.

    Eg: I have 3 tax classes ( 12% KA, 12% MH, 12% TN)
    My store is located in KA
    When I create a new product, and when i go to tax setting for that product, the dropdown currently shows all 3 tax classes. Is it possible to show only 12% KA here as my store is located in KA?
    Any short code or functionality which can help here to filter tax class based on store region?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    My store is located in KA

    – What is KA? Country code?

    Thank You

    Thread Starter xyzmurali

    (@xyzmurali)

    Hi,

    KA is the state code in India. (shown in wooommerce after i select india and then regions within india)

    Regards,
    Murali

    Thread Starter xyzmurali

    (@xyzmurali)

    Hi

    KA stands for Karnataka state

    Regards,
    Murali

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Eg: I have 3 tax classes ( 12% KA, 12% MH, 12% TN)

    – OK, I am checking this, how this can be achievable!

    But this will be very risky to filter classes by name.

    Thank You

    Thread Starter xyzmurali

    (@xyzmurali)

    Any update on this?

    Thread Starter xyzmurali

    (@xyzmurali)

    Hi, Any Update on this please

    Thread Starter xyzmurali

    (@xyzmurali)

    I added the below condition in wc-frontend-manager/views/products-manager/wcfm-view-products-manage.php and it seems to work. Please confirm if the change is fine

    if ( ! empty( $tax_classes ) ) {

    foreach ( $tax_classes as $class ) {
    if (strpos($class, get_user_meta( $current_user_id, ‘_wcfm_state’, true )) !== false) {
    $tax_classes_options[ sanitize_title( $class ) ] = esc_html( $class );
    $variation_tax_classes_options[ sanitize_title( $class ) ] = esc_html( $class );
    }
    }
    }

    Plugin Author WC Lovers

    (@wclovers)

    Code is fine and as this working for you then you may use this.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Filter for Tax Class while adding product’ is closed to new replies.