• Resolved mugwumpr

    (@mugwumpr)


    Hello,

    In my shop I need to have the same information in the Description and Short Description fields for different purposes (export and website). Entering it twice is a pain. Is there some way to link the two fields so that what’s entered in one is also entered in the other? It would make things so much more efficient.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • @mugwumpr

    You should be able to create a MySQL query to duplicate post_content field of all posts to post_excerpt or vise versa.

    https://lorelle.wordpress.com/2014/08/10/find-search-replace-and-delete-in-the-wordpress-database/
    https://support.hostgator.com/articles/how-to-run-sql-queries-in-phpmyadmin

    Plugin Support RK a11n

    (@riaanknoetze)

    You could also alter the WooCommerce template files to call the main description field in both areas (Might be an SEO issue though). For more information on how to alter template files, have a look at https://docs.woocommerce.com/document/template-structure/

    Thread Starter mugwumpr

    (@mugwumpr)

    Thanks, Riaan!

    While I wasn’t able to get your suggestion to work, my searching for what I was doing wrong led me to a solution that makes it all work!

    ??

    The following snippet added to functions.php will swap out the locations of Description and Short Description on the front end, so whatever’s in the main Description field will show in the Short Description’s location on the public page. Information entered once, does double duty. Problem solved!

    add_action( 'woocommerce_before_single_product', 'themeprefix_woocommerce_template_product_description', 20 );
    /**
    * Add product description above product
    * Output description tab template using 'woocommerce_before_single_product' hook
    */
    function themeprefix_woocommerce_template_product_description() {
     wc_get_template( 'single-product/tabs/description.php' );
    }
    add_filter( 'woocommerce_product_tabs', 'themeprefix_woo_remove_product_tabs', 98 );
    /**
    * Remove WooCommerce Description Tab
    */
    function themeprefix_woo_remove_product_tabs( $tabs ) {
     unset( $tabs['description'] ); // Remove the description tab
     
     return $tabs;
    }

    Thank you, everyone!

    • This reply was modified 7 years, 9 months ago by mugwumpr. Reason: Me kno kan speel gud

    @mugwumpr

    Glad you where able to figure it out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Link Product Description and Product Short Description fields’ is closed to new replies.