| Server IP : 216.250.13.251 / Your IP : 216.73.217.37 Web Server : nginx/1.24.0 System : Linux gunay 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : root ( 0) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/gunay/wp-content/themes/rttheme19/woocommerce/single-product/ |
Upload File : |
<?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/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $woo_product_layout;
$woo_product_layout = ($woo_product_layout = get_theme_mod(RT_THEMESLUG."_woo_related_product_layout")) ? $woo_product_layout : 3;
$item_width = rt_column_count($woo_product_layout);
if ( $upsells ) : ?>
<div class="up-sells upsells products margin-t40">
<div class="rt_heading_wrapper style-3">
<h6 class="rt_heading style-3"><?php esc_html_e( 'You may also like…', 'rt_theme' ) ?></h6>
</div>
<?php woocommerce_product_loop_start(); ?>
<?php
$output = array();
foreach ( $upsells as $upsell ) : ?>
<?php
$post_object = get_post( $upsell->get_id() );
setup_postdata( $GLOBALS['post'] =& $post_object );
ob_start();
wc_get_template_part( 'content', 'product-carousel' );
$output[] .= ob_get_contents();
ob_end_clean();
?>
<?php endforeach; ?>
<?php woocommerce_product_loop_end(); ?>
<?php
//carousel atts
$atts = array(
"id" => "woocommerce-upsells-carousel",
"item_width" => intval($item_width),
"class" => "wc-product-carousel woocommerce",
"nav" => "true",
"dots" => "false",
);
//create carousel
echo rt_create_carousel( $output, $atts );
?>
</div>
<?php endif;
wp_reset_postdata();