Answer the question
In order to leave comments, you need to log in
Cart in Woocommerce?
In the basket on woocemrce, extra data is displayed, or not in the correct order, and how to display the description of the goods in the basket? I googled both in Russian Google and in English Google but did not find anything, I hope you can help me.
UPD-1: the cart file can be changed at the address: wp-content/plugins/woocommerce/templates/cart/cart.php
But how to add a description???
Answer the question
In order to leave comments, you need to log in
What a great thing called "Self-education", I did everything I needed just by understanding the code, within 10 minutes I'll write what and where to add
UPD (in half an hour):
Here is a piece of code that is responsible for displaying the description (description):
<td class="product-description" data-title="<?php esc_attr_e( 'Product', 'woocommerce' ); ?>">
<?php
if ( ! $product_permalink ) {
echo apply_filters( 'woocommerce_cart_item_description', $_product->get_name(), $cart_item, $cart_item_key ) . ' ';
} else {
echo apply_filters( 'woocommerce_cart_item_description', sprintf( '<p style="white-space: pre;">%s</p>', $_product->get_description() ), $cart_item, $cart_item_key );
}
// Meta data
echo WC()->cart->get_item_data( $cart_item );
// Backorder notification
if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) {
echo '<p class="backorder_notification">' . esc_html__( 'Available on backorder', 'woocommerce' ) . '</p>';
}
?>
</td>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question