• Resolved natasalagou

    (@natasacy)


    Hello,

    I enabled the plugin to display some additional terms per product, but the Term’s link lies behind the Add to Cart button and also breaks the design of Favorite and Compare buttons that are supposed to be located next to add to cart.

    Is there any way to reposition the Product Terms above the 3 buttons mentioned above?

    Many thanks in advance,

    Natasa

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author giannis4

    (@giannis4)

    Hi Natasa,

    Thanks for using our plugin! You can currently style the link with CSS. As I am seeing on your site that is not enough since the terms appear between the add to cart button and the favorite, compare buttons of your theme.

    I’ll release a minor update for the plugin next week, that will allow to use a small code snippet to change the position of the terms on the single product page.

    I’ll let you know when that happens so you can try it out.

    Thanks again.

    Best regards,
    Giannis

    Thread Starter natasalagou

    (@natasacy)

    Hello Giannis,

    Thank you very much in advance! Looking forward to testing the new version! ??

    Natasa

    Plugin Author giannis4

    (@giannis4)

    Hi Natasa,

    Thank you for your patience! I have released an update (v.1.2.7) to the plugin that allows the removal of the single product terms action.

    After updating you will be able to use a code snippet to unhook the single product terms function from the “woocommerce_after_add_to_cart_form” hook and add it again, either with lower priority (#1) or to the product meta section (#2).

    The PHP snippet that does that is:

    add_action('init', 'change_single_product_terms_place');
    function change_single_product_terms_place(){
    
        // Remove the hook that displays the single product terms
        remove_action( 'woocommerce_after_add_to_cart_form',
            array( 'TACPP4_Terms_Conditions_Per_Product', 'show_terms_on_product_page' ), 20 );
    
        // #1. Show the terms with a lower priority "999" (show last)
        add_action( 'woocommerce_after_add_to_cart_form',
            array( 'TACPP4_Terms_Conditions_Per_Product', 'show_terms_on_product_page' ), 999 );
    
        // #2. Show the terms on the product meta section
        add_action( 'woocommerce_product_meta_start',
            array( 'TACPP4_Terms_Conditions_Per_Product', 'show_terms_on_product_page' ), 10 );
    
    }

    Please place the above code in your child theme’s functions.php file and only keep one of the two options (#1, #2) so the terms are not displayed twice.

    You can find all available hooks for the single product page here.

    Please let me know if that works for you or if you have any questions.

    Best regards,
    Giannis

    • This reply was modified 1 year ago by giannis4. Reason: Add hook list
    Thread Starter natasalagou

    (@natasacy)

    Dear Giannis hello,

    Thank you very much for acting promptly! It perfectly works!

    I used the following code in order to display the terms before add to cart button:

    // #2. Show the terms before add to cart
    add_action( ‘woocommerce_before_add_to_cart_form’,
    array( ‘TACPP4_Terms_Conditions_Per_Product’, ‘show_terms_on_product_page’ ), 10 );

    Once again, thank you! ??

    Natasa

    Plugin Author giannis4

    (@giannis4)

    Hi Natasa,

    Awesome! Glad to hear that it worked and that you modified the script to fit your needs ??

    I would appreciate it if you wrote a review of your experience using our plugin.

    Thanks again Natasa.

    Best regards,
    Giannis

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Terms Product Link hides behind Add To Cart Button’ is closed to new replies.