• Hi,
    I am using TheGem theme and product add-ons don’t show up at all.
    I am using the latest version of your plugin.

    I think my theme is missing the necessary hooks in the function.php file.

    What lines should I add to functions.php of my child theme so product addons show up?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,

    The plugins works fine if you change theme with a default like Twenty Seventeen?

    Thread Starter amirvf

    (@amirvf)

    Yes it works with default themes, but it does not work with many third-party themes.

    I have had the same issue with some other plugins and adding the correct function and hook resolves the issue.

    I believe that the general format of the function and hook should be something like this:

    function yith_product_addons() {
         if(isset($GLOBALS['XXXXX'])) {
             add_action( 'woocommerce_before_add_to_cart_button', array($GLOBALS['XXXXX'], 'display'), 10);
         }
     }
    add_action('init', 'yith_product_addons');

    XXXXX refers to the global variable that is used in your plugin (YITH WooCommerce Product Add-Ons). I don’t know the exact global variable of your plugin and that’s why I could not resolve the issue.

    If you take a look at the threads in this forum, many other users have had the same issue and ended up using another plugin. Please consult with developers and get the proper function and hook so we could manually add it to our child theme, and then this plugin could be used for all themes.

    Here is a list of similar issues in the threads of this forum which were finally unresolved:

    https://www.ads-software.com/support/topic/add-ons-not-showing/
    https://www.ads-software.com/support/topic/add-ons-do-not-show/
    https://www.ads-software.com/support/topic/add-on-not-showing-on-product-page/
    https://www.ads-software.com/support/topic/action-or-hook-to-display-add-on-options/
    https://www.ads-software.com/support/topic/not-showing-up-35/
    https://www.ads-software.com/support/topic/i-dont-see-any-add-on-on-my-product-page/

    Thanks,
    Amir

    • This reply was modified 6 years, 4 months ago by amirvf.
    • This reply was modified 6 years, 4 months ago by amirvf.
    • This reply was modified 6 years, 4 months ago by amirvf.
    • This reply was modified 6 years, 4 months ago by amirvf.
    • This reply was modified 6 years, 4 months ago by amirvf.
    • This reply was modified 6 years, 4 months ago by amirvf.
    Plugin Author YITHEMES

    (@yithemes)

    Hi there,
    as you know the issue is due to your theme that is not using default WoooCommerce templates and WooCommerce hooks.
    That’s thy add-on form is not showed.
    You have to add a code like the following in order to use the plugin method (used to show the form) in a one of the custom hook available in your theme.

    if( defined('YITH_WAPO') ){
        add_action('your_hook',array($yith_wapo_instance,'frontendshow_product_options'));
    }

    We can guarantee the full compatibility only with WordPress standard theme, in according to WordPress and WooCommerce standard hooks.
    In other cases, when other theme apply customizations, the only way (when possible) is require the method used to print the form, in another hook, like described.
    Hope to be helpful for you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add-ons not showing up’ is closed to new replies.