Support » Plugin: WPC Product Quantity for WooCommerce » How I can have Name Your Price option in the shop page

  • Hola

    I need to include the Name Your price option in the shop page and other products page like category page.

    As I can see the plugin is active only in simple product page.

    Could you help me with this?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi @alexeiremedio

    Please update our plugin WPC Name Your Price to the latest version 1.3.2 first then add below custom code (How to add custom code?):

    add_action( 'woocommerce_after_shop_loop_item', 'woonp_loop_add_to_cart', 99 );
    function woonp_loop_add_to_cart() {
    	global $product;
    
    	if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() ) {
    		echo '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">';
    		WPCleverWooNpCore::add_input_field_to_frontend();
    		echo '<button type="submit" class="button alt">' . esc_html( $product->add_to_cart_text() ) . '</button>';
    		echo '</form>';
    	}
    }
Viewing 1 replies (of 1 total)
  • The topic ‘How I can have Name Your Price option in the shop page’ is closed to new replies.