Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Forum: Fixing WordPress
    In reply to: Pop-up window
    Thread Starter pregunta02

    (@pregunta02)

    This forum has a section that is for Woocommerce that is where I put the question ??

    Forum: Fixing WordPress
    In reply to: Pop-up window
    Thread Starter pregunta02

    (@pregunta02)

    Hello Joy

    I use the following code:

    add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 );
     
     
    function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
    if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
    $html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">';
    $html .= woocommerce_quantity_input( array(), $product, false );
    $html .= '<button type="submit" class="button alt">' . esc_html( $product->add_to_cart_text() ) . '</button>';
    $html .= '</form>';
    }
    return $html;
    }

    I use woocommerce but I think the problem is in the code but I can not see it.

    Thread Starter pregunta02

    (@pregunta02)

    Thank you!

    That’s exactly what I needed.

Viewing 3 replies - 1 through 3 (of 3 total)