Design Meets Code

Design Meets Code

WordPress · PrestaShop

  • Startseite
  • WordPress
  • PHP / Datenbanken
  • Ubuntu
  • Prestashop
  • Verschiedenes
  • Grafik
  • Glossar
You are here: Home / WordPress / Shortcode / Text nach oder vor Produktpreis anzeigen

Shortcode / Text nach oder vor Produktpreis anzeigen

2. August 2022 Leave a Comment

/**
* Show short code after price on single product
*/
function cw_change_product_price_display( $price ) {
$price .= do_shortcode('[xyz]');
return $price;
}
//add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );

oder

add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' );
function cw_change_product_price_display( $price ) {
// Your additional text in a translatable string
$text = __('TEXT');

// returning the text before the price
return $text . ' ' . $price;
}

Quelle: https://stackoverflow.com/questions/47016425/add-a-custom-text-before-the-price-display-in-woocommerce

Filed Under: WordPress Tagged With: WooCommerce

Schreibe einen Kommentar Antwort abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Anzeige

Themen

Apache BuddyPress Code Snippets CSS Datenbank Email Enfold genesis Grid View htaccess i-mscp Indesign Katalogpreisregel Layout Builder LibreOffice Lieferschein List View Medien Mitgliederbereich MySQL PHP PHP Anfänger PHP Variablen Plugins Prestashop Prestashop 1.5 Prestashop 1.6 Prestashop 1.7 Prestashop 8 Prestashop Module Registrierung RSS Feed s2member Server ssl Startseite Strings Tag Cloud Tipps Windows Windows 10 Windows 11 WooCommerce WooCommerce Sortierung WordPress
Anzeige

Letzte Kommentare

  • Martin zu CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Martin zu CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Klaus zu Woocommerce: Shop Seiten neu generieren
  • Thomas zu WordPress: Einzelne Kategorien aus dem RSS Feed ausschließen
  • Bernhard zu CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern

Informationen

  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Cookie-Richtlinie (EU)
  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Cookie-Richtlinie (EU)
Anzeige