
Varyasyonlu Ürün Hk.
7
●84
- 19-02-2021, 17:25:36Kimlik doğrulama veya yönetimden onay bekliyor.Merhabalar, varyasyonlu ürün eklediğimde ürünler anasayfada görseldeki gibi gözüküyor. Ben sadece belirlediğim varyasyondaki ürün fiyatının gözükmesini ve "seçenekler" düğmesinin "sepete ekle" şeklinde gözükmesini istiyorum. Bu konuda ne yapmam gerekir ?

- 19-02-2021, 17:33:56Üyeliği durdurulduEn düşük fiyatı veya en yüksek fiyatı göstermek isterseniz,
1- Görünüm > Tema Düzenleyici : WordPress admin panelinizden Görünüm sekmesi altından Tema Düzenleyici kısmını seçin.
2- Temanızı Seçini : Sağ üst köşeden temanızı seçin ve düzenleme panelini açın.
3- Functions Dosyası : Sağ sütunda karşınıza temanın php ve diğer dosyaları çıkacak. Buradan functions.php dosyasını açın.
Functions.php dosyasının en alt kısmına 1 boşluk bırakarak dilediğiniz kodu yazabilirsiniz. (Child tema varsa child tema üzerinden yapmalısınız)
EN DÜŞÜK FİYATI GÖSTERME
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( __( '%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( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); if ( $price !== $saleprice ) { $price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>'; } return $price; }EN YÜKSEK FİYATI GÖSTERME
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( 'max', true ), $product->get_variation_price( 'max', true ) ); $price = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); // Sale Price $prices = array( $product->get_variation_regular_price( 'max', true ), $product->get_variation_regular_price( 'max', true ) ); sort( $prices ); $saleprice = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); if ( $price !== $saleprice ) { $price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>'; } return $price; } - 19-02-2021, 17:36:28Üyeliği durdurulduSeçenekler kısmını düzenlemeniz için birkaç yöntem vardır.
1- Loco Translate ile temanın TR kalıbını oluşturarak güncellemek. (Her temada işe yaramaz)
2- Tema yönetim panelinde bu seçenek olabilir. (Her temada olmaz)
3- FTP yada Dosya yöneticisi ile ana dizine ulaşarak temanın kaynak kodlarında değişiklik yapmak. (Tema sürüm güncellemesinde yeniden değişebilir) - 19-02-2021, 20:46:40çok teşekkürler.eklentiyle daha kolay bir şekilde halledemiyoruz sanırım ?ParaParala adlı üyeden alıntı: mesajı görüntüle
- 19-02-2021, 21:03:38Üyeliği durdurulduWordpress+Woocommerce altyapılarda en büyük sorun eklentilerdir. Bu yüzden böylesine basit bir durum için kesinlikle eklenti kullanmamalısınız. Eğer yapamam diyorsanız bana anydesk veya team iletin 1dakikamı almaz yardımcı olayim.apathe adlı üyeden alıntı: mesajı görüntüle
- 22-02-2021, 16:01:51halıklısınız. dediğiniz kodu fonksiyonlar sayfasına eklemeyi denedim fakat şöyle bir hata aldım. "ParaParala adlı üyeden alıntı: mesajı görüntüle
functions.php dosyasındaki satır 97 yüzünden geri alındı. Lütfen düzeltin ve tekrar kaydetmeyi deneyin.
syntax error, unexpected '&' "
97. satır :
" $prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ); " - 23-02-2021, 11:47:30Üyeliği durdurulduHOCAM KODU SON WORDPRESSE GÖRE GÜNCELLEDİM. BU KOD ÇALIŞACAKTIR.
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( __( '%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( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); if ( $price !== $saleprice ) { $price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>'; } return $price; } - 28-02-2021, 18:03:02halloldu. çok teşekkür ederim .ParaParala adlı üyeden alıntı: mesajı görüntüle