• Resolved sarmanulco

    (@sarmanulco)


    Hi all, thanks in advance

    Me would like to edit the single product page so the add to cart button appear only in case the user is logged in, also, me would like to add a book appointment button. For this I thunk about edit the single-product/add-to-cart/external.php file, and wrap with a is_user_logged_in function so the button appears only when the user is registered

    And also I was making some testing and I added a p with the text ‘hola mundo’ but I don’t see it in the page, the file now is this way:

    defined( 'ABSPATH' ) || exit;
    
    do_action( 'woocommerce_before_add_to_cart_form' ); ?>
    
    <form class="cart" action="<?php echo esc_url( $product_url ); ?>" method="get">
    	<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
    	
    	<p>Hola mundo</p>
    	<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $button_text ); ?></button>
    
    	<?php wc_query_string_form_fields( $product_url ); ?>
    
    	<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
    </form>
    
    <?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>`
    
    

    Could someone help me? I’m newbie

    • This topic was modified 3 years, 11 months ago by sarmanulco.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Override a template file’ is closed to new replies.