first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Add to wishlist button template
|
||||
*
|
||||
* @author Your Inspiration Themes
|
||||
* @package YITH WooCommerce Wishlist
|
||||
* @version 2.0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'YITH_WCWL' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
global $product;
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( add_query_arg( 'add_to_wishlist', $product_id ) ); ?>" rel="nofollow" data-product-id="<?php echo $product_id; ?>" data-product-type="<?php echo $product_type; ?>" class="<?php echo $link_classes; ?>" >
|
||||
<?php echo $icon; ?>
|
||||
<?php echo $label; ?>
|
||||
</a>
|
||||
<img src="<?php echo esc_url( OCEANWP_THEME_URI . '/assets/img/wishlist-loader.svg' ); ?>" class="ajax-loading" alt="loading" width="16" height="16" />
|
||||
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/**
|
||||
* Mini-cart
|
||||
*
|
||||
* Contains the markup for the mini-cart, used by the cart widget.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/cart/mini-cart.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.7.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
do_action( 'woocommerce_before_mini_cart' ); ?>
|
||||
|
||||
<?php if ( ! WC()->cart->is_empty() ) : ?>
|
||||
|
||||
<ul class="woocommerce-mini-cart cart_list product_list_widget <?php echo esc_attr( $args['list_class'] ); ?>">
|
||||
<?php
|
||||
do_action( 'woocommerce_before_mini_cart_contents' );
|
||||
|
||||
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
|
||||
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
|
||||
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
|
||||
|
||||
if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
|
||||
$product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key );
|
||||
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
|
||||
$product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
|
||||
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
|
||||
?>
|
||||
<li class="woocommerce-mini-cart-item <?php echo esc_attr( apply_filters( 'woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key ) ); ?>">
|
||||
<div class="owp-grid-wrap">
|
||||
<div class="owp-grid thumbnail">
|
||||
<?php if ( ! $_product->is_visible() ) : ?>
|
||||
<?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ); ?>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url( $product_permalink ); ?>">
|
||||
<?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="owp-grid content">
|
||||
<div>
|
||||
<?php if ( empty( $product_permalink ) ) : ?>
|
||||
<h3>
|
||||
<?php echo $product_name; ?>
|
||||
</h3>
|
||||
<?php else : ?>
|
||||
<h3>
|
||||
<a href="<?php echo esc_url( $product_permalink ); ?>">
|
||||
<?php echo $product_name; ?>
|
||||
</a>
|
||||
</h3>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo wc_get_formatted_cart_item_data( $cart_item ); ?>
|
||||
|
||||
<?php echo apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf( '%s × %s', $cart_item['quantity'], $product_price ) . '</span>', $cart_item, $cart_item_key ); ?>
|
||||
<?php
|
||||
echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
|
||||
'<a href="%s" class="remove remove_from_cart_button" aria-label="%s" data-product_id="%s" data-cart_item_key="%s" data-product_sku="%s">×</a>',
|
||||
esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
|
||||
__( 'Remove this item', 'oceanwp' ),
|
||||
esc_attr( $product_id ),
|
||||
esc_attr( $cart_item_key ),
|
||||
esc_attr( $_product->get_sku() )
|
||||
),
|
||||
$cart_item_key
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_mini_cart_contents' );
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<p class="woocommerce-mini-cart__total total">
|
||||
<?php
|
||||
/**
|
||||
* Woocommerce_widget_shopping_cart_total hook.
|
||||
*
|
||||
* @hooked woocommerce_widget_shopping_cart_subtotal - 10
|
||||
*/
|
||||
do_action( 'woocommerce_widget_shopping_cart_total' );
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'woocommerce_widget_shopping_cart_before_buttons' ); ?>
|
||||
|
||||
<p class="woocommerce-mini-cart__buttons buttons"><?php do_action( 'woocommerce_widget_shopping_cart_buttons' ); ?></p>
|
||||
|
||||
<?php do_action( 'woocommerce_widget_shopping_cart_after_buttons' ); ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<p class="woocommerce-mini-cart__empty-message"><?php esc_html_e( 'No products in the cart.', 'oceanwp' ); ?></p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_mini_cart' ); ?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Multi-step checkout timeline template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
// Vars.
|
||||
$i = 0;
|
||||
|
||||
$enable_login_reminder = 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder', 'yes' ) ? true : false;
|
||||
$is_logged_in = is_user_logged_in();
|
||||
$show_login_step = ! $is_logged_in && $enable_login_reminder;
|
||||
|
||||
// Style.
|
||||
$style = get_theme_mod( 'ocean_woo_multi_step_checkout_timeline_style', 'arrow' );
|
||||
$style = $style ? $style : 'arrow';
|
||||
|
||||
// Define classes.
|
||||
$classes = array( 'owp-woo-checkout-timeline', 'clr' );
|
||||
|
||||
// Style.
|
||||
$classes[] = $style;
|
||||
|
||||
// If login.
|
||||
if ( $show_login_step ) {
|
||||
$classes[] = 'step-4';
|
||||
}
|
||||
|
||||
// Turn classes into string.
|
||||
$classes = implode( ' ', $classes ); ?>
|
||||
|
||||
<ul id="owp-checkout-timeline" class="<?php echo esc_attr( $classes ); ?>">
|
||||
|
||||
<?php if ( $show_login_step ) { ?>
|
||||
<li id="timeline-0" data-step="0" class="timeline login <?php echo ! $is_logged_in ? 'active' : ''; ?>">
|
||||
<div class="timeline-wrapper">
|
||||
<span class="timeline-step"><?php echo $i = $i + 1 ?>.</span>
|
||||
<span class="timeline-label"><?php esc_html_e( 'Login', 'oceanwp' ); ?></span>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<li id="timeline-1" data-step="1" class="timeline billing <?php echo ! $show_login_step ? 'active' : ''; ?>">
|
||||
<div class="timeline-wrapper">
|
||||
<span class="timeline-step"><?php echo $i = $i + 1 ?>.</span>
|
||||
<span class="timeline-label"><?php esc_html_e( 'Billing', 'oceanwp' ); ?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id="timeline-2" data-step="2" class="timeline shipping" >
|
||||
<div class="timeline-wrapper">
|
||||
<span class="timeline-step"><?php echo $i = $i + 1 ?>.</span>
|
||||
<span class="timeline-label"><?php esc_html_e( 'Shipping', 'oceanwp' ); ?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id="timeline-3" data-step="3" class="timeline payment">
|
||||
<div class="timeline-wrapper">
|
||||
<span class="timeline-step"><?php echo $i = $i + 1 ?>.</span>
|
||||
<span class="timeline-label"><?php esc_html_e( 'Payment Info', 'oceanwp' ); ?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout Form, for multi-step checkout
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.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/
|
||||
* @author WooThemes
|
||||
* @package WooCommerce/Templates
|
||||
* @version 2.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$enable_login_reminder = 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder', 'yes' );
|
||||
$is_logged_in = is_user_logged_in();
|
||||
$show_login_step = ! $is_logged_in && $enable_login_reminder;
|
||||
$login_message = apply_filters( 'ocean_form_checkout_login_message', __( 'If you have already registered, please, enter your details in the boxes below. If you are a new customer, please, go to the Billing & Shipping section.', 'oceanwp' ) );
|
||||
|
||||
// Back cart icon.
|
||||
if ( is_RTL() ) {
|
||||
$icon = 'fa-angle-right';
|
||||
} else {
|
||||
$icon = 'fa-angle-left';
|
||||
}
|
||||
|
||||
wc_print_notices();
|
||||
|
||||
do_action( 'woocommerce_before_checkout_form', $checkout ); ?>
|
||||
|
||||
<div id="checkout-wrapper">
|
||||
<div id="checkout_coupon" class="woocommerce_checkout_coupon">
|
||||
<?php do_action( 'ocean_woocommerce_checkout_coupon', $checkout ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $enable_login_reminder ) { ?>
|
||||
<div id="checkout_login" class="woocommerce_checkout_login">
|
||||
<?php do_action( 'ocean_checkout_login_form', $login_message ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
// If checkout registration is disabled and not logged in, the user cannot checkout
|
||||
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
|
||||
echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in before proceeding to checkout.', 'oceanwp' ) );
|
||||
return;
|
||||
} ?>
|
||||
|
||||
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
|
||||
|
||||
<?php if ( sizeof( $checkout->checkout_fields ) > 0 ) { ?>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
|
||||
|
||||
<div class="checkout_billing <?php echo $is_logged_in ? 'logged-in' : 'not-logged-in'; echo $enable_login_reminder ? ' show-login-reminder' : ' hide-login-reminder'; ?>" id="customer_billing_details">
|
||||
<?php do_action( 'woocommerce_checkout_billing' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="checkout_shipping" id="customer_shipping_details">
|
||||
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
|
||||
|
||||
<div id="order_review" class="woocommerce-checkout-review-order">
|
||||
<div id="order_info" class="woocommerce-checkout-review-order">
|
||||
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
|
||||
<?php do_action( 'ocean_woocommerce_checkout_order_review' ); ?>
|
||||
</div>
|
||||
|
||||
<div id="order_checkout_payment" class="owp-woocommerce-checkout-payment">
|
||||
<?php do_action( 'ocean_woocommerce_checkout_payment' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<div id="form_actions" data-step="<?php echo $show_login_step ? 0 : 1; ?>">
|
||||
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>"><i class="fa <?php echo esc_attr( $icon ); ?>"></i><?php esc_html_e( 'Back to cart', 'oceanwp' ); ?></a>
|
||||
|
||||
<div class="buttons">
|
||||
<input type="button" class="button prev" name="checkout_prev_step" value="<?php esc_attr_e( 'Prev', 'oceanwp' ); ?>" data-action="prev">
|
||||
<input type="button" class="button next" name="checkout_next_step" value="<?php echo $enable_login_reminder && ! is_user_logged_in() ? esc_html_e( 'I don’t have an account', 'oceanwp' ) : esc_html_e( 'Next', 'oceanwp' ); ?>" data-action="next">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying product content in the single-product.php template
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/content-single-product.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;
|
||||
|
||||
global $product;
|
||||
|
||||
/**
|
||||
* Hook: woocommerce_before_single_product.
|
||||
*
|
||||
* @hooked wc_print_notices - 10
|
||||
*/
|
||||
do_action( 'woocommerce_before_single_product' );
|
||||
|
||||
if ( post_password_required() ) {
|
||||
echo get_the_password_form(); // WPCS: XSS ok.
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="product-<?php the_ID(); ?>" <?php wc_product_class( '', $product ); ?>>
|
||||
|
||||
<?php
|
||||
// Elementor `single` location.
|
||||
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'single' ) ) {
|
||||
|
||||
/**
|
||||
* Hook: woocommerce_before_single_product_summary.
|
||||
*
|
||||
* @hooked woocommerce_show_product_sale_flash - 10
|
||||
* @hooked woocommerce_show_product_images - 20
|
||||
*/
|
||||
do_action( 'woocommerce_before_single_product_summary' );
|
||||
?>
|
||||
|
||||
<div class="summary entry-summary">
|
||||
<?php
|
||||
/**
|
||||
* Hook: woocommerce_single_product_summary.
|
||||
*
|
||||
* @hooked woocommerce_template_single_title - 5
|
||||
* @hooked woocommerce_template_single_rating - 10
|
||||
* @hooked woocommerce_template_single_price - 10
|
||||
* @hooked woocommerce_template_single_excerpt - 20
|
||||
* @hooked woocommerce_template_single_add_to_cart - 30
|
||||
* @hooked woocommerce_template_single_meta - 40
|
||||
* @hooked woocommerce_template_single_sharing - 50
|
||||
* @hooked WC_Structured_Data::generate_product_data() - 60
|
||||
*/
|
||||
do_action( 'woocommerce_single_product_summary' );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Hook: woocommerce_after_single_product_summary.
|
||||
*
|
||||
* @hooked woocommerce_output_product_data_tabs - 10
|
||||
* @hooked woocommerce_upsell_display - 15
|
||||
* @hooked woocommerce_output_related_products - 20
|
||||
*/
|
||||
do_action( 'woocommerce_after_single_product_summary' );
|
||||
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_after_single_product' ); ?>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Product Loop Start
|
||||
*
|
||||
* @author WooThemes
|
||||
* @package WooCommerce/Templates
|
||||
* @version 9999
|
||||
*/
|
||||
|
||||
// Classes.
|
||||
$wrap_classes = array( 'products', 'oceanwp-row', 'clr' );
|
||||
|
||||
// List/grid style.
|
||||
if ( ( oceanwp_is_woo_shop() || oceanwp_is_woo_tax() )
|
||||
&& get_theme_mod( 'ocean_woo_grid_list', true )
|
||||
&& 'list' === get_theme_mod( 'ocean_woo_catalog_view', 'grid' ) ) {
|
||||
$wrap_classes[] = 'list';
|
||||
} else {
|
||||
$wrap_classes[] = 'grid';
|
||||
}
|
||||
|
||||
// Responsive columns.
|
||||
$tablet_columns = get_theme_mod( 'ocean_woocommerce_tablet_shop_columns' );
|
||||
$mobile_columns = get_theme_mod( 'ocean_woocommerce_mobile_shop_columns' );
|
||||
|
||||
if ( ! empty( $tablet_columns ) ) {
|
||||
$wrap_classes[] = 'tablet-col';
|
||||
$wrap_classes[] = 'tablet-' . $tablet_columns . '-col';
|
||||
}
|
||||
if ( ! empty( $mobile_columns ) ) {
|
||||
$wrap_classes[] = 'mobile-col';
|
||||
$wrap_classes[] = 'mobile-' . $mobile_columns . '-col';
|
||||
}
|
||||
|
||||
// If infinite scroll.
|
||||
if ( 'infinite_scroll' === get_theme_mod( 'ocean_woo_pagination_style', 'standard' ) ) {
|
||||
$wrap_classes[] = 'infinite-scroll-wrap';
|
||||
}
|
||||
|
||||
$wrap_classes = implode( ' ', $wrap_classes ); ?>
|
||||
|
||||
<ul class="<?php echo esc_attr( $wrap_classes ); ?>">
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Image Swap style thumbnail
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Return placeholder if there isn't a thumbnail defined.
|
||||
if ( ! has_post_thumbnail() ) {
|
||||
oceanwp_woo_placeholder_img();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get global product data.
|
||||
global $product;
|
||||
|
||||
// Get featured image.
|
||||
$attachment = $product->get_image_id();
|
||||
|
||||
// Image args.
|
||||
$img_args = array(
|
||||
'class' => 'woo-entry-image-main',
|
||||
'alt' => get_the_title(),
|
||||
);
|
||||
if ( oceanwp_get_schema_markup( 'image' ) ) {
|
||||
$img_args['itemprop'] = 'image';
|
||||
}
|
||||
|
||||
// Display featured image if defined.
|
||||
if ( $attachment ) {
|
||||
?>
|
||||
|
||||
<div class="woo-entry-image clr">
|
||||
<?php do_action( 'ocean_before_product_entry_image' ); ?>
|
||||
<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
|
||||
<?php
|
||||
// Single Image.
|
||||
echo wp_get_attachment_image( $attachment, 'shop_catalog', '', $img_args );
|
||||
?>
|
||||
</a>
|
||||
<?php do_action( 'ocean_after_product_entry_image' ); ?>
|
||||
</div><!-- .woo-entry-image -->
|
||||
|
||||
<?php
|
||||
} else {
|
||||
// Display placeholder.
|
||||
?>
|
||||
|
||||
<div class="woo-entry-image clr">
|
||||
<?php do_action( 'ocean_before_product_entry_image' ); ?>
|
||||
<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
|
||||
<?php echo '<img src="' . esc_url( wc_placeholder_img_src() ) . '" alt="' . esc_html__( 'Placeholder Image', 'oceanwp' ) . '" class="woo-entry-image-main" />'; ?>
|
||||
</a>
|
||||
<?php do_action( 'ocean_after_product_entry_image' ); ?>
|
||||
</div><!-- .woo-entry-image -->
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* Gallery Style WooCommerce
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Return dummy image if no featured image is defined.
|
||||
if ( ! has_post_thumbnail() ) {
|
||||
oceanwp_woo_placeholder_img();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get global product data.
|
||||
global $product;
|
||||
|
||||
// Get featured image.
|
||||
$thumbnail_id = $product->get_image_id();
|
||||
|
||||
// Get gallery images.
|
||||
if ( version_compare( OceanWP_WooCommerce_Config::get_wc_version(), '2.7', '>=' ) ) {
|
||||
$attachment_ids = $product->get_gallery_image_ids();
|
||||
} else {
|
||||
$attachment_ids = $product->get_gallery_attachment_ids();
|
||||
}
|
||||
|
||||
// Get attachments count.
|
||||
$attachments_count = count( $attachment_ids );
|
||||
|
||||
// Image args.
|
||||
$img_args = array(
|
||||
'alt' => get_the_title(),
|
||||
);
|
||||
if ( oceanwp_get_schema_markup( 'image' ) ) {
|
||||
$img_args['itemprop'] = 'image';
|
||||
}
|
||||
|
||||
// If there are attachments display slider.
|
||||
if ( $attachment_ids ) : ?>
|
||||
|
||||
<div class="product-entry-slider-wrap">
|
||||
|
||||
<?php do_action( 'ocean_before_product_entry_slider' ); ?>
|
||||
|
||||
<div class="product-entry-slider woo-entry-image clr">
|
||||
|
||||
<?php do_action( 'ocean_before_product_entry_image' ); ?>
|
||||
|
||||
<?php
|
||||
// Define counter variable.
|
||||
$count = 0;
|
||||
|
||||
if ( has_post_thumbnail() ) :
|
||||
?>
|
||||
|
||||
<div class="oceanwp-slider-slide">
|
||||
<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
|
||||
<?php
|
||||
echo wp_get_attachment_image( $thumbnail_id, 'shop_catalog', '', $img_args );
|
||||
?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if ( $attachments_count > 0 ) :
|
||||
|
||||
// Loop through images.
|
||||
foreach ( $attachment_ids as $attachment_id ) :
|
||||
|
||||
// Add to counter.
|
||||
$count++;
|
||||
|
||||
// Only display the first 5 images.
|
||||
if ( $count < 5 ) :
|
||||
?>
|
||||
|
||||
<div class="oceanwp-slider-slide">
|
||||
<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
|
||||
<?php
|
||||
echo wp_get_attachment_image( $attachment_id, 'shop_catalog', '', $img_args );
|
||||
?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
endforeach;
|
||||
|
||||
endif;
|
||||
?>
|
||||
|
||||
<?php do_action( 'ocean_after_product_entry_image' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php do_action( 'ocean_after_product_entry_slider' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// There aren't any images so lets display the featured image.
|
||||
else :
|
||||
|
||||
wc_get_template( 'loop/thumbnail/featured-image.php' );
|
||||
|
||||
endif;
|
||||
?>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* Image Swap style thumbnail
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Return dummy image if no featured image is defined.
|
||||
if ( ! has_post_thumbnail() ) {
|
||||
oceanwp_woo_placeholder_img();
|
||||
return;
|
||||
}
|
||||
|
||||
// Globals.
|
||||
global $product;
|
||||
|
||||
// Get first image.
|
||||
$attachment = $product->get_image_id();
|
||||
|
||||
// Get Second Image in Gallery.
|
||||
if ( version_compare( OceanWP_WooCommerce_Config::get_wc_version(), '2.7', '>=' ) ) {
|
||||
$attachment_ids = $product->get_gallery_image_ids();
|
||||
} else {
|
||||
$attachment_ids = $product->get_gallery_attachment_ids();
|
||||
}
|
||||
$attachment_ids[] = $attachment; // Add featured image to the array.
|
||||
$secondary_img_id = '';
|
||||
|
||||
if ( ! empty( $attachment_ids ) ) {
|
||||
$attachment_ids = array_unique( $attachment_ids ); // remove duplicate images.
|
||||
if ( count( $attachment_ids ) > '1' ) {
|
||||
if ( $attachment_ids['0'] !== $attachment ) {
|
||||
$secondary_img_id = $attachment_ids['0'];
|
||||
} elseif ( $attachment_ids['1'] !== $attachment ) {
|
||||
$secondary_img_id = $attachment_ids['1'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Image args.
|
||||
$first_img = array(
|
||||
'class' => 'woo-entry-image-main',
|
||||
'alt' => get_the_title(),
|
||||
);
|
||||
if ( oceanwp_get_schema_markup( 'image' ) ) {
|
||||
$first_img['itemprop'] = 'image';
|
||||
}
|
||||
|
||||
$second_img = array(
|
||||
'class' => 'woo-entry-image-secondary',
|
||||
'alt' => get_the_title(),
|
||||
);
|
||||
if ( oceanwp_get_schema_markup( 'image' ) ) {
|
||||
$second_img['itemprop'] = 'image';
|
||||
}
|
||||
|
||||
|
||||
// Return thumbnail.
|
||||
if ( $secondary_img_id ) : ?>
|
||||
|
||||
<div class="woo-entry-image-swap woo-entry-image clr">
|
||||
<?php do_action( 'ocean_before_product_entry_image' ); ?>
|
||||
<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
|
||||
<?php
|
||||
// Main Image.
|
||||
echo wp_get_attachment_image( $attachment, 'shop_catalog', '', $first_img );
|
||||
|
||||
// Secondary Image.
|
||||
echo wp_get_attachment_image( $secondary_img_id, 'shop_catalog', '', $second_img );
|
||||
?>
|
||||
</a>
|
||||
<?php do_action( 'ocean_after_product_entry_image' ); ?>
|
||||
</div><!-- .woo-entry-image-swap -->
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="woo-entry-image clr">
|
||||
<?php do_action( 'ocean_before_product_entry_image' ); ?>
|
||||
<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
|
||||
<?php
|
||||
// Single Image.
|
||||
echo wp_get_attachment_image( $attachment, 'shop_catalog', '', $first_img );
|
||||
?>
|
||||
</a>
|
||||
<?php do_action( 'ocean_after_product_entry_image' ); ?>
|
||||
</div><!-- .woo-entry-image -->
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* Archive product hover style template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
global $product, $post;
|
||||
|
||||
do_action( 'ocean_before_archive_product_item' );
|
||||
|
||||
echo '<ul class="woo-entry-inner clr">';
|
||||
|
||||
echo '<li class="image-wrap">';
|
||||
|
||||
do_action( 'ocean_before_archive_product_image' );
|
||||
|
||||
if ( class_exists( 'OceanWP_WooCommerce_Config' ) ) {
|
||||
OceanWP_WooCommerce_Config::add_out_of_stock_badge();
|
||||
}
|
||||
|
||||
woocommerce_show_product_loop_sale_flash();
|
||||
|
||||
if ( function_exists( 'wc_get_template' ) ) {
|
||||
wc_get_template( 'loop/thumbnail/featured-image.php' );
|
||||
}
|
||||
|
||||
do_action( 'ocean_before_archive_product_add_to_cart_inner' );
|
||||
woocommerce_template_loop_add_to_cart();
|
||||
do_action( 'ocean_after_archive_product_add_to_cart_inner' );
|
||||
|
||||
|
||||
if ( get_theme_mod( 'ocean_woo_quick_view', true )
|
||||
|| class_exists( 'TInvWL_Wishlist' ) ) {
|
||||
echo '<ul class="woo-entry-buttons">';
|
||||
do_action( 'ocean_before_archive_woo_entry_buttons' );
|
||||
if ( get_theme_mod( 'ocean_woo_quick_view', true ) ) {
|
||||
echo '<li class="woo-quickview-btn">' . apply_filters( 'ocean_woo_quick_view_button_html', '<a href="#" class="owp-quick-view" id="product_id_' . $product->get_id() . '" data-product_id="' . $product->get_id() . '"><i class="icon-eye"></i></a>' ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
if ( class_exists( 'TInvWL_Wishlist' ) ) {
|
||||
echo '<li class="woo-wishlist-btn">' . do_shortcode( '[ti_wishlists_addtowishlist]' ) . '</li>';
|
||||
}
|
||||
do_action( 'ocean_after_archive_woo_entry_buttons' );
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
do_action( 'ocean_after_archive_product_image' );
|
||||
|
||||
echo '</li>';
|
||||
|
||||
echo '<ul class="woo-product-info">';
|
||||
|
||||
do_action( 'ocean_before_archive_product_categories' );
|
||||
echo wp_kses_post( wc_get_product_category_list( $product->get_id(), ', ', '<li class="category">', '</li>' ) );
|
||||
do_action( 'ocean_after_archive_product_categories' );
|
||||
|
||||
do_action( 'ocean_before_archive_product_title' );
|
||||
|
||||
echo '<li class="title">';
|
||||
do_action( 'ocean_before_archive_product_title_inner' );
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '">' . esc_html( get_the_title() ) . '</a>';
|
||||
do_action( 'ocean_after_archive_product_title_inner' );
|
||||
echo '</li>';
|
||||
|
||||
do_action( 'ocean_after_archive_product_title' );
|
||||
|
||||
do_action( 'ocean_before_archive_product_inner' );
|
||||
|
||||
echo '<li class="price-wrap">';
|
||||
do_action( 'ocean_before_archive_product_price' );
|
||||
woocommerce_template_loop_price();
|
||||
do_action( 'ocean_after_archive_product_price' );
|
||||
echo '</li>';
|
||||
|
||||
if ( $product->get_rating_count() ) {
|
||||
echo '<li class="rating">';
|
||||
do_action( 'ocean_before_archive_product_rating' );
|
||||
woocommerce_template_loop_rating();
|
||||
do_action( 'ocean_after_archive_product_rating' );
|
||||
echo '</li>';
|
||||
}
|
||||
|
||||
do_action( 'ocean_after_archive_product_inner' );
|
||||
|
||||
do_action( 'ocean_before_archive_product_description' );
|
||||
|
||||
if ( ( oceanwp_is_woo_shop() || oceanwp_is_woo_tax() )
|
||||
&& get_theme_mod( 'ocean_woo_grid_list', true ) ) {
|
||||
$length = get_theme_mod( 'ocean_woo_list_excerpt_length', '60' );
|
||||
echo '<li class="woo-desc">';
|
||||
if ( ! $length ) {
|
||||
echo wp_kses_post( strip_shortcodes( $post->post_excerpt ) );
|
||||
} else {
|
||||
echo wp_trim_words( strip_shortcodes( $post->post_excerpt ), $length ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
echo '</li>';
|
||||
}
|
||||
|
||||
do_action( 'ocean_after_archive_product_description' );
|
||||
|
||||
echo '</ul>';
|
||||
|
||||
if ( function_exists( 'wc_get_template' ) ) {
|
||||
wc_get_template( 'owp-archive-product-thumbnails.php' );
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
||||
do_action( 'ocean_after_archive_product_item' );
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* Archive product thumbnails for the hover style.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
// Get global product data.
|
||||
global $product;
|
||||
|
||||
// Get first image.
|
||||
$thumbnail_id = get_post_thumbnail_id();
|
||||
|
||||
// Get gallery images.
|
||||
$attachment_ids = $product->get_gallery_image_ids();
|
||||
|
||||
// Get attachments count.
|
||||
$attachments_count = count( $attachment_ids );
|
||||
|
||||
// Image args.
|
||||
$img_args = array(
|
||||
'alt' => get_the_title(),
|
||||
);
|
||||
if ( oceanwp_get_schema_markup( 'image' ) ) {
|
||||
$img_args['itemprop'] = 'image';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<ul class="woo-product-gallery">
|
||||
|
||||
<?php do_action( 'ocean_before_hover_product_gallery' ); ?>
|
||||
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) :
|
||||
$thumbnail_url = wp_get_attachment_image_src( $thumbnail_id, 'shop_catalog' )[0];
|
||||
?>
|
||||
|
||||
<li class="active">
|
||||
<a href="<?php echo esc_url( $thumbnail_url ); ?>" class="woo-product-gallery-link no-lightbox">
|
||||
<?php
|
||||
echo wp_get_attachment_image( $thumbnail_id, 'thumbnail', '', $img_args );
|
||||
?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if ( $attachment_ids ) :
|
||||
|
||||
// Define counter variable.
|
||||
$count = 0;
|
||||
|
||||
if ( $attachments_count > 0 ) :
|
||||
|
||||
// Loop through images.
|
||||
foreach ( $attachment_ids as $attachment_id ) :
|
||||
$attachment_url = wp_get_attachment_image_src( $attachment_id, 'shop_catalog' )[0];
|
||||
|
||||
// Add to counter.
|
||||
$count++;
|
||||
|
||||
// Only display the first 5 images.
|
||||
if ( $count < 5 ) :
|
||||
?>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo esc_url( $attachment_url ); ?>" class="woo-product-gallery-link no-lightbox">
|
||||
<?php
|
||||
echo wp_get_attachment_image( $attachment_id, 'thumbnail', '', $img_args );
|
||||
?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
endforeach;
|
||||
|
||||
endif;
|
||||
|
||||
endif;
|
||||
?>
|
||||
|
||||
<?php do_action( 'ocean_after_hover_product_gallery' ); ?>
|
||||
|
||||
</ul>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/**
|
||||
* Archive product template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
global $product, $post;
|
||||
|
||||
do_action( 'ocean_before_archive_product_item' );
|
||||
|
||||
echo '<ul class="woo-entry-inner clr">';
|
||||
|
||||
// Get elements.
|
||||
$elements = oceanwp_woo_product_elements_positioning();
|
||||
|
||||
// Loop through elements.
|
||||
foreach ( $elements as $element ) {
|
||||
|
||||
// Image.
|
||||
if ( 'image' === $element ) {
|
||||
|
||||
echo '<li class="image-wrap">';
|
||||
|
||||
do_action( 'ocean_before_archive_product_image' );
|
||||
if ( class_exists( 'OceanWP_WooCommerce_Config' ) ) {
|
||||
OceanWP_WooCommerce_Config::add_out_of_stock_badge();
|
||||
}
|
||||
woocommerce_show_product_loop_sale_flash();
|
||||
if ( class_exists( 'OceanWP_WooCommerce_Config' ) ) {
|
||||
OceanWP_WooCommerce_Config::loop_product_thumbnail();
|
||||
}
|
||||
do_action( 'ocean_after_archive_product_image' );
|
||||
|
||||
echo '</li>';
|
||||
|
||||
}
|
||||
|
||||
// Category.
|
||||
if ( 'category' === $element ) {
|
||||
|
||||
do_action( 'ocean_before_archive_product_categories' );
|
||||
echo wp_kses_post( wc_get_product_category_list( $product->get_id(), ', ', '<li class="category">', '</li>' ) );
|
||||
do_action( 'ocean_after_archive_product_categories' );
|
||||
|
||||
}
|
||||
|
||||
// Title.
|
||||
if ( 'title' === $element ) {
|
||||
|
||||
do_action( 'ocean_before_archive_product_title' );
|
||||
|
||||
echo '<li class="title">';
|
||||
do_action( 'ocean_before_archive_product_title_inner' );
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '">' . esc_html( get_the_title() ) . '</a>';
|
||||
do_action( 'ocean_after_archive_product_title_inner' );
|
||||
echo '</li>';
|
||||
|
||||
do_action( 'ocean_after_archive_product_title' );
|
||||
|
||||
}
|
||||
|
||||
// Price/Rating.
|
||||
if ( 'price-rating' === $element ) {
|
||||
|
||||
do_action( 'ocean_before_archive_product_inner' );
|
||||
|
||||
echo '<li class="inner">';
|
||||
do_action( 'ocean_before_archive_product_price' );
|
||||
woocommerce_template_loop_price();
|
||||
do_action( 'ocean_before_archive_product_rating' );
|
||||
woocommerce_template_loop_rating();
|
||||
do_action( 'ocean_after_archive_product_rating' );
|
||||
echo '</li>';
|
||||
|
||||
do_action( 'ocean_after_archive_product_inner' );
|
||||
|
||||
}
|
||||
|
||||
// Description.
|
||||
if ( 'description' === $element ) {
|
||||
|
||||
do_action( 'ocean_before_archive_product_description' );
|
||||
|
||||
if ( ( oceanwp_is_woo_shop() || oceanwp_is_woo_tax() )
|
||||
&& get_theme_mod( 'ocean_woo_grid_list', true ) ) {
|
||||
$length = get_theme_mod( 'ocean_woo_list_excerpt_length', '60' );
|
||||
echo '<li class="woo-desc">';
|
||||
if ( ! $length ) {
|
||||
echo wp_kses_post( strip_shortcodes( $post->post_excerpt ) );
|
||||
} else {
|
||||
echo wp_trim_words( strip_shortcodes( $post->post_excerpt ), $length ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
echo '</li>';
|
||||
}
|
||||
|
||||
do_action( 'ocean_after_archive_product_description' );
|
||||
|
||||
}
|
||||
|
||||
// Add to cart button.
|
||||
if ( 'button' === $element ) {
|
||||
|
||||
do_action( 'ocean_before_archive_product_add_to_cart' );
|
||||
|
||||
echo '<li class="btn-wrap clr">';
|
||||
|
||||
do_action( 'ocean_before_archive_product_add_to_cart_inner' );
|
||||
|
||||
woocommerce_template_loop_add_to_cart();
|
||||
|
||||
|
||||
do_action( 'ocean_after_archive_product_add_to_cart_inner' );
|
||||
|
||||
echo '</li>';
|
||||
|
||||
do_action( 'ocean_after_archive_product_add_to_cart' );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
||||
do_action( 'ocean_after_archive_product_item' );
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Off Canvas sidebar template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
} ?>
|
||||
|
||||
<div id="oceanwp-off-canvas-sidebar-wrap">
|
||||
<div class="oceanwp-off-canvas-sidebar">
|
||||
<?php dynamic_sidebar( 'owp_off_canvas_sidebar' ); ?>
|
||||
<?php
|
||||
if ( true === get_theme_mod( 'ocean_woo_off_canvas_close_button', false ) ) {
|
||||
?>
|
||||
<button type="button" class="oceanwp-off-canvas-close" aria-label="<?php echo esc_attr__( 'Close off canvas panel', 'oceanwp' ); ?>">
|
||||
<svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512" xml:space="preserve" role="img" aria-hidden="true" focusable="false">
|
||||
<path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249
|
||||
C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306
|
||||
C514.019,27.23,514.019,14.135,505.943,6.058z"/>
|
||||
<path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636
|
||||
c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="oceanwp-off-canvas-overlay"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Single product template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
// Get elements.
|
||||
$elements = oceanwp_woo_summary_elements_positioning();
|
||||
|
||||
// Loop through elements.
|
||||
foreach ( $elements as $element ) {
|
||||
|
||||
do_action( 'ocean_before_single_product_' . $element );
|
||||
|
||||
// Title.
|
||||
if ( 'title' === $element ) {
|
||||
woocommerce_template_single_title();
|
||||
}
|
||||
|
||||
// Rating.
|
||||
if ( 'rating' === $element ) {
|
||||
woocommerce_template_single_rating();
|
||||
}
|
||||
|
||||
// Price.
|
||||
if ( 'price' === $element ) {
|
||||
woocommerce_template_single_price();
|
||||
}
|
||||
|
||||
// Excerpt.
|
||||
if ( 'excerpt' === $element ) {
|
||||
woocommerce_template_single_excerpt();
|
||||
}
|
||||
|
||||
// Quantity & Add to cart button.
|
||||
if ( 'quantity-button' === $element ) {
|
||||
woocommerce_template_single_add_to_cart();
|
||||
}
|
||||
|
||||
// Meta.
|
||||
if ( 'meta' === $element ) {
|
||||
woocommerce_template_single_meta();
|
||||
}
|
||||
|
||||
do_action( 'ocean_after_single_product_' . $element );
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Quick view template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
while ( have_posts() ) :
|
||||
the_post(); ?>
|
||||
|
||||
<div id="product-<?php the_ID(); ?>" <?php post_class( 'product' ); ?>>
|
||||
<?php do_action( 'ocean_woo_quick_view_product_image' ); ?>
|
||||
<div class="summary entry-summary">
|
||||
<div class="summary-content">
|
||||
<?php do_action( 'ocean_woo_quick_view_product_content' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endwhile;
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Quick view image template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
global $post, $product, $woocommerce; ?>
|
||||
|
||||
<div class="owp-qv-image flexslider images">
|
||||
<ul class="owp-qv-slides slides">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) {
|
||||
$attachment_ids = $product->get_gallery_image_ids();
|
||||
$props = wc_get_product_attachment_props( get_post_thumbnail_id(), $post );
|
||||
$image = get_the_post_thumbnail(
|
||||
$post->ID,
|
||||
'shop_single',
|
||||
array(
|
||||
'title' => $props['title'],
|
||||
'alt' => $props['alt'],
|
||||
)
|
||||
);
|
||||
|
||||
echo sprintf(
|
||||
'<li class="%s">%s</li>',
|
||||
'woocommerce-product-gallery__image',
|
||||
$image // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
);
|
||||
|
||||
if ( $attachment_ids ) {
|
||||
$loop = 0;
|
||||
|
||||
foreach ( $attachment_ids as $attachment_id ) {
|
||||
|
||||
$props = wc_get_product_attachment_props( $attachment_id, $post );
|
||||
|
||||
if ( ! $props['url'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
echo sprintf(
|
||||
'<li class="%s">%s</li>',
|
||||
'woocommerce-product-gallery__image',
|
||||
wp_get_attachment_image( $attachment_id, 'shop_single', 0, $props )
|
||||
);
|
||||
|
||||
$loop++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo sprintf( '<li><img src="%s" alt="%s" /></li>', wc_placeholder_img_src(), __( 'Placeholder', 'oceanwp' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Quick view template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
} ?>
|
||||
|
||||
<div id="owp-qv-wrap">
|
||||
<div class="owp-qv-container">
|
||||
<div class="owp-qv-content-wrap">
|
||||
<div class="owp-qv-content-inner">
|
||||
<a href="#" class="owp-qv-close" aria-label="<?php oceanwp_theme_strings( 'owp-string-woo-quick-view-close', 'oceanwp' ); ?>">×</a>
|
||||
<div id="owp-qv-content" class="woocommerce single-product"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="owp-qv-overlay"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Number of products on shop page
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( is_single() || ! have_posts() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$products_per_page = get_theme_mod( 'ocean_woo_shop_posts_per_page', '12' );
|
||||
|
||||
$num_prod = ( isset( $_GET['products-per-page'] ) ) ? sanitize_text_field( wp_unslash( $_GET['products-per-page'] ) ) : $products_per_page;
|
||||
|
||||
$num_prod_x1 = $products_per_page;
|
||||
$num_prod_x2 = $num_prod_x1 * 2;
|
||||
|
||||
$obj = get_queried_object();
|
||||
$link = '';
|
||||
|
||||
if ( isset( $obj->term_id ) ) {
|
||||
|
||||
$link = get_term_link( $obj->term_id, 'product_cat' );
|
||||
|
||||
if ( is_wp_error( $link ) ) {
|
||||
$link = get_term_link( $obj->term_id, 'product_tag' );
|
||||
}
|
||||
|
||||
if ( is_wp_error( $link ) ) {
|
||||
$link = get_term_link( $obj->term_id, get_term_tax_attr() );
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if ( get_option( 'permalink_structure' ) == '' ) {
|
||||
$link = get_post_type_archive_link( 'product' );
|
||||
} else {
|
||||
$link = get_permalink( wc_get_page_id( 'shop' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter query link for products number
|
||||
*
|
||||
* @since 1.0.8
|
||||
* @param string $link The old query url
|
||||
*/
|
||||
$link = apply_filters( 'ocean_num_products_link', $link );
|
||||
|
||||
if ( ! empty( $_GET ) ) {
|
||||
foreach ( $_GET as $key => $value ){
|
||||
$link = add_query_arg( $key, $value, $link );
|
||||
}
|
||||
} ?>
|
||||
|
||||
<ul class="result-count">
|
||||
<li class="view-title"><?php esc_html_e( 'View:', 'oceanwp' ); ?></li>
|
||||
<li><a class="view-first<?php if ( $num_prod === $num_prod_x1 ) echo ' active'; ?>" href="<?php echo esc_url( add_query_arg( 'products-per-page', $num_prod_x1, $link ) ); ?>"><?php echo esc_html( $num_prod_x1 ); ?></a></li>
|
||||
<li><a class="view-second<?php if ( $num_prod === $num_prod_x2 ) echo ' active'; ?>" href="<?php echo esc_url( add_query_arg( 'products-per-page', $num_prod_x2, $link ) ); ?>"><?php echo esc_html( $num_prod_x2 ); ?></a></li>
|
||||
<li><a class="view-all<?php if ( $num_prod === 'all' ) echo ' active'; ?>" href="<?php echo esc_url( add_query_arg( 'products-per-page', 'all', $link ) ); ?>"><?php esc_html_e( 'All', 'oceanwp' ); ?></a></li>
|
||||
</ul>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Share template
|
||||
*
|
||||
* @author Your Inspiration Themes
|
||||
* @package YITH WooCommerce Wishlist
|
||||
* @version 2.0.13
|
||||
*/
|
||||
|
||||
if ( ! defined( 'YITH_WCWL' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="yith-wcwl-share">
|
||||
<h4 class="yith-wcwl-share-title"><?php echo $share_title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h4>
|
||||
<ul>
|
||||
<?php if ( $share_facebook_enabled ) : ?>
|
||||
<li style="list-style-type: none; display: inline-block;">
|
||||
<a target="_blank" class="facebook" href="https://www.facebook.com/sharer.php?s=100&p%5Btitle%5D=<?php echo $share_link_title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>&p%5Burl%5D=<?php echo urlencode( $share_link_url ); ?>"><i class="fa fa-facebook" aria-hidden="true"></i></a>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Share on Facebook (opens in a new tab)', 'oceanwp' ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $share_twitter_enabled ) : ?>
|
||||
<li style="list-style-type: none; display: inline-block;">
|
||||
<a target="_blank" class="twitter" href="https://twitter.com/share?url=<?php echo urlencode( $share_link_url ); ?>&text=<?php echo $share_twitter_summary; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><i class="fa fa-twitter" aria-hidden="true"></i></a>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Share on Twitter (opens in a new tab)', 'oceanwp' ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $share_pinterest_enabled ) : ?>
|
||||
<li style="list-style-type: none; display: inline-block;">
|
||||
<a target="_blank" class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode( $share_link_url ); ?>&description=<?php echo $share_summary; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>&media=<?php echo $share_image_url; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" onclick="window.open(this.href); return false;"><i class="fa fa-pinterest-p" aria-hidden="true"></i></a>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Share on Pinterest (opens in a new tab)', 'oceanwp' ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $share_googleplus_enabled ) : ?>
|
||||
<li style="list-style-type: none; display: inline-block;">
|
||||
<a target="_blank" class="googleplus" href="https://plus.google.com/share?url=<?php echo urlencode( $share_link_url ); ?>&title=<?php echo $share_link_title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" onclick='javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");return false;'><i class="fa fa-google-plus" aria-hidden="true"></i></a>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Share on Google plus (opens in a new tab)', 'oceanwp' ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $share_email_enabled ) : ?>
|
||||
<li style="list-style-type: none; display: inline-block;">
|
||||
<a class="email" href="mailto:?subject=<?php echo urlencode( apply_filters( 'yith_wcwl_email_share_subject', $share_link_title ) ); ?>&body=<?php echo apply_filters( 'yith_wcwl_email_share_body', urlencode( $share_link_url ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>&title=<?php echo $share_link_title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Share by email (opens in a new tab)', 'oceanwp' ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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 4.4.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
// Heading tag.
|
||||
$heading = get_theme_mod( 'ocean_woo_product_title_tag', 'h2' );
|
||||
$heading = $heading ? $heading : 'h2';
|
||||
$heading = apply_filters( 'ocean_woo_product_title_tag', $heading ); ?>
|
||||
|
||||
<<?php echo esc_attr( $heading ); ?> class="single-post-title product_title entry-title"<?php oceanwp_schema_markup( 'author_name' ); ?>><?php the_title(); ?></<?php echo esc_attr( $heading ); ?>>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* After Container template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
} ?>
|
||||
|
||||
</article><!-- #post -->
|
||||
|
||||
<?php do_action( 'ocean_after_content_inner' ); ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php do_action( 'ocean_after_content' ); ?>
|
||||
|
||||
</div><!-- #primary -->
|
||||
|
||||
<?php do_action( 'ocean_after_primary' ); ?>
|
||||
|
||||
</div><!-- #content-wrap -->
|
||||
|
||||
<?php do_action( 'ocean_after_content_wrap' ); ?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* After Container template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
} ?>
|
||||
|
||||
<?php do_action( 'ocean_before_content_wrap' ); ?>
|
||||
|
||||
<div id="content-wrap" class="container clr">
|
||||
|
||||
<?php do_action( 'ocean_before_primary' ); ?>
|
||||
|
||||
<div id="primary" class="content-area clr">
|
||||
|
||||
<?php do_action( 'ocean_before_content' ); ?>
|
||||
|
||||
<div id="content" class="clr site-content">
|
||||
|
||||
<?php do_action( 'ocean_before_content_inner' ); ?>
|
||||
|
||||
<article class="entry-content entry clr">
|
||||
Reference in New Issue
Block a user