Category Archives: Flatsome

Custom Đánh giá woocommerce

Bỏ vào File Function.php function addstar_pttuan(){ if ( is_singular( ‘product’ ) ) { global $product; $rating_arr = $product->get_rating_counts(); $review_count = $product->get_rating_count(); $countstar = $product->get_average_rating(); if($countstar==’0′){$countstar = ‘Chưa có đánh giá’;}?> <div class=”rating-table row row-small align-middle”> <div class=”rating-table__total col large-4 small-12 medium-12″> <div class=”title-rating”>Điểm đánh giá trung bình</div> <div class=”rating_total”><?php echo $countstar;?></div> <div class=”star-rating-custom”><?php echo wc_get_rating_html(…

Những đoạn code làm chủ Woocommerce

// Reorder product tab woocommerce add_filter( ‘woocommerce_product_tabs’, ‘woo_reorder_tabs’, 98 ); function woo_reorder_tabs( $tabs ) { $tabs[‘reviews’][‘priority’] = 5; // Reviews first $tabs[‘description’][‘priority’] = 10; // Description second $tabs[‘additional_information’][‘priority’] = 15; // Additional information third return $tabs; } // Đổi tên và ẩn product tabs add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 ); function woo_remove_product_tabs( $tabs ) { $tabs[‘description’][‘title’]…

Thêm Nút mua ngay trên theme flatsome – Thủ Thuật WordPress

Thêm Nút mua ngay trên theme flatsome sử dụng plugin mua ngay add_action(‘flatsome_product_box_after’,’fv_view_more_btn’); function fv_view_more_btn(){ global $product; $fvproductid = $product->get_id(); echo ‘<div class=”right”>’; echo do_shortcode(‘[devvn_quickbuy id=”‘.$fvproductid.'”]’); echo ‘</div>’; }

Những đoạn code tùy biến website

1/ Hook thêm code vào sản phẩm add_action(‘woocommerce_after_shop_loop_item_title’,’add_cart_icon’); function add_cart_icon(){ global $product; // The output is still filterable through the same filter // $args and $attributes are made available to the filter echo apply_filters( ‘woocommerce_loop_add_to_cart_link’, sprintf( ‘<a rel=”nofollow” href=”%s” %s> <img src=”http://duan4.cvbanks.net/wp-content/uploads/2020/06/Group-59.png”> &gt;</a>’, esc_url( $product->add_to_cart_url() ), implode( ‘ ‘, $attributes )), $product, $args, $attributes );…