[Hỏi đáp] Slide album ảnh sản phẩm Woocommerce

Chào mọi người,

Em dùng plugin Woocommerce, và em muốn thay đổi kiểu hiển thị của album ảnh sản phẩm thành dạng slide.

Mọi người giúp em với.

Hiện tại theme của bạn đang sử dụng không hỗ trợ vấn đề này, bạn cần cài thêm plugin cho WooCommerce.
Ví dụ:

1 Lượt thích

Admin ơi, cho em hỏi thêm cái này…

Em muốn chuyển Tab đánh giá sp xuống phía dưới dưới phần mô tả thì làm sao đây ạ?

Em có tìm và thử 1 số code nhưng không được. và bị lỗi như hình bên dưới.

Các code em thử:

code 1.

function woocommerce_template_product_reviews() {
woocommerce_get_template( 'single-product-reviews.php' );
}
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_template_product_reviews', 50 );

code 2.

add_action('woocommerce_after_single_product_summary', create_function( '$args', 'call_user_func(\'comments_template\');'), 14);

code 3.

add_action( 'woocommerce_after_single_product_summary', 'comments_template', 50 );

Còn đây là code trong content-single-product.php của template woo trên theme em:

<?php
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
	/**
	 * 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' ); ?>

Mong admin giúp đỡ ạ.

Bạn chèn vào theme gốc hay theme child ?

dạ theme child ạ

Code ẩn tab đánh giá

add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['reviews'] ); // Bỏ tab đánh giá
return $tabs;
}

cái này em ẩn được rồi, chỉ là chuyển xuống phía dưới nội dung là chưa làm được thôi ạ

Em chèn nó vào file functions.php của theme, còn các hướng dẫn phía trên là cách thêm đánh giá vào

Em có thể dùng cách mở rộng tab thay vì xoá và di chuyển
Tham khảo:

Dạ, em thử xem sao, cảm ơn ad nhiều.

1 Lượt thích

Em thử rồi admin ơi, không được luôn ạ, còn bị móp giao diện nặng hơn nữa luôn :sweat_smile:

Hiện tại Ad không biết bạn đang sử dụng theme gì? Vì mỗi theme có khi họ viết cấu trúc khác nhau nhé

em dùng theme Chromium ad ạ

Hi admin, làm thế nào để show hình ảnh trong woocommerce v ạ, e inspect thì vẫn có link ảnh ạ. e cảm ơn

Mặc định hệ thống có hình ảnh đại diện, nếu bạn không thấy có thể lỗi ở theme bạn đang sử dụng

Cảm ơn a đã góp ý, e coppy template woocommerce từ plugin vào file custom theme của mình, những trang khác chạy vẫn ổn, chỉ có trang single-product là bị lỗi này, không biết lỗi theme chỗ nào :((( mong được sự hướng dẫn cụ thể hơn từ a, e cảm ơn ạ

Bạn đang sử dụng theme gì hay bạn tự phát triển theme ?

Mình cũng bị lỗi như này. Bạn fix dc chưa chỉ mình với?