Design Meets Code

Design Meets Code

WordPress · PrestaShop

  • Startseite
  • WordPress
  • PHP / Datenbanken
  • Ubuntu
  • Prestashop
  • Grafik
  • Glossar

WooCommerce: Marke nach Produktkurzbeschreibung zeigen

12. November 2022 Leave a Comment

Um einem Produkt Marken als Produktmerkmal hinzuzufügen, ist ein zusätzliches Plugin notwendig, z.B.

Perfect Brands for WooCommerce


oder
https://yithemes.com/themes/plugins/yith-woocommerce-brands-add-on/

function display_single_product_brand_after_summary() {
global $products;
$product_id = $product->id;
$product_brands = get_the_term_list($product_id, 'product_brand', '', ',' );
if (!empty($product_brands)) echo __( "Brand: ", "slug of theme" ) . $product_brands ;
};
add_action( 'woocommerce_single_product_summary', 'display_single_product_brand_after_summary', 40, 0 );

Filed Under: Allgemein, WordPress Tagged With: WooCommerce

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

WooCommerce: Preis nur für eingeloggte Besucher anzeigen

17. Februar 2021 Leave a Comment

Der Einkaufswagen und die Preisanzeige können mit folgendem Code Snippet für nicht eingeloggte Besucher ausgeblendet werden.

/**
 * @snippet       Hide Price & Add to Cart for Logged Out Users
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli, BusinessBloomer.com
 * @testedwith    WooCommerce 4.6
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
  
add_action( 'init', 'bbloomer_hide_price_add_cart_not_logged_in' );
  
function bbloomer_hide_price_add_cart_not_logged_in() {   
   if ( ! is_user_logged_in() ) {      
      remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
      remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
      remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
      remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );   
      add_action( 'woocommerce_single_product_summary', 'bbloomer_print_login_to_see', 31 );
      add_action( 'woocommerce_after_shop_loop_item', 'bbloomer_print_login_to_see', 11 );
   }
}
  
function bbloomer_print_login_to_see() {
   echo '<a href="' . get_permalink(wc_get_page_id('myaccount')) . '">' . __('Login to see prices', 'theme_name') . '</a>';
}

Quelle: https://www.businessbloomer.com/woocommerce-hide-price-add-cart-logged-users/

Filed Under: WordPress Tagged With: Code Snippets, WooCommerce

  • 1
  • 2
  • 3
  • …
  • 5
  • Next Page »
Anzeige

Themen

Apache BuddyPress Code Snippets Datenbank Email Enfold genesis Grid View htaccess imscp Indesign Katalogpreisregel Layout Builder LibreOffice Lieferschein List View Logout 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 Screencast Server Sicherheit ssl Startseite Strings Tipps Windows Windows 10 Windows 11 WooCommerce WooCommerce Sortierung WordPress
Anzeige

Letzte Kommentare

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

Informationen

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