Design · PHP · Server

Design · PHP · Server

WordPress · Drupal · PrestaShop

  • Startseite
  • WordPress
  • PHP
  • Ubuntu
  • Prestashop
  • Indesign
  • Grafik
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 Antworten abbrechen

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

Themen

Adminbar Apache Attachment Count Automatische Updates Backend Boolean values Boolesche Werte BuddyPress Code Snippets Concatenation Operator Conditional Statement Datenbank Email Enfold Escape Zeichen Galerien genesis Grid View htaccess Layout Builder List View Logische Operatoren Loops Maskieren Media Manager Mitgliederbereich PHP PHP Anfänger PHP Variablen Plugins Prestashop Prestashop 1.5 Prestashop 1.6 Prestashop Module Registrierung RSS Feed s2member Server ssl Strings Windows Windows 10 WooCommerce WooCommerce Sortierung WordPress

Letzte Kommentare

  • Thomas bei WordPress: Einzelne Kategorien aus dem RSS Feed ausschließen
  • Bernhard bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • Bernhard bei CSS: Automatische Silbentrennung in einzelnen Wörtern verhindern
  • MC bei PHP: Boolesche Werte (Boolean Values)
  • eno bei Zufällige Produktanordnung beim Featured Product Slider (PrestaShop 6.1.11 / Megashop Theme)

Informationen

  • Kontakt
  • Datenschutzerklärung
  • Impressum
  • Kontakt
  • Datenschutzerklärung
  • Impressum