Title: Question backcall
Last modified: June 4, 2019

---

# Question backcall

 *  Resolved [sorro445](https://wordpress.org/support/users/sorro445/)
 * (@sorro445)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/)
 * Hi,
    I am using Suki and also Woocommerce and another plugin, Collapseomatic.
   Now I need Collapseomatic to display a product description accordionlike in the
   woocommerce cart and checkout table, and it is not working correctly, so I had
   asked the Collapseomatic support and they told me to ask the theme support
 * >  if they provide a callback on after the checkout items have successfully loaded
   > so other functions can be triggered
 * Is this the case?
 * Thanks for your help.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Theme Author [sukiwp](https://wordpress.org/support/users/sukiwp/)
 * (@sukiwp)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11604195)
 * Hi [@sorro445](https://wordpress.org/support/users/sorro445/)
 * From what I’ve seen, you want to “insert WooCommerce product description into
   cart table”. And you want the description to be in an accordion style (using 
   Collapseomatic). This is not related to Suki, but we found something that would
   be helpful for you.
 * So the callback that they mention is called “hook” in WordPress terminology. 
   WooCommerce has a hook that allows you to insert the product description into
   each cart item (maybe after the product name). You would need to do custom coding(
   via Child Theme or separate plugin) and it would require some PHP knowledge.
 * Please refer to these articles:
 * [https://www.themelocation.com/display-product-short-description-in-woo/](https://www.themelocation.com/display-product-short-description-in-woo/)
 * To use the accordion style from Collapseomatic, you need to change the `$post_data-
   >post_excerpt` part to be `'[expand title="trigger text"]' . $post_data->post_excerpt.'[/
   expand]'`.
 * Hope it helps 🙂
 *  Thread Starter [sorro445](https://wordpress.org/support/users/sorro445/)
 * (@sorro445)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11604638)
 * Hi,
    thanks for your help. I actually need the product short desccription for
   something else, that’s why I had created the custom field. But even if I was 
   to use it, your code still has the an issue: If I add this to my child theme
 *     ```
       add_filter( 'woocommerce_get_item_data', 'wc_checkout_description_so_15127954', 10, 2 );
       function wc_checkout_description_so_15127954( $other_data, $cart_item )
       {
           $post_data = get_post( $cart_item['product_id'] );
           $other_data[] = array( 'name' =>  '[expand title="trigger text"]' . $post_data->post_excerpt . '[/expand]' );
           return $other_data;
       }
       ```
   
 * the shortcode gets displayed as plain tect in the cart and checkout tables, with
   no accordion styling/function.
 *  Theme Author [sukiwp](https://wordpress.org/support/users/sukiwp/)
 * (@sukiwp)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11604707)
 * Try to wrap it with `do_shortcode`
 * So it will be: `do_shortcode( '[expand title="trigger text"]' . $post_data->post_excerpt.'[/
   expand]' )`
 * If you want to display the custom field, you need to change the `$post_data->
   post_excerpt` with your custom field.
 *  Thread Starter [sorro445](https://wordpress.org/support/users/sorro445/)
 * (@sorro445)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11605039)
 * Hi,
    this still does not work 100%. First, it adds a “:” to the Expand title,
   which is not normal and which does not happen when using my original function
   to display the custom field in the tables:
 *     ```
       add_filter( 'woocommerce_cart_item_name', 'customizing_cart_item_name', 10, 3 );
       function customizing_cart_item_name( $product_name, $cart_item, $cart_item_key ) {
           $product = $cart_item['data']; // Get the WC_Product Object
   
           if ( $value = $product->get_meta('description') ) {
               $product_name .= '<small>'. do_shortcode( $value ) .'</small>';
           }
           return $product_name;
       }
       ```
   
 * and when I try to enter my custom field like this
 *     ```
       add_filter( 'woocommerce_get_item_data', 'wc_checkout_description_so_15127954', 10, 2 );
       function wc_checkout_description_so_15127954( $other_data, $cart_item )
       {
           $post_data = get_post( $cart_item['product_id'] );
           $other_data[] = array( 'name' =>  do_shortcode( '[expand title="Details"]' . $description . '[/expand]' ) );
           return $other_data;
       }
       ```
   
 * I not only get the “:” but also the accordion does not work…
 *  Theme Author [sukiwp](https://wordpress.org/support/users/sukiwp/)
 * (@sukiwp)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11606283)
 * You are using `$description` while it’s not yet defined anywhere inside the function.
   Of course, it is a blank variable.
 * About the “:”, I think it’s added by default from the plugin. As you can see,
   we don’t add any “:” in the custom code.
 * By the way, this is not a theme issue, I just helped you pointing out how to 
   do it. You might need to browse around WooCommerce documentation to know how 
   to fetch the proper custom field you are using.
 *  Thread Starter [sorro445](https://wordpress.org/support/users/sorro445/)
 * (@sorro445)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11606502)
 * Hi,
 * no, Collapseoamtic does not add a “:”, when inserting it with my function or 
   even just in a regular page, ther is no “:”. So it has to do with adding it with
   the function you had suggested. So overall, the theme does not provide a hook
   as Collapseomatic was wondering?
 *  Theme Author [sukiwp](https://wordpress.org/support/users/sukiwp/)
 * (@sukiwp)
 * [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11606517)
 * As I mentioned, this is a question for WooCommerce and Collapseomatic. This has
   nothing to do with Suki theme at all.
 * You can try to remove the Collapseomatic shortcode wrapper. Let see if the “:”
   is also added. If yes, then it’s automatically added by WooCommerce.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Question backcall’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/suki/1.3.7/screenshot.jpg)
 * Suki
 * [Support Threads](https://wordpress.org/support/theme/suki/)
 * [Active Topics](https://wordpress.org/support/theme/suki/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/suki/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/suki/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [sukiwp](https://wordpress.org/support/users/sukiwp/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/question-backcall/#post-11606517)
 * Status: resolved