initial commit
This commit is contained in:
32
templates/single-product/add-to-cart/external.php
Normal file
32
templates/single-product/add-to-cart/external.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* External product add to cart
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/add-to-cart/external.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.4.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
|
||||
|
||||
<form class="cart" action="<?php echo esc_url( $product_url ); ?>" method="get">
|
||||
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
|
||||
|
||||
<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $button_text ); ?></button>
|
||||
|
||||
<?php wc_query_string_form_fields( $product_url ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
|
||||
</form>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>
|
126
templates/single-product/add-to-cart/grouped.php
Normal file
126
templates/single-product/add-to-cart/grouped.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* Grouped product add to cart
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/add-to-cart/grouped.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 4.8.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $product, $post;
|
||||
|
||||
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
|
||||
|
||||
<form class="cart grouped_form" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data'>
|
||||
<table cellspacing="0" class="woocommerce-grouped-product-list group_table">
|
||||
<tbody>
|
||||
<?php
|
||||
$quantites_required = false;
|
||||
$previous_post = $post;
|
||||
$grouped_product_columns = apply_filters(
|
||||
'woocommerce_grouped_product_columns',
|
||||
array(
|
||||
'quantity',
|
||||
'label',
|
||||
'price',
|
||||
),
|
||||
$product
|
||||
);
|
||||
$show_add_to_cart_button = false;
|
||||
|
||||
do_action( 'woocommerce_grouped_product_list_before', $grouped_product_columns, $quantites_required, $product );
|
||||
|
||||
foreach ( $grouped_products as $grouped_product_child ) {
|
||||
$post_object = get_post( $grouped_product_child->get_id() );
|
||||
$quantites_required = $quantites_required || ( $grouped_product_child->is_purchasable() && ! $grouped_product_child->has_options() );
|
||||
$post = $post_object; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
setup_postdata( $post );
|
||||
|
||||
if ( $grouped_product_child->is_in_stock() ) {
|
||||
$show_add_to_cart_button = true;
|
||||
}
|
||||
|
||||
echo '<tr id="product-' . esc_attr( $grouped_product_child->get_id() ) . '" class="woocommerce-grouped-product-list-item ' . esc_attr( implode( ' ', wc_get_product_class( '', $grouped_product_child ) ) ) . '">';
|
||||
|
||||
// Output columns for each product.
|
||||
foreach ( $grouped_product_columns as $column_id ) {
|
||||
do_action( 'woocommerce_grouped_product_list_before_' . $column_id, $grouped_product_child );
|
||||
|
||||
switch ( $column_id ) {
|
||||
case 'quantity':
|
||||
ob_start();
|
||||
|
||||
if ( ! $grouped_product_child->is_purchasable() || $grouped_product_child->has_options() || ! $grouped_product_child->is_in_stock() ) {
|
||||
woocommerce_template_loop_add_to_cart();
|
||||
} elseif ( $grouped_product_child->is_sold_individually() ) {
|
||||
echo '<input type="checkbox" name="' . esc_attr( 'quantity[' . $grouped_product_child->get_id() . ']' ) . '" value="1" class="wc-grouped-product-add-to-cart-checkbox" />';
|
||||
} else {
|
||||
do_action( 'woocommerce_before_add_to_cart_quantity' );
|
||||
|
||||
woocommerce_quantity_input(
|
||||
array(
|
||||
'input_name' => 'quantity[' . $grouped_product_child->get_id() . ']',
|
||||
'input_value' => isset( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ? wc_stock_amount( wc_clean( wp_unslash( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ) ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
'min_value' => apply_filters( 'woocommerce_quantity_input_min', 0, $grouped_product_child ),
|
||||
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $grouped_product_child->get_max_purchase_quantity(), $grouped_product_child ),
|
||||
'placeholder' => '0',
|
||||
)
|
||||
);
|
||||
|
||||
do_action( 'woocommerce_after_add_to_cart_quantity' );
|
||||
}
|
||||
|
||||
$value = ob_get_clean();
|
||||
break;
|
||||
case 'label':
|
||||
$value = '<label for="product-' . esc_attr( $grouped_product_child->get_id() ) . '">';
|
||||
$value .= $grouped_product_child->is_visible() ? '<a href="' . esc_url( apply_filters( 'woocommerce_grouped_product_list_link', $grouped_product_child->get_permalink(), $grouped_product_child->get_id() ) ) . '">' . $grouped_product_child->get_name() . '</a>' : $grouped_product_child->get_name();
|
||||
$value .= '</label>';
|
||||
break;
|
||||
case 'price':
|
||||
$value = $grouped_product_child->get_price_html() . wc_get_stock_html( $grouped_product_child );
|
||||
break;
|
||||
default:
|
||||
$value = '';
|
||||
break;
|
||||
}
|
||||
|
||||
echo '<td class="woocommerce-grouped-product-list-item__' . esc_attr( $column_id ) . '">' . apply_filters( 'woocommerce_grouped_product_list_column_' . $column_id, $value, $grouped_product_child ) . '</td>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_grouped_product_list_after_' . $column_id, $grouped_product_child );
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
}
|
||||
$post = $previous_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
setup_postdata( $post );
|
||||
|
||||
do_action( 'woocommerce_grouped_product_list_after', $grouped_product_columns, $quantites_required, $product );
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>" />
|
||||
|
||||
<?php if ( $quantites_required && $show_add_to_cart_button ) : ?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
|
||||
|
||||
<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>
|
56
templates/single-product/add-to-cart/simple.php
Normal file
56
templates/single-product/add-to-cart/simple.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Simple product add to cart
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/add-to-cart/simple.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.4.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $product;
|
||||
|
||||
if ( ! $product->is_purchasable() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo wc_get_stock_html( $product ); // WPCS: XSS ok.
|
||||
|
||||
if ( $product->is_in_stock() ) : ?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_add_to_cart_form' ); ?>
|
||||
|
||||
<form class="cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data'>
|
||||
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
|
||||
|
||||
<?php
|
||||
do_action( 'woocommerce_before_add_to_cart_quantity' );
|
||||
|
||||
woocommerce_quantity_input(
|
||||
array(
|
||||
'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
|
||||
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
|
||||
'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( wp_unslash( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity(), // WPCS: CSRF ok, input var ok.
|
||||
)
|
||||
);
|
||||
|
||||
do_action( 'woocommerce_after_add_to_cart_quantity' );
|
||||
?>
|
||||
|
||||
<button type="submit" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
|
||||
</form>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>
|
||||
|
||||
<?php endif; ?>
|
84
templates/single-product/add-to-cart/variable.php
Normal file
84
templates/single-product/add-to-cart/variable.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* Variable product add to cart
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/add-to-cart/variable.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.5
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $product;
|
||||
|
||||
$attribute_keys = array_keys( $attributes );
|
||||
$variations_json = wp_json_encode( $available_variations );
|
||||
$variations_attr = function_exists( 'wc_esc_json' ) ? wc_esc_json( $variations_json ) : _wp_specialchars( $variations_json, ENT_QUOTES, 'UTF-8', true );
|
||||
|
||||
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
|
||||
|
||||
<form class="variations_form cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->get_id() ); ?>" data-product_variations="<?php echo $variations_attr; // WPCS: XSS ok. ?>">
|
||||
<?php do_action( 'woocommerce_before_variations_form' ); ?>
|
||||
|
||||
<?php if ( empty( $available_variations ) && false !== $available_variations ) : ?>
|
||||
<p class="stock out-of-stock"><?php echo esc_html( apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) ) ); ?></p>
|
||||
<?php else : ?>
|
||||
<table class="variations" cellspacing="0">
|
||||
<tbody>
|
||||
<?php foreach ( $attributes as $attribute_name => $options ) : ?>
|
||||
<tr>
|
||||
<td class="label"><label for="<?php echo esc_attr( sanitize_title( $attribute_name ) ); ?>"><?php echo wc_attribute_label( $attribute_name ); // WPCS: XSS ok. ?></label></td>
|
||||
<td class="value">
|
||||
<?php
|
||||
wc_dropdown_variation_attribute_options(
|
||||
array(
|
||||
'options' => $options,
|
||||
'attribute' => $attribute_name,
|
||||
'product' => $product,
|
||||
)
|
||||
);
|
||||
echo end( $attribute_keys ) === $attribute_name ? wp_kses_post( apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . esc_html__( 'Clear', 'woocommerce' ) . '</a>' ) ) : '';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="single_variation_wrap">
|
||||
<?php
|
||||
/**
|
||||
* Hook: woocommerce_before_single_variation.
|
||||
*/
|
||||
do_action( 'woocommerce_before_single_variation' );
|
||||
|
||||
/**
|
||||
* Hook: woocommerce_single_variation. Used to output the cart button and placeholder for variation data.
|
||||
*
|
||||
* @since 2.4.0
|
||||
* @hooked woocommerce_single_variation - 10 Empty div for variation data.
|
||||
* @hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
|
||||
*/
|
||||
do_action( 'woocommerce_single_variation' );
|
||||
|
||||
/**
|
||||
* Hook: woocommerce_after_single_variation.
|
||||
*/
|
||||
do_action( 'woocommerce_after_single_variation' );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_variations_form' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
do_action( 'woocommerce_after_add_to_cart_form' );
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Single variation cart button
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.4.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $product;
|
||||
?>
|
||||
<div class="woocommerce-variation-add-to-cart variations_button">
|
||||
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
|
||||
|
||||
<?php
|
||||
do_action( 'woocommerce_before_add_to_cart_quantity' );
|
||||
|
||||
woocommerce_quantity_input(
|
||||
array(
|
||||
'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
|
||||
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
|
||||
'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( wp_unslash( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity(), // WPCS: CSRF ok, input var ok.
|
||||
)
|
||||
);
|
||||
|
||||
do_action( 'woocommerce_after_add_to_cart_quantity' );
|
||||
?>
|
||||
|
||||
<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
|
||||
|
||||
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
|
||||
|
||||
<input type="hidden" name="add-to-cart" value="<?php echo absint( $product->get_id() ); ?>" />
|
||||
<input type="hidden" name="product_id" value="<?php echo absint( $product->get_id() ); ?>" />
|
||||
<input type="hidden" name="variation_id" class="variation_id" value="0" />
|
||||
</div>
|
23
templates/single-product/add-to-cart/variation.php
Normal file
23
templates/single-product/add-to-cart/variation.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Single variation display
|
||||
*
|
||||
* This is a javascript-based template for single variations (see https://codex.wordpress.org/Javascript_Reference/wp.template).
|
||||
* The values will be dynamically replaced after selecting attributes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 2.5.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<script type="text/template" id="tmpl-variation-template">
|
||||
<div class="woocommerce-variation-description">{{{ data.variation.variation_description }}}</div>
|
||||
<div class="woocommerce-variation-price">{{{ data.variation.price_html }}}</div>
|
||||
<div class="woocommerce-variation-availability">{{{ data.variation.availability_html }}}</div>
|
||||
</script>
|
||||
<script type="text/template" id="tmpl-unavailable-variation-template">
|
||||
<p><?php esc_html_e( 'Sorry, this product is unavailable. Please choose a different combination.', 'woocommerce' ); ?></p>
|
||||
</script>
|
40
templates/single-product/meta.php
Normal file
40
templates/single-product/meta.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Meta
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/meta.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
global $product;
|
||||
?>
|
||||
<div class="product_meta">
|
||||
|
||||
<?php do_action( 'woocommerce_product_meta_start' ); ?>
|
||||
|
||||
<?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>
|
||||
|
||||
<span class="sku_wrapper"><?php esc_html_e( 'SKU:', 'woocommerce' ); ?> <span class="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : esc_html__( 'N/A', 'woocommerce' ); ?></span></span>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo wc_get_product_category_list( $product->get_id(), ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'woocommerce' ) . ' ', '</span>' ); ?>
|
||||
|
||||
<?php echo wc_get_product_tag_list( $product->get_id(), ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', count( $product->get_tag_ids() ), 'woocommerce' ) . ' ', '</span>' ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_product_meta_end' ); ?>
|
||||
|
||||
</div>
|
56
templates/single-product/photoswipe.php
Normal file
56
templates/single-product/photoswipe.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Photoswipe markup
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/photoswipe.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="pswp__bg"></div>
|
||||
<div class="pswp__scroll-wrap">
|
||||
<div class="pswp__container">
|
||||
<div class="pswp__item"></div>
|
||||
<div class="pswp__item"></div>
|
||||
<div class="pswp__item"></div>
|
||||
</div>
|
||||
<div class="pswp__ui pswp__ui--hidden">
|
||||
<div class="pswp__top-bar">
|
||||
<div class="pswp__counter"></div>
|
||||
<button class="pswp__button pswp__button--close" aria-label="<?php esc_attr_e( 'Close (Esc)', 'woocommerce' ); ?>"></button>
|
||||
<button class="pswp__button pswp__button--share" aria-label="<?php esc_attr_e( 'Share', 'woocommerce' ); ?>"></button>
|
||||
<button class="pswp__button pswp__button--fs" aria-label="<?php esc_attr_e( 'Toggle fullscreen', 'woocommerce' ); ?>"></button>
|
||||
<button class="pswp__button pswp__button--zoom" aria-label="<?php esc_attr_e( 'Zoom in/out', 'woocommerce' ); ?>"></button>
|
||||
<div class="pswp__preloader">
|
||||
<div class="pswp__preloader__icn">
|
||||
<div class="pswp__preloader__cut">
|
||||
<div class="pswp__preloader__donut"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
|
||||
<div class="pswp__share-tooltip"></div>
|
||||
</div>
|
||||
<button class="pswp__button pswp__button--arrow--left" aria-label="<?php esc_attr_e( 'Previous (arrow left)', 'woocommerce' ); ?>"></button>
|
||||
<button class="pswp__button pswp__button--arrow--right" aria-label="<?php esc_attr_e( 'Next (arrow right)', 'woocommerce' ); ?>"></button>
|
||||
<div class="pswp__caption">
|
||||
<div class="pswp__caption__center"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
25
templates/single-product/price.php
Normal file
25
templates/single-product/price.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Price
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/price.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
global $product;
|
||||
|
||||
?>
|
||||
<p class="<?php echo esc_attr( apply_filters( 'woocommerce_product_price_class', 'price' ) ); ?>"><?php echo $product->get_price_html(); ?></p>
|
33
templates/single-product/product-attributes.php
Normal file
33
templates/single-product/product-attributes.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Product attributes
|
||||
*
|
||||
* Used by list_attributes() in the products class.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-attributes.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! $product_attributes ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<table class="woocommerce-product-attributes shop_attributes">
|
||||
<?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) : ?>
|
||||
<tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--<?php echo esc_attr( $product_attribute_key ); ?>">
|
||||
<th class="woocommerce-product-attributes-item__label"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th>
|
||||
<td class="woocommerce-product-attributes-item__value"><?php echo wp_kses_post( $product_attribute['value'] ); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
55
templates/single-product/product-image.php
Normal file
55
templates/single-product/product-image.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Image
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-image.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.1
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Note: `wc_get_gallery_image_html` was added in WC 3.3.2 and did not exist prior. This check protects against theme overrides being used on older versions of WC.
|
||||
if ( ! function_exists( 'wc_get_gallery_image_html' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $product;
|
||||
|
||||
$columns = apply_filters( 'woocommerce_product_thumbnails_columns', 4 );
|
||||
$post_thumbnail_id = $product->get_image_id();
|
||||
$wrapper_classes = apply_filters(
|
||||
'woocommerce_single_product_image_gallery_classes',
|
||||
array(
|
||||
'woocommerce-product-gallery',
|
||||
'woocommerce-product-gallery--' . ( $post_thumbnail_id ? 'with-images' : 'without-images' ),
|
||||
'woocommerce-product-gallery--columns-' . absint( $columns ),
|
||||
'images',
|
||||
)
|
||||
);
|
||||
?>
|
||||
<div class="<?php echo esc_attr( implode( ' ', array_map( 'sanitize_html_class', $wrapper_classes ) ) ); ?>" data-columns="<?php echo esc_attr( $columns ); ?>" style="opacity: 0; transition: opacity .25s ease-in-out;">
|
||||
<figure class="woocommerce-product-gallery__wrapper">
|
||||
<?php
|
||||
if ( $post_thumbnail_id ) {
|
||||
$html = wc_get_gallery_image_html( $post_thumbnail_id, true );
|
||||
} else {
|
||||
$html = '<div class="woocommerce-product-gallery__image--placeholder">';
|
||||
$html .= sprintf( '<img src="%s" alt="%s" class="wp-post-image" />', esc_url( wc_placeholder_img_src( 'woocommerce_single' ) ), esc_html__( 'Awaiting product image', 'woocommerce' ) );
|
||||
$html .= '</div>';
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $post_thumbnail_id ); // phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_product_thumbnails' );
|
||||
?>
|
||||
</figure>
|
||||
</div>
|
33
templates/single-product/product-thumbnails.php
Normal file
33
templates/single-product/product-thumbnails.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Thumbnails
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-thumbnails.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.1
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Note: `wc_get_gallery_image_html` was added in WC 3.3.2 and did not exist prior. This check protects against theme overrides being used on older versions of WC.
|
||||
if ( ! function_exists( 'wc_get_gallery_image_html' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $product;
|
||||
|
||||
$attachment_ids = $product->get_gallery_image_ids();
|
||||
|
||||
if ( $attachment_ids && $product->get_image_id() ) {
|
||||
foreach ( $attachment_ids as $attachment_id ) {
|
||||
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', wc_get_gallery_image_html( $attachment_id ), $attachment_id ); // phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
}
|
43
templates/single-product/rating.php
Normal file
43
templates/single-product/rating.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Rating
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/rating.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
global $product;
|
||||
|
||||
if ( ! wc_review_ratings_enabled() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$rating_count = $product->get_rating_count();
|
||||
$review_count = $product->get_review_count();
|
||||
$average = $product->get_average_rating();
|
||||
|
||||
if ( $rating_count > 0 ) : ?>
|
||||
|
||||
<div class="woocommerce-product-rating">
|
||||
<?php echo wc_get_rating_html( $average, $rating_count ); // WPCS: XSS ok. ?>
|
||||
<?php if ( comments_open() ) : ?>
|
||||
<?php //phpcs:disable ?>
|
||||
<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s customer review', '%s customer reviews', $review_count, 'woocommerce' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a>
|
||||
<?php // phpcs:enable ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
54
templates/single-product/related.php
Normal file
54
templates/single-product/related.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Related Products
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/related.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.9.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $related_products ) : ?>
|
||||
|
||||
<section class="related products">
|
||||
|
||||
<?php
|
||||
$heading = apply_filters( 'woocommerce_product_related_products_heading', __( 'Related products', 'woocommerce' ) );
|
||||
|
||||
if ( $heading ) :
|
||||
?>
|
||||
<h2><?php echo esc_html( $heading ); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php woocommerce_product_loop_start(); ?>
|
||||
|
||||
<?php foreach ( $related_products as $related_product ) : ?>
|
||||
|
||||
<?php
|
||||
$post_object = get_post( $related_product->get_id() );
|
||||
|
||||
setup_postdata( $GLOBALS['post'] =& $post_object ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, Squiz.PHP.DisallowMultipleAssignments.Found
|
||||
|
||||
wc_get_template_part( 'content', 'product' );
|
||||
?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php woocommerce_product_loop_end(); ?>
|
||||
|
||||
</section>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
45
templates/single-product/review-meta.php
Normal file
45
templates/single-product/review-meta.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* The template to display the reviewers meta data (name, verified owner, review date)
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/review-meta.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.4.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $comment;
|
||||
$verified = wc_review_is_from_verified_owner( $comment->comment_ID );
|
||||
|
||||
if ( '0' === $comment->comment_approved ) { ?>
|
||||
|
||||
<p class="meta">
|
||||
<em class="woocommerce-review__awaiting-approval">
|
||||
<?php esc_html_e( 'Your review is awaiting approval', 'woocommerce' ); ?>
|
||||
</em>
|
||||
</p>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<p class="meta">
|
||||
<strong class="woocommerce-review__author"><?php comment_author(); ?> </strong>
|
||||
<?php
|
||||
if ( 'yes' === get_option( 'woocommerce_review_rating_verification_label' ) && $verified ) {
|
||||
echo '<em class="woocommerce-review__verified verified">(' . esc_attr__( 'verified owner', 'woocommerce' ) . ')</em> ';
|
||||
}
|
||||
|
||||
?>
|
||||
<span class="woocommerce-review__dash">–</span> <time class="woocommerce-review__published-date" datetime="<?php echo esc_attr( get_comment_date( 'c' ) ); ?>"><?php echo esc_html( get_comment_date( wc_date_format() ) ); ?></time>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
}
|
27
templates/single-product/review-rating.php
Normal file
27
templates/single-product/review-rating.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* The template to display the reviewers star rating in reviews
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/review-rating.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
global $comment;
|
||||
$rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );
|
||||
|
||||
if ( $rating && wc_review_ratings_enabled() ) {
|
||||
echo wc_get_rating_html( $rating ); // WPCS: XSS ok.
|
||||
}
|
67
templates/single-product/review.php
Normal file
67
templates/single-product/review.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Review Comments Template
|
||||
*
|
||||
* Closing li is left out on purpose!.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/review.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 2.6.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
?>
|
||||
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
||||
|
||||
<div id="comment-<?php comment_ID(); ?>" class="comment_container">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* The woocommerce_review_before hook
|
||||
*
|
||||
* @hooked woocommerce_review_display_gravatar - 10
|
||||
*/
|
||||
do_action( 'woocommerce_review_before', $comment );
|
||||
?>
|
||||
|
||||
<div class="comment-text">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* The woocommerce_review_before_comment_meta hook.
|
||||
*
|
||||
* @hooked woocommerce_review_display_rating - 10
|
||||
*/
|
||||
do_action( 'woocommerce_review_before_comment_meta', $comment );
|
||||
|
||||
/**
|
||||
* The woocommerce_review_meta hook.
|
||||
*
|
||||
* @hooked woocommerce_review_display_meta - 10
|
||||
*/
|
||||
do_action( 'woocommerce_review_meta', $comment );
|
||||
|
||||
do_action( 'woocommerce_review_before_comment_text', $comment );
|
||||
|
||||
/**
|
||||
* The woocommerce_review_comment_text hook
|
||||
*
|
||||
* @hooked woocommerce_review_display_comment_text - 10
|
||||
*/
|
||||
do_action( 'woocommerce_review_comment_text', $comment );
|
||||
|
||||
do_action( 'woocommerce_review_after_comment_text', $comment );
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
32
templates/single-product/sale-flash.php
Normal file
32
templates/single-product/sale-flash.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Sale Flash
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/sale-flash.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 1.6.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
global $post, $product;
|
||||
|
||||
?>
|
||||
<?php if ( $product->is_on_sale() ) : ?>
|
||||
|
||||
<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
|
26
templates/single-product/share.php
Normal file
26
templates/single-product/share.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Share
|
||||
*
|
||||
* Sharing plugins can hook into here or you can add your own code directly.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/share.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_share' ); // Sharing plugins can hook into here.
|
||||
|
||||
/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
|
33
templates/single-product/short-description.php
Normal file
33
templates/single-product/short-description.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Single product short description
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/short-description.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
global $post;
|
||||
|
||||
$short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );
|
||||
|
||||
if ( ! $short_description ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="woocommerce-product-details__short-description">
|
||||
<?php echo $short_description; // WPCS: XSS ok. ?>
|
||||
</div>
|
23
templates/single-product/stock.php
Normal file
23
templates/single-product/stock.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product stock.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/stock.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<p class="stock <?php echo esc_attr( $class ); ?>"><?php echo wp_kses_post( $availability ); ?></p>
|
30
templates/single-product/tabs/additional-information.php
Normal file
30
templates/single-product/tabs/additional-information.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Additional Information tab
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/additional-information.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $product;
|
||||
|
||||
$heading = apply_filters( 'woocommerce_product_additional_information_heading', __( 'Additional information', 'woocommerce' ) );
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( $heading ) : ?>
|
||||
<h2><?php echo esc_html( $heading ); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_product_additional_information', $product ); ?>
|
30
templates/single-product/tabs/description.php
Normal file
30
templates/single-product/tabs/description.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Description tab
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/description.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 2.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $post;
|
||||
|
||||
$heading = apply_filters( 'woocommerce_product_description_heading', __( 'Description', 'woocommerce' ) );
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( $heading ) : ?>
|
||||
<h2><?php echo esc_html( $heading ); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php the_content(); ?>
|
56
templates/single-product/tabs/tabs.php
Normal file
56
templates/single-product/tabs/tabs.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product tabs
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.8.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter tabs and allow third parties to add their own.
|
||||
*
|
||||
* Each tab is an array containing title, callback and priority.
|
||||
*
|
||||
* @see woocommerce_default_product_tabs()
|
||||
*/
|
||||
$product_tabs = apply_filters( 'woocommerce_product_tabs', array() );
|
||||
|
||||
if ( ! empty( $product_tabs ) ) : ?>
|
||||
|
||||
<div class="woocommerce-tabs wc-tabs-wrapper">
|
||||
<ul class="tabs wc-tabs" role="tablist">
|
||||
<?php foreach ( $product_tabs as $key => $product_tab ) : ?>
|
||||
<li class="<?php echo esc_attr( $key ); ?>_tab" id="tab-title-<?php echo esc_attr( $key ); ?>" role="tab" aria-controls="tab-<?php echo esc_attr( $key ); ?>">
|
||||
<a href="#tab-<?php echo esc_attr( $key ); ?>">
|
||||
<?php echo wp_kses_post( apply_filters( 'woocommerce_product_' . $key . '_tab_title', $product_tab['title'], $key ) ); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php foreach ( $product_tabs as $key => $product_tab ) : ?>
|
||||
<div class="woocommerce-Tabs-panel woocommerce-Tabs-panel--<?php echo esc_attr( $key ); ?> panel entry-content wc-tab" id="tab-<?php echo esc_attr( $key ); ?>" role="tabpanel" aria-labelledby="tab-title-<?php echo esc_attr( $key ); ?>">
|
||||
<?php
|
||||
if ( isset( $product_tab['callback'] ) ) {
|
||||
call_user_func( $product_tab['callback'], $key, $product_tab );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_product_after_tabs' ); ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
22
templates/single-product/title.php
Normal file
22
templates/single-product/title.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product title
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/title.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 1.6.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
the_title( '<h1 class="product_title entry-title">', '</h1>' );
|
54
templates/single-product/up-sells.php
Normal file
54
templates/single-product/up-sells.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Up-Sells
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/up-sells.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $upsells ) : ?>
|
||||
|
||||
<section class="up-sells upsells products">
|
||||
<?php
|
||||
$heading = apply_filters( 'woocommerce_product_upsells_products_heading', __( 'You may also like…', 'woocommerce' ) );
|
||||
|
||||
if ( $heading ) :
|
||||
?>
|
||||
<h2><?php echo esc_html( $heading ); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php woocommerce_product_loop_start(); ?>
|
||||
|
||||
<?php foreach ( $upsells as $upsell ) : ?>
|
||||
|
||||
<?php
|
||||
$post_object = get_post( $upsell->get_id() );
|
||||
|
||||
setup_postdata( $GLOBALS['post'] =& $post_object ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, Squiz.PHP.DisallowMultipleAssignments.Found
|
||||
|
||||
wc_get_template_part( 'content', 'product' );
|
||||
?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php woocommerce_product_loop_end(); ?>
|
||||
|
||||
</section>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
Reference in New Issue
Block a user