Home Forums Theme Support Dokan add extra fields to store page

This topic is: not resolved

This topic contains 10 replies, has 2 voices, and was last updated by  towhid 4 years, 1 month ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #41881

    Paul
    Member
    Post count: 14

    Hi there I have been searching for a while how to add in extra fields to the store page – ie I want to add in an about us section with an editor for the store owner and show it on their store page under the banner. quite easy I would have thought, but no!

    I have seen a couple of links on how to add in a postcode etc, but that does not seem to work as when I add in any info, save it – the page comes up with undefined.

    if you could just copy and paste the info I need to add to my functions file I would appreciate it!

    #41903

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    Send me the those code which you had worked. Also send me links of those site where describes how to add in a postcode etc.

    Thank you πŸ™‚

    #41970

    Paul
    Member
    Post count: 14

    Hey Towhid, the link to the page is below..

    http://stackoverflow.com/questions/26985251/add-custom-fields-to-existing-form-on-dokan-wordpress-woocoomerce

    all I am wanting is a way of adding in an about us field to the merchants shop page.

    #42009

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    I need to discuss about this issue with our developer team. Please allow me some time.

    Thank you πŸ™‚

    #42149

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    Please try with following code and let me know the result:

    function endereco( $current_user, $profile_info ) {
    	$pv_local_pickup_enabled = isset( $profile_info['pv_local_pickup_enabled'] ) ? esc_attr($profile_info['pv_local_pickup_enabled']) : 'no';
    	$billing_city = isset( $profile_info['billing_city'] ) ? $profile_info['billing_city'] : '';
    	$billing_postcode = isset( $profile_info['billing_postcode'] ) ? $profile_info['billing_postcode'] : '';
    	$billing_state = isset( $profile_info['billing_state'] ) ? $profile_info['billing_state'] : '';
    	$billing_address_1 = isset( $profile_info['billing_address_1'] ) ? $profile_info['billing_address_1'] : '';
    	?>       
    
    	<div class="gregcustom dokan-form-group">
            <label class="dokan-w3 dokan-control-label" for="setting_address"><?php _e( 'Local Pickup', 'dokan' ); ?></label>
            <div class="dokan-w5">
    	        <div class="checkbox">
    		           <label>             
    			           <input name="pv_local_pickup_enabled" type="checkbox"
    			               id="pv_local_pickup_enabled" class="<?php echo 'id_' . $store_id; ?>" value="yes" <?php checked( $pv_local_pickup_enabled, 'yes' ); ?>/>
    				        <?php
    				        _e('Enable Local Pickup for the shop products', 'dokan');
    		        ?></label>
    		    </div>
    	    </div>
    	</div>
    	<div class="gregcustom dokan-form-group">
    	    <label class="dokan-w3 dokan-control-label" for="setting_address"><?php _e( 'Cidade', 'dokan' ); ?></label>
    	    <div class="dokan-w5">
    			<input type="text" class="dokan-form-control input-md valid" name="billing_city" id="reg_billing_city" value="<?php echo $billing_city; ?>" />
    		</div>
    	</div>   
                    
    	<div class="gregcustom dokan-form-group">
    		<label class="dokan-w3 dokan-control-label" for="setting_address"><?php _e( 'Estado', 'dokan' ); ?></label>
    		<div class="dokan-w5">
    			<input type="text" class="dokan-form-control input-md valid" name="billing_postcode" id="reg_billing_postcode" value="<?php echo $billing_postcode; ?>" />
    		</div>
    	</div>
                    
    	<div class="gregcustom dokan-form-group"> 
    		<label class="dokan-w3 dokan-control-label" for="setting_address"><?php _e( 'CEP', 'dokan' ); ?></label>
    		<div class="dokan-w5">
    			<input type="text" class="dokan-form-control input-md valid" name="billing_state" id="reg_billing_state" value="<?php echo $billing_postcode; ?>" />
    		</div>
    	</div>    
    	<div class="gregcustom dokan-form-group">
    		<label class="dokan-w3 dokan-control-label" for="setting_address"><?php _e( 'Endereço', 'dokan' ); ?></label>
    		<div class="dokan-w5">
    			<input type="text" class="dokan-form-control input-md valid" name="billing_address_1" id="reg_billing_address_1" value="<?php echo $billing_address_1; ?>" />
    		</div>
    	</div>
    				
    	<?php
    }
    add_filter( 'dokan_settings_after_banner', 'endereco', 10, 2);
    
    /**
     * Save the extra fields.
     *
     * @param  int  $customer_id Current customer ID.
     *
     * @return void
     */
    function save_extra_endereco_fields( $store_id, $dokan_settings ) {
    
    	if (isset($_POST['pv_local_pickup_enabled'])) {
            $dokan_settings['pv_local_pickup_enabled'] = $_POST['pv_local_pickup_enabled'];
        }
    
    	if ( isset( $_POST['billing_city'] ) ) {
    		$dokan_settings['billing_city'] = $_POST['billing_city'];
    	}
    
    	if ( isset( $_POST['billing_postcode'] ) ) {
    		$dokan_settings['billing_postcode'] = $_POST['billing_postcode'];
    	}
    
    	if ( isset( $_POST['billing_state'] ) ) {
    		$dokan_settings['billing_state'] = $_POST['billing_state'];
    	}
    
    	if ( isset( $_POST['billing_address_1'] ) ) {
    		$dokan_settings['billing_address_1'] = $_POST['billing_address_1'];
    	}
    	update_user_meta( $store_id, 'dokan_profile_settings', $dokan_settings );
    }
    
    add_action( 'dokan_store_profile_saved', 'save_extra_endereco_fields', 10, 2 );

    Thank you πŸ™‚

    #42173

    Paul
    Member
    Post count: 14

    Settings β†’ Visit Store

    undefined
    this is what I get when I add in the code into the funtions.php of the theme…

    #42206

    towhid
    Participant
    Post count: 4505

    Please provide your login details by using this form: http://wedevs.com/provide-login-details/. I will have a look what is going wrong.

    Thank you πŸ™‚

    #42413

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    Please let me know are you able to add extra filed to store page using the code I had provided to you? I am here to help you.

    Thank you πŸ™‚

    #42488

    Paul
    Member
    Post count: 14

    Hey mate I have sent login info to you twice now. the site is eshops.co.nz
    I have tried to add in the info you have given me and get “undefined” when I fill in the information…

    can you go in and try it and see what you think?

    #42545

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    I am able to login your site successfully. Please allow me some time checkout the issue.

    Thank you πŸ™‚

    #42747

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    I have upload a new theme in the theme folder. Can you please active that theme. I am not able to active the theme because of permission of wp-admin.(You did not provide full permission).

    Please check and let me know the result.

    Thank you πŸ™‚

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘add extra fields to store page’ is closed to new replies.