• Resolved jjbte

    (@jjbte)


    I am testing this plugin on a test site with just WooCommerce and the Storefront theme. I tried to set a customer to tax free by checking the “User Transactions are Tax-Free” checkbox. The check does not remain after saving.

    I did some investigating and found the problem in the woo-integration/vtprd-parent-functions.php script. On line 4080, the checkbox input’s value is set to 0 and there is no code to add ‘checked=”checked”‘ when appropriate. Is there a plan to fix this?

    https://www.ads-software.com/plugins/pricing-deals-for-woocommerce/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author vark

    (@vark)

    Hi,
    Thanks for your query and suggestion. I’ll be repairing this with the next release. In the meantime, you can do role-based tax free processing. Here’s the documentation:
    https://www.varktech.com/documentation/pricing-deals/introrule/#rolesetup.roletaxfree
    Best,
    Vark

    Thread Starter jjbte

    (@jjbte)

    Thanks so much for your prompt reply. I like this plugin very much thus far. I hope to purchase the Pro version when I’m finally ready to build a “real” WooCommerce site. ??

    Plugin Author vark

    (@vark)

    No worries, thanks for letting me know about the User selection issue.
    Best,
    Vark

    Thread Starter jjbte

    (@jjbte)

    I just updated to version 1.1.0.7 and there is still an issue with this checkbox. Checking the box DOES properly update the WordPress database usermeta table for the user being updated, but the box does NOT stay checked unless the user being updated is also the logged-in user (i.e., the Administrator).

    I believe the problem is with the following code in woo-integration/vtprd-parent-functions.php (starting on line 4089):

    global $current_user;
    if (get_user_meta( $current_user->ID, 'vtprd_user_is_tax_exempt', true ) == 'yes') {
         $checked =  ' checked="checked" ';
    } else {
         $checked =  '';
    }

    $checked is dependent upon the vtprd_user_is_tax_exempt value for the logged-in user rather than for the user being modified. If this box is not checked, any subsequent modifications to the user’s profile will remove the “vtprd_user_is_tax_exempt” meta key from the usermeta table.

    Plugin Author vark

    (@vark)

    Hi,
    Hmmm… this is working correctly in my test environment. If it’s convenient, please contact me via my support channel https://www.varktech.com/support/
    and we can do a skype chat, where you can share your screen and we can debug the situation.
    Best,
    Vark

    Edit:
    Light dawns – I see the issue. The flag is not stored for the **edited** user, but the logged-in user who is doing the editing.
    Will fix.
    Best,
    Vark

    Thread Starter jjbte

    (@jjbte)

    I removed the “global $current_user;” line and changed $current_user->ID to $user->ID and the box stays checked as it should.

    I’ll just make a note of the file change so I can check on it the next time I update the plugin. Thanks for your fast reply as usual. ??

    Plugin Author vark

    (@vark)

    Hi,
    Thanks so much for tracking this, and if I can believe my eyes, this fixes the issue:
    change this line:

    if (get_user_meta( $current_user->ID, 'vtprd_user_is_tax_exempt', true ) == 'yes') {

    to this:

    if (get_user_meta( $user->ID, 'vtprd_user_is_tax_exempt', true ) == 'yes') {

    going into next release…

    Best,
    Vark

    Plugin Author vark

    (@vark)

    Ha! our (same) solutions cross-posted!
    Thanks again.

    Thread Starter jjbte

    (@jjbte)

    You what they say: Great minds think alike!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘User Transactions are Tax-Free checkbox does not work’ is closed to new replies.