Halo.
Ich hatte bei Germanized die formelle Sprachdatei ausgewählt. Dass möchte ich aber wieder rückgängig machen, finde aber keine Möglichkeit dazu.
Wie kann ich das machen?
Danke und Gruss
Um schreiben oder kommentieren zu können, benötigen Sie ein Benutzerkonto.
Sie haben schon ein Benutzerkonto? Melden Sie sich hier an.
Jetzt anmeldenHier können Sie ein neues Benutzerkonto erstellen.
Neues Benutzerkonto erstellenHalo.
Ich hatte bei Germanized die formelle Sprachdatei ausgewählt. Dass möchte ich aber wieder rückgängig machen, finde aber keine Möglichkeit dazu.
Wie kann ich das machen?
Danke und Gruss
Danke! Der letzte Link hat mich dann endlich weiter gebracht.. :-)
https://dev.adventureprojekt.com
Ich habe gerade festgestellt, dass es nur auftritt, wenn der Benutzergruppe "Administrator" mit angegeben ist. Ein "normaler" Kunde im Shop "woocommerce" hat das Phänomen nicht...
Wo ich das wie einhängen kann, das weiß ich. Leider weiß ich nicht, wie ich es machen muss, um an die Eigenschaft zu kommen. Irgendwie steh ich da auf dem Schlauch.
Ich benötige diesen Wert
um ihn dann in dieser Art weiter zu verarbeiten:
if ($product->get_stock_quantity() >= 8) { echo "<span class='stock-green-light'><i class='fa fa-check-square-o'></i> noch buchbar</span>"; } elseif ($product->get_stock_quantity() >= 3 and $product->get_stock_quantity() <= 7) { echo "<span class='stock-green'><i class='fa fa-check-square-o'></i> noch buchbar - Durchführung gesichert</span>"; } elseif ($product->get_stock_quantity() >= 0 and $product->get_stock_quantity() <= 2) { echo "<span class='stock-yellow'><i class='fa fa-exclamation-triangle'></i> Nur noch wenige Plätze frei!</span>"; }?>
Wie auf dem Bild in der Frage zu sehen ist, habe ich dort einen Termin hinterlegt.
Ich benötige den Inhalt (Datum), um das darüber die Buchbarkeit des Produktes zu steuern. Soll heißen, ab 3 Tage vor dem Termin ist das Produkt nicht mehr buchbar.
Ich würde gerne die Auflistung der Buchungen im Kundenaccount um den Produktnamen erweitern.
In dem Shop kann immer nur ein Produkt pro Bestellung gewählt werden so dass auch eine Eindeutigkeit vorhanden ist.
Beispiel:
in dem rot markierten Bereich im Bild möchte ich den Produktnamen gerne haben.
Kann mir bitte jemand einen Tipp geben?
Danke!
Sorry, es hat sich erledigt. Es war ein Browserproblem. Es funktioniert doch genau so, wie es soll.
Hallo.
Ich möchte gerne den Text ändern (siehe Bild)
[ATTACH=CONFIG]17671[/ATTACH]
Das habe ich in der Language-Datei von Woocommerce auch getan, es wird aber nicht umgesetzt. Woran kann das liegen?
Das kann man über den Filter 'woocommerce_get_availability_text' steuern. Der Filter übergibt als zweiten Parameter das Produkt als Objekt. Damit ist es möglich in einer Funktion, die in den Filter eingehängt wird mittels $product->get_stock_quantity() nur den Lagerbestand zurückzugeben.
Folgenden Code in die functions.php des Child Themes:
add_filter( 'woocommerce_get_availability_text', 'mmx_modify_availability_text', 20, 2 );
function mmx_modify_availability_text( $availability, $product ) { if ( ! $product->is_in_stock() ) { $availability = __( 'Out of stock', 'woocommerce' ); } elseif ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { $availability = $product->backorders_require_notification() ? __( 'Available on backorder', 'woocommerce' ) : ''; } elseif ( $product->managing_stock() ) { $availability = $product->get_stock_quantity(); } else { $availability = ''; } return $availability;
}
Und den folgenden Code dann in die "wp-content/themes/your-theme/woocommerce/single-product/stock.php"
if ($product->get_stock_quantity() >= 8) { echo "<span class='stock-green'><i class='fa fa-circle'></i> noch buchbar</span>"; } elseif ($product->get_stock_quantity() >= 3 and $product->get_stock_quantity() <= 7) { echo "<span class='stock-green'><i class='fa fa-circle'></i> Durchführung gesichert</span>"; } elseif ($product->get_stock_quantity() >= 0 and $product->get_stock_quantity() <= 2) { echo "<span class='stock-red'><i class='fa fa-circle'></i> Nur noch wenige Plätze frei!</span>"; }
Die Werte in den Abfragen müssen natürlich entsprechen angepasst werden und in die css muss dann folgendes rein:
[css]
.stock-circle-green {
color: green;
}
.stock-circle-yellow{
color: yellow;
}
.stock-circle-red {
color: red;
}
[/css]
Es geht noch um die vorherigen Fragen.
Ich habe in der functions.php folgenden Code:
add_filter( 'woocommerce_get_availability_text', 'mmx_modify_availability_text', 20, 2 );
function mmx_modify_availability_text( $availability, $product ) { if ( ! $product->is_in_stock() ) { $availability = __( 'Out of stock', 'woocommerce' ); } elseif ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { $availability = $product->backorders_require_notification() ? __( 'Available on backorder', 'woocommerce' ) : ''; } elseif ( $product->managing_stock() ) { $availability = $product->get_stock_quantity(); } else { $availability = ''; } return $availability;
}
DAnn hahabe ich in der stock.php folgendes stehen:
if ($product->get_stock_quantity() >= 8) { echo "<span class='stock-green'><i class='fa fa-check-square-o'></i> noch buchbar</span>"; } elseif ($product->get_stock_quantity() >= 3 and $product->get_stock_quantity() <= 7) { echo "<span class='stock-green'><i class='fa fa-check-square-o'></i> Durchführung gesichert</span>"; } elseif ($product->get_stock_quantity() >= 0 and $product->get_stock_quantity() <= 2) { echo "<span class='stock-red'><i class='fa fa-exclamation-triangle'></i> Nur noch wenige Plätze frei!</span>"; }
Und dies wird zur Zeit dort unten ausgegeben und ich hätte es gerne dort oben...
Ok, akzeptiert :?
Jetzt in der functions.php im Child-Theme klappt es auch.
Vielen Dank!!!
Es ist ja eine Kopie davon, die ich in "wp-content/themes/my-theme/woocommerce/single-product/stock.php" liegen habe. Ist das nicht ok?
Hallo und Danke für die Antwort.
Meine stock.php sieht nun folgendermaßen aus:
<?php/** * Single Product stock. * * This template can be overridden by copying it to yourtheme/woocommerce/single-product/stock.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates * @version 3.0.0 */
if ( ! defined( 'ABSPATH' ) ) { exit;}
?><!-- <p class="stock <?php echo esc_attr( $class ); ?>"><?php echo wp_kses_post( $availability ); ?></p> -->
<?phpadd_filter( 'woocommerce_get_availability_text', 'mmx_modify_availability_text', 20, 2 );
function mmx_modify_availability_text( $availability, $product ) { if ( ! $product->is_in_stock() ) { $availability = __( 'Out of stock', 'woocommerce' ); } elseif ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { $availability = $product->backorders_require_notification() ? __( 'Available on backorder', 'woocommerce' ) : ''; } elseif ( $product->managing_stock() ) { $availability = $product->get_stock_quantity(); } else { $availability = ''; } return $availability;
}
if ($product->get_stock_quantity() >= 8) { echo "noch buchbar"; } elseif ($product->get_stock_quantity() >= 3 and $product->get_stock_quantity() <= 7) { echo "Durchführung gesichert"; } elseif ($product->get_stock_quantity() >= 0 and $product->get_stock_quantity() <= 2) { echo "Nur noch wenige Plätze frei!"; }?>
Das funktioniert leider nur zum Teil. Ich habe Produkte mit Varianten. Wenn das Produkt nur eine hat, klappt alles.
https://dev.adventureprojekt.com/abenteuertermi…transkarpatien/
Wenn das Produkt aber 2 oder mehr Varianten hat, dann bekomme ich einen Fehlermeldung:
https://dev.adventureprojekt.com/abenteuertermi…radies-masuren/
Woran kann das liegen?
Ich suche etwas ähnliches. Mein Problem dabei ist, dass in der stock.php die Variable $availability den gesamten String enthält (12 auf Lager).
Kann mir jemand sagen, wie ich die Zahl davon trennen kann, bzw. wie ich die auf anderem Wege bekommen kann?