“Ajax Single -Produkt zum Wagen Woocommerce Stackoverflow hinzufügen” Code-Antworten

add_to_cart wie man es woocommerce nennt

add_action( 'template_redirect', 'quadlayers_add_to_cart_function' );

function quadlayers_add_to_cart_function () {

    $product_id = 1326;

    if ( WC()->cart->get_cart_contents_count() == 0 ) {

        WC()->cart->add_to_cart( $product_id );

    }

}
Adershow The MasterCoder

Ajax Single -Produkt zum Wagen Woocommerce Stackoverflow hinzufügen

add_action( 'template_redirect', 'quadlayers_add_to_cart_function' );

function quadlayers_add_to_cart_function () {

    $product_id = 1326;

    if ( WC()->cart->get_cart_contents_count() == 0 ) {

        WC()->cart->add_to_cart( $product_id );

    }

}
Fantastic Flatworm

Ähnliche Antworten wie “Ajax Single -Produkt zum Wagen Woocommerce Stackoverflow hinzufügen”

Fragen ähnlich wie “Ajax Single -Produkt zum Wagen Woocommerce Stackoverflow hinzufügen”

Weitere verwandte Antworten zu “Ajax Single -Produkt zum Wagen Woocommerce Stackoverflow hinzufügen” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen