• Resolved Garry Rigby

    (@indigojones66)


    How do I add a custom field in the product short description on every product page?
    I want this to be automatic so I presume this would php somewhere?
    I wanted to add this form to the woocommerce-product-details__short-description
    [wpforms id=”974″]

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    It looks like you are using a third-party form plugin. You’d want to ask the plugin developer directly since they’d be more familiar with how it works: https://wpforms.com/contact/

    Thread Starter Garry Rigby

    (@indigojones66)

    Hi Maykato, this is more about adding a custom field to the product page short description, or putting a widget in the product page. I have a submenu of categories and list of latest products on my product pages but this I did with making a custom header and custom footer and sticking the widget blocks in those.
    But for this one bit of code which I need to add to the short description there must be an easier way

    Mirko P.

    (@rainfallnixfig)

    Hi @indigojones66,

    Your WP Forms shortcode can be manually added to the product short description and that will work as I’ve tried to generate a form on my test site and it’s being displayed in the product short description.

    If you want that to be automatically added to all single product posts short descriptions then you will require custom coding, that 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 hiring a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    Thanks.

    Thread Starter Garry Rigby

    (@indigojones66)

    Hi Mirko, I already add that manually to the product short description as can be seen here ~ https://heritagecountrypottery.com/product/slipware-salt-kit-1914/.
    Are you a custom developer?.. should I pay you?

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    For this, you could use the following PHP snippet I’ve generated for you:

    add_action('woocommerce_single_product_summary', 'add_form_in_short_description', 100 );
    
    function add_form_in_short_description() {
    	echo do_shortcode("[wpforms id='974']");
    }

    I normally recommend using the Code Snippet plugin in order to add custom PHP code into your site without having to touch the functions.php file. Here is a link on how to use the Code Snippet plugin:

    https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

    Cheers ??

    Thread Starter Garry Rigby

    (@indigojones66)

    Dear Gabriel, that is absolutely fantastic thank you so much; this is why your namesake was venerated as one of the primary archangels! I hope you have a great weekend.Regards Garry

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @indigojones66.

    I’m happy to hear @gabrielfuentes could help with this. I’m going to mark this as resolved – if you have any further questions, you can reopen it again if you need be.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add Custom field in product short description’ is closed to new replies.