premier 142 ارسال شده در اسفند 93 گزارش بازنشر ارسال شده در اسفند 93 (ویرایش شده) با سلامکسانی که نمیخواهن برای محصولات متغیر کمترین و بیشترین برای کالا نمایش داده نشه و یک قیمت ثابت باشه میتونن از کد زیر استفاده کنن و در function.php قرار بدهندadd_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 );add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 );function wc_wc20_variation_price_format( $price, $product ) {// Main Price$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );$price = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );// Sale Price$prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) );sort( $prices );$saleprice = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );if ( $price !== $saleprice ) {$price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>';}return $price;}این کد کمترین قیمت محصول را نمایش میده از میان قیمتهای متغیر دیگراگر هم میخواهید کامل حذف کنید از کد زیر استفاده کنیدadd_filter( 'woocommerce_variable_sale_price_html', 'remove_variation_price', 10, 2 );add_filter( 'woocommerce_variable_price_html', 'remove_variation_price', 10, 2 );function remove_variation_price( $price ) {$price = '';return $price;} ویرایش شده اسفند 93 توسط premier 1 لینک به ارسال
devoted 0 ارسال شده در آبان 94 گزارش بازنشر ارسال شده در آبان 94 دمت گرم خیلی وقت بود دنبالش بودنخدا خیرت بده لینک به ارسال
پست های پیشنهاد شده
لطفا برای ارسال دیدگاه وارد شوید
شما بعد از اینکه وارد حساب کاربری خود شدید می توانید دیدگاهی ارسال کنید
ورود به حساب کاربری