add-to-cart
9 years ago
tabs
9 years ago
meta.php
9 years ago
photoswipe.php
9 years ago
price.php
9 years ago
product-attributes.php
9 years ago
product-image.php
9 years ago
product-thumbnails.php
9 years ago
rating.php
9 years ago
related.php
9 years ago
review-meta.php
9 years ago
review-rating.php
9 years ago
review.php
9 years ago
sale-flash.php
9 years ago
share.php
9 years ago
short-description.php
9 years ago
stock.php
9 years ago
title.php
9 years ago
up-sells.php
9 years ago
up-sells.php
49 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Single Product Up-Sells |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/single-product/up-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 ( $upsells ) : ?> |
| 24 | |
| 25 | <section class="up-sells upsells products"> |
| 26 | |
| 27 | <h2><?php esc_html_e( 'You may also like…', 'woocommerce' ) ?></h2> |
| 28 | |
| 29 | <?php woocommerce_product_loop_start(); ?> |
| 30 | |
| 31 | <?php foreach ( $upsells as $upsell ) : ?> |
| 32 | |
| 33 | <?php |
| 34 | $post_object = get_post( $upsell->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 | </section> |
| 45 | |
| 46 | <?php endif; |
| 47 | |
| 48 | wp_reset_postdata(); |
| 49 |