Duplicated checkout form

  • This topic has 4 replies, 2 voices, and was last updated 1 week, 3 days ago by Christine Ros.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1801906

    Hello,

    I have just purchased and activated the plugin BUT there are 2 client info on checkout page
    screeshot duplicate checkout fields
    The first one is the original, the second one appears when I activate the checkout field plugin.
    How to solve this issue ?
    While awaiting your response, I have disabled the plugin.
    Thank you for help

    #1802476

    Hi Christine, please check if you overrode the default Checkout Form by using a custom code, and try disabling the code to edit the checkout fields by using add-ons.

    #1802708

    Hello M.Davis,

    I can’t remember if I overrode the default Checkout Form… I purchased the Pet Hotel theme 7 years ago. There is a file “checkout-view.php” in the child theme, path includes->views->shortcodes->checkout-view.php.
    Usually, I put a comment before a piece of code I add, I took a look at the checkout-view, no comment added, but perhaps I did something and forgot to comment ?

    Looking at previous post, I found you helped me to set a field required and you told me to modify the function.php in the child theme (#687513)

    Could it be this override in function.php the problem ?
    Here the code :

    <?php
    
    // enqueue parent stylesheet
    add_action( 'wp_enqueue_scripts', 'petotel_child_wp_enqueue_scripts' );
    function petotel_child_wp_enqueue_scripts() {
    
    	$parent_theme = wp_get_theme( get_template() );
    	$child_theme = wp_get_theme();
    
    	// Enqueue the parent stylesheet
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), $parent_theme['Version'] );
    	wp_enqueue_style( 'petotel-style', get_stylesheet_uri(), array('parent-style'), $child_theme['Version'] );
    
    	// Enqueue the parent rtl stylesheet
    	if ( is_rtl() ) {
    		wp_enqueue_style( 'parent-style-rtl', get_template_directory_uri() . '/rtl.css', array(), $parent_theme['Version'] );
    	}
    }
    
    //note-requiered=breed/sex/name
    add_action( 'wp_head', 'remove_renderCustomerDetails' );
    function remove_renderCustomerDetails(){	
    remove_action( 'mphb_sc_checkout_form', array( '\MPHB\Views\Shortcodes\CheckoutView', 'renderCustomerDetails' ), 40 );
    }
    
    add_action( 'mphb_sc_checkout_form', 'renderCustomerDetails', 40 );
    			
    function renderCustomerDetails(){
    		?>
    		<section id="mphb-customer-details" class="mphb-checkout-section">
    			<h3 class="mphb-customer-details-title"><?php _e( 'Your Information', 'motopress-hotel-booking' ); ?></h3>
    			<p class="mphb-required-fields-tip">
    				<small>
    					<?php printf( __( 'Required fields are followed by %s', 'motopress-hotel-booking' ), '<abbr title="required">*</abbr>' ); ?>
    				</small>
    			</p>
    			<?php do_action( 'mphb_sc_checkout_form_customer_details' ); ?>
    			<p class="mphb-customer-name">
    				<label for="mphb_first_name">
    					<?php _e( 'First Name', 'motopress-hotel-booking' ); ?>
    					<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    				</label>
    				<br />
    				<input type="text" id="mphb_first_name" name="mphb_first_name" required="required" />
    			</p>
    			<p class="mphb-customer-last-name">
    				<label for="mphb_last_name">
    					<?php _e( 'Last Name', 'motopress-hotel-booking' ); ?>
    					<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    				</label>
    				<br />
    				<input type="text" name="mphb_last_name" id="mphb_last_name" required="required" />
    			</p>
    			<p class="mphb-customer-email">
    				<label for="mphb_email">
    					<?php _e( 'Email', 'motopress-hotel-booking' ); ?>
    					<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    				</label>
    				<br />
    				<input type="email" name="mphb_email" required="required" id="mphb_email" />
    			</p>
    			<p class="mphb-customer-phone">
    				<label for="mphb_phone">
    					<?php _e( 'Phone', 'motopress-hotel-booking' ); ?>
    					<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    				</label>
    				<br />
    				<input type="text" name="mphb_phone" required="required" id="mphb_phone" />
    			</p>
    			
    			<?php if ( MPHB()->settings()->main()->isRequireFullAddress() ) : ?>							
    				<p class="mphb-customer-address1">
    					<label for="mphb_address1">
    						<?php _e( 'Address', 'motopress-hotel-booking' ); ?>
    						<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    					</label>
    					<br />
    					<input type="text" name="mphb_address1" required="required" id="mphb_address1" />
    				</p>
    				<p class="mphb-customer-zip">
    					<label for="mphb_zip">
    						<?php _e( 'Postcode', 'motopress-hotel-booking' ); ?>
    						<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    					</label>
    					<br />
    					<input type="text" name="mphb_zip" required="required" id="mphb_zip" />
    				</p>
    			<p class="mphb-customer-city">
    					<label for="mphb_city">
    						<?php _e( 'City', 'motopress-hotel-booking' ); ?>
    						<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    					</label>
    					<br />
    					<input type="text" name="mphb_city" required="required" id="mphb_city" />
    				</p>
    			<?php endif; // full address			?>
    			<p class="mphb-customer-note mphb-required-fields-tip">
    				<label for="mphb_note"><?php _e( 'Notes', 'motopress-hotel-booking' ); ?>
    				<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr></label><br />
    				<textarea name="mphb_note" id="mphb_note" rows="4" required="required"></textarea>
    			</p>
    		</section>
    		<?php
    	}
    #1804108

    Yes, you need to delete the code after the line //note-requiered=breed/sex/name. Save the file and use the Checkout Fields add-on to edit the form further.

    #1804542

    Hello M. Davis,

    I have deleted the custom code and activate checkout fields add-on, and now everything is ok. So thank you to help me fix the issue.
    Have a good week-end.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.