Client info in admin mail

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #690061
    Christine Ros
    Participant

    Hello again,

    You’ve help me to set guest field required, in my use it is translate in name + specie + sex of animal, but how to get this info field in the mail received by admin like %customer_first_name% tag. I really need these information…

    Thanks for help.

    Christine

    #690378
    J. Davis
    Keymaster

    Hi Christine,

    Thank you for your question. There is no email tag for Full Guest name field. You can see it while editing Booking only. We’ll review your suggestion to create an email tag for this field though. Thank you for your feedback.
    If you need to get some additional information via email you can try re-naming other field where email tag is available e.g. ‘Notes’.

    best regards,
    John

    #690498
    Christine Ros
    Participant

    Hi,

    Well, by now, making guest field required is useless…
    If I want animals details in mail, you should help me to make the additional note required instead of guest field – i have to make this field display none too, like children field.
    So ???

    #691059
    J. Davis
    Keymaster

    Hi Cristine,

    Thank you for your reply. Please try adding the code below to functions.php file of the child theme in order to make Notes field required:

    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()->isRequireCountry() ) : ?>
    				<p class="mphb-customer-country">
    					<label for="mphb_country">
    						<?php _e( 'Country of residence', 'motopress-hotel-booking' ); ?>
    						<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    					</label>
    					<br />
    					<select name="mphb_country" required="required" id="mphb_country">
    						<option value=""></option>
    						<?php foreach ( MPHB()->settings()->main()->getCountriesBundle()->getCountriesList() as $countryCode => $countryLabel ) { ?>
    							<option value="<?php echo esc_attr( $countryCode ); ?>">
    								<?php echo $countryLabel; ?>
    							</option>
    						<?php } ?>
    					</select>
    				</p>
    			<?php endif; // country		  ?>
    			<?php if ( MPHB()->settings()->main()->isRequireFullAddress() ) : ?>
    				<p class="mphb-customer-state">
    					<label for="mphb_state">
    						<?php _e( 'State', 'motopress-hotel-booking' ); ?>
    						<abbr title="<?php _e( 'Required', 'motopress-hotel-booking' ); ?>">*</abbr>
    					</label>
    					<br />
    					<input type="text" name="mphb_state" required="required" id="mphb_state" />
    				</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>
    				<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>
    			<?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
    	}

    Also add the style below to style.css file of Child Theme in order to remove Guest Name field (make sure you have removed code that makes this field required):

    .mphb-guest-name-wrapper{
    	display:none;
    }
    #849397
    J. Davis
    Keymaster

    Hello,

    We are happy to announce about release of new Hotel Booking 3.6.1 version where we have added new tags for email templates: Price Breakdown, Country, State, City, Postcode, Address, Full Guest Name. We notify you as you requested this feature. Here are the other improvements added with 3.6.0 and 3.6.1 version https://motopress.com/products/hotel-booking/#release-notes

    Thank you for collaboration. Do not hesitate to contact us if you have any further question

    best regards,
    J. Davis

    #1418080
    Zsolt Halász
    Participant

    Hello!

    I tried this function and it still works very well, but I need the guest address without “Country of residence” and “State” marked as required fields.

    Is it possible to make it with function?

    Thank you for your help.

    #1419259
    J. Davis
    Keymaster

    Hi Zsolt,

    Thanks for your question. You may add some default values to the following fields by editing the function e.g. ‘-‘ or ‘no’ and then hide the fields with a custom CSS style.
    Or you may use the Checkout Fields Editor addon to edit/add custom fields https://motopress.com/products/hotel-booking-checkout-fields/

    best regards,
    John Davis

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