Category : Woocommerce

<?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' ); ?> ..

Read more

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' ); // ..

Read more

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..

Read more