• Resolved dutt

    (@rajat-dutt)


    Dear woocommerce team,
    thanks for creating this amazing plugin.
    its just too amazing.
    I have one request please goto below link:
    Just to stay in competition need to go beyond boundriesL
    https://snipboard.io/0WXL7T.jpg
    i also want to show this text just below the title
    anyone can suggest me code for this.
    i don’t know how to write code.
    Please help me

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi @rajat-dutt ??

    Thank you very much for your feedback! We appreciate it ??

    i also want to show this text just below the title
    anyone can suggest me code for this.
    i don’t know how to write code.

    Sure thing! But, first, could you please be more specific about which text you are referring to and where you would like it to be displayed.

    Additionally, please share a link to your site so that I can check.

    Cheers!

    Thread Starter dutt

    (@rajat-dutt)

    Hi
    Here is the detail.
    I want to add this text on all of my product page.
    Please find below screenshots:
    Textbefore add to cart button:

    https://snipboard.io/nbsycu.jpg
    Now as you can see that drop down box.
    I also want to add this and common to all product page.

    Text after add to cart button:
    https://snipboard.io/hxaoCA.jpg

    Same like above as you can see there is dialigue box below add to cart button.

    I also wanted the same. Thing.

    My site is: Nexahair.com
    You can visit at any product page.

    Please help.me with the code. I dont know how to write it commonly for all products. I saw it on youtube but it was not showing desgined text like above screenshot.
    Thanks for your help in advance.

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    You will have to create the content in HTML first. After that you can use the following code to insert your content before add to cart:

    add_action( 'woocommerce_after_add_to_cart_quantity', 'woo_show_some_text', 20 );
     
    function woo_show_some_text() {
        echo '<p class="woo">My content here</p>';
    }

    and after add to cart button:

    add_action( 'woocommerce_after_add_to_cart_button', 'woo_show_some_text_2', 20 );
     
    function woo_show_some_text_2() {
        echo '<p class="woo">My content here as well</p>';
    }

    Kind regards,

    Thread Starter dutt

    (@rajat-dutt)

    Thanks for the reply. I appriciate it. Can you please explain what do you mean by creating content in html?
    I cant edit all my product page code
    I dont know much about coding.
    Can you tell me that simple code which i can insert in my function.php file of theme.

    Hi there,

    That means that you would need to add your own HTML instead of <p class="woo">My content here</p>.

    If you want, you can add the following as an example (only changing “My content here”) and see how it goes:

    add_action( 'woocommerce_after_add_to_cart_quantity', 'woo_show_some_text', 20 );
     
    function woo_show_some_text() {
        echo '<p class="woo">My content here</p>';
    }

    You can see as well some suggestions here on how to add custom code on your WooCommerce store: https://woocommerce.com/posts/properly-add-woocommerce-custom-code/

    Thread Starter dutt

    (@rajat-dutt)

    i tested the code and got following error

    Parse error: syntax error, unexpected ‘&’ in /home/customer/www/sewinhair.us/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()’d code on line 1
    There has been a critical error on this website. Please check your site admin email inbox for instructions.

    looks like something is wrong
    pls help me in that case

    Thread Starter dutt

    (@rajat-dutt)

    Anyone can reply?????

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    HI @rajat-dutt ??

    At the moment, there’s no default option for that in WooCommerce, and setting that as the default would require quite a bit of additional coding. Please kindly note that this requires some custom coding – which goes beyond the scope of support we are able to provide in this forum.

    If you do require more help with the actual coding, we’d recommend you hire a developer who can take a look at this, quote you for their services, and help you add this feature to your site. We’d recommend getting in touch with a web developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.`

    Cheers.

    Hi @rajat-dutt

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Add text above or below add to cart button’ is closed to new replies.