“Wenn das Produkt diese Schaltfläche öffnen öffnen” Code-Antworten

Wenn das Produkt diese Schaltfläche öffnen öffnen

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30, 0);
Tech Stack

Wenn das Produkt diese Schaltfläche öffnen öffnen

add_action( 'woocommerce_single_product_summary', 'custom_button_by_categories', 32 ,0 );
function custom_button_by_categories(){
    
    global $product;

    // Define your categories in this array (can be Ids, slugs or names)
    $product_cats = array('clothing', 'music', 'furnitures');

    if( has_term( $product_cats, 'product_cat', $product->get_id() ) ){
         $demo_url = get_post_meta( $product->get_id(), 'demo_url', true );
         echo '<a class="fancybox iframe" data-width="1280" data-height="720" href="'.$demo_url.'"><button style="background: lightblue; padding-left: 19px; padding-right: 19px;">Przymierz</button></a>';
    }
}
Tech Stack

Ähnliche Antworten wie “Wenn das Produkt diese Schaltfläche öffnen öffnen”

Fragen ähnlich wie “Wenn das Produkt diese Schaltfläche öffnen öffnen”

Weitere verwandte Antworten zu “Wenn das Produkt diese Schaltfläche öffnen öffnen” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen