cart-empty.php
9 years ago
cart-item-data.php
9 years ago
cart-shipping.php
9 years ago
cart-totals.php
9 years ago
cart.php
9 years ago
cross-sells.php
9 years ago
mini-cart.php
9 years ago
proceed-to-checkout-button.php
9 years ago
shipping-calculator.php
9 years ago
cross-sells.php
49 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Cross-sells |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/cart/cross-sells.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://docs.woocommerce.com/document/template-structure/ |
| 14 | * @author WooThemes |
| 15 | * @package WooCommerce/Templates |
| 16 | * @version 3.0.0 |
| 17 | */ |
| 18 | |
| 19 | if ( ! defined( 'ABSPATH' ) ) { |
| 20 | exit; |
| 21 | } |
| 22 | |
| 23 | if ( $cross_sells ) : ?> |
| 24 | |
| 25 | <div class="cross-sells"> |
| 26 | |
| 27 | <h2><?php _e( 'You may be interested in…', 'woocommerce' ) ?></h2> |
| 28 | |
| 29 | <?php woocommerce_product_loop_start(); ?> |
| 30 | |
| 31 | <?php foreach ( $cross_sells as $cross_sell ) : ?> |
| 32 | |
| 33 | <?php |
| 34 | $post_object = get_post( $cross_sell->get_id() ); |
| 35 | |
| 36 | setup_postdata( $GLOBALS['post'] =& $post_object ); |
| 37 | |
| 38 | wc_get_template_part( 'content', 'product' ); ?> |
| 39 | |
| 40 | <?php endforeach; ?> |
| 41 | |
| 42 | <?php woocommerce_product_loop_end(); ?> |
| 43 | |
| 44 | </div> |
| 45 | |
| 46 | <?php endif; |
| 47 | |
| 48 | wp_reset_postdata(); |
| 49 |