N
N
Niriter Inc.2017-07-20 21:47:40
PHP
Niriter Inc., 2017-07-20 21:47:40

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

1 answer(s)
N
Niriter Inc., 2017-07-20
@niriter

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 ) . '&nbsp;';
                } 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 question

Ask a Question

731 491 924 answers to any question