Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #1688300
Using a Plugin
Closed

Comments

  • Manju Arora started the conversation

    Hello, I added the plugin Woocommerce check pincode/zipcode for shipping (https://wordpress.org/plugins/woocommerce-check-pincode-zipcode-for-shipping/) which works fine for a simple product. However, it does not show anything on the product page for a variable product. I used a different theme and it was working even with a variable product.


    Checked further and found out that the plugin is using the following hook:

    add_action( 'woocommerce_before_add_to_cart_button', 'pincode_field');

    For a simple product, the hook is added but for a variable product the hook is not added so not executed. Could you please help?

  • [deleted] replied

    Hi,

    Please make changes in file inc/woocommerce.php:

    Add next line in function thegem_woocommerce_single_variation_add_to_cart_button():

    <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>

    Like this: