css
posted this
20 December 2017
Hi Support
I want to display the Woocommerce Short Description on the CART page!
I can't edit the cart table in Themler so therefore...
I have inserted this code in the end of the functions.php witch is found under Themes files under the Editor!
The code:
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' => $post_data->post_excerpt );
return $other_data;
}
And now the Cart is displaying the Short Description... nice!
But when I save the Theme again the code is removed from the functions.php!
Where can I insert the code in the Themler Editor so it is inserted in the functions.php after a save?
Regards
Claus
Hi Support
I want to display the Woocommerce Short Description on the CART page!
I can't edit the cart table in Themler so therefore...
I have inserted this code in the end of the functions.php witch is found under Themes files under the Editor!
The code:
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' => $post_data->post_excerpt );
return $other_data;
}
And now the Cart is displaying the Short Description... nice!
But when I save the Theme again the code is removed from the functions.php!
Where can I insert the code in the Themler Editor so it is inserted in the functions.php after a save?
Regards
Claus
Vote to pay developers attention to this features or issue.