<?php // Display variations dropdowns on shop page for variable products add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' ); function woo_display_variation_dropdown_on_shop_page() { global $product; if( $product->is_type( 'variable' )) { $attribute_keys = array_keys( $product->get_attributes() ); ?> <form class="variations_form cart" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->id ); ?>" data-product_variations="<?php echo htmlspecialchars( json_encode( $product->get_available_variations() ) ) ?>"> <?php do_action( 'woocommerce_before_variations_form' ); ?> ..
Category : Woocommerce
Thêm đoạn sau vào funtion theme remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description..
https://www.tychesoftwares.com/how-to-add-plus-and-minus-buttons-to-the-quantity-input-on-the-product-page-in-wo..
add_action( 'after_setup_theme', 'setup_woocommerce_support' ); function setup_woocommerce_support() { add_theme_support('woocommerce'); } Nguồn: https://wordpress.stackexchange.com/questions/90199/how-to-declare-woocommerce-support-in-your-theme Hoặc đoạn đầy đủ dưới: // add theme suport WooCommerce function akasa_theme_setup() { // WooCommerce in general. add_theme_support( 'woocommerce' ); // Enabling WooCommerce product gallery features (are off by default since WC 3.0.0). // zoom. add_theme_support( 'wc-product-gallery-zoom' ); // lightbox. add_theme_support( 'wc-product-gallery-lightbox' ); // ..
https://stackoverflow.com/questions/46353307/navigation-arrows-in-woocommerce-3-x-product-gallery-slider/4644840..
Đôi khi import sản phẩm từ web cũ xang web mới sẽ bị tình trạng không hiển thị đánh giá, comment. Cách khắc phục ..
if ( ! function_exists( ‘woocommerce_template_loop_product_title’ ) ) { /** * Show the product title in the product loop. By default this is an H2. */ function woocommerce_template_loop_product_title() { echo ‘<h3 class=”woocommerce-loop-product__title”>’ . get_the_title() . ‘</h3>’; } } Tham khảo: https://wordpress.org/support/topic/change-loop-title-from..
Xóa nút Add to cart trong W..
Thêm đoạn sau vào file functions.php define(‘ALLOW_UNFILTERED_UPLOADS’, true); Chú ý khi import xong nhớ xóa dòng này đi để website bảo mật hơn Tham khảo: Sửa lỗi WordPress ‘Sorry, This File Type Is Not Permitted For Security Reasons’ Sửa lỗi không thể import sản phẩm bằng file csv trên woocomme..
/* ** Cắt ảnh chi tiết sản phẩm */ add_filter( 'woocommerce_get_image_size_single', function( $size ) { return array( 'width' => 500, 'height' => 500, 'crop' => 1, ); } ); Tham khảo: https://themebynumbers.com/2018/04/18/how-to-override-woocommerce-im..
Phản hồi