• george1225

    (@george1225)


    using shipping by distance one vendor is Courier Service, so pickup location will be different address. I would like to use the pickup address as the vendor location address to calculate shipping cost

    Courier Product
    Product ID 123
    Price is 0.00
    Added input field: pickup location
    (123 street name, city, province) use this address as Store Location

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WC Lovers

    (@wclovers)

    For all products pickup location will be this?

    Thread Starter george1225

    (@george1225)

    Products pickup location will be different each time

    This one vendor will not have a store location. The customer will enter the pickup location, that address will be used as the vendor location, than customer will enter the delivery address these 2 address will be used to calculate the shipping cost.

    Shipping by Distance

    Plugin Author WC Lovers

    (@wclovers)

    Understand. But this will be possible using custom development.

    Thread Starter george1225

    (@george1225)

    I don’t know much about writing code just copy and paste. I was trying to use short code on the product page where they would enter the pickup location or on the checkout page when customer inputs the delivery location. Am I on the right path or will this not work

    function pickup_location_shortcode() {
    	
    	function wcfmmp_vendor_manage_marketplace_setting( $vendor_id ) {
    		global $WCFM, $WCFMmp;
    		
       if( $vendor_id ) { ?>
    						<div class="wcfm-clearfix"></div>
    						<div class="wcfm-message" tabindex="-1"></div>
    						<div class="wcfm-clearfix"></div>
    						<div class="wcfm_messages_submit">
    							<input type="submit" name="save-data" value="<?php _e( 'Update', 'wc-frontend-manager' ); ?>" id="wcfm_store_general_setting_save_button" class="wcfm_submit_button" />
    						</div>
    						<div class="wcfm-clearfix"></div>
    				  <?php } ?>
    
    					$api_key = isset( $WCFMmp->wcfmmp_marketplace_options['wcfm_google_map_api'] ) ? $WCFMmp->wcfmmp_marketplace_options['wcfm_google_map_api']:'';
    					$wcfm_map_lib = isset( $WCFMmp->wcfmmp_marketplace_options['wcfm_map_lib'] ) ? $WCFMmp->wcfmmp_marketplace_options['wcfm_map_lib'] : '';
    					if( !$wcfm_map_lib && $api_key ) { $wcfm_map_lib = 'google'; } elseif( !$wcfm_map_lib && !$api_key ) { $wcfm_map_lib = 'leaftlet'; }
    					if ( ( ($wcfm_map_lib == 'google') && !empty( $api_key ) ) || ($wcfm_map_lib == 'leaflet') ) {
    						?>
    						<div class="wcfm_clearfix"></div><br />
    						<div class="wcfm_vendor_settings_heading"><h2><?php _e( 'Pickup Location', 'wc-frontend-manager' ); ?></h2></div>
    						<div class="wcfm_clearfix"></div>
    						<div class="store_address store_location_wrap">
    							<?php
    								$WCFM->wcfm_fields->wcfm_generate_form_field( apply_filters( 'wcfm_marketplace_settings_fields_location', array(
    								"find_address" => array( 'label' => __( 'Find Location', 'wc-frontend-manager' ), 'placeholder' => __( 'Type an address to find (eg. 123 Street, City, Province)', 'wc-frontend-manager' ), 'type' => 'text', 'name' => 'geolocation[find_address]', 'class' => 'wcfm-text wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $map_address ),
    								"store_location" => array( 'type' => 'hidden', 'name' => 'geolocation[store_location]', 'value' => $store_location ),
    								"store_lat" => array( 'type' => 'hidden', 'name' => 'geolocation[store_lat]', 'value' => $store_lat ),
    								"store_lng" => array( 'type' => 'hidden', 'name' => 'geolocation[store_lng]', 'value' => $store_lng ),
    								), $vendor_id ) );
    							?>
    							<div class="wcfm_clearfix"></div><br />
    							<div class="wcfm-marketplace-google-map" id="wcfm-marketplace-map"></div>
    							<div class="wcfm_clearfix"></div><br />
    						</div>
    					<?php
    					}
    					?>
    					<?php do_action( 'wcfmmp_admin_wcfm_store_location_settings_after', $vendor_id ); ?> 
    					
    					<?php if( $vendor_id != 99999 ) { ?>
    						<div class="wcfm-clearfix"></div>
    						<div class="wcfm-message" tabindex="-1"></div>
    						<div class="wcfm-clearfix"></div>
    						<div class="wcfm_messages_submit">
    							<input type="submit" name="save-data" value="<?php _e( 'Update', 'wc-frontend-manager' ); ?>" id="wcfm_store_address_setting_save_button" class="wcfm_submit_button" />
    						</div>
    						<div class="wcfm-clearfix"></div>
    				  <?php }
    	add_shortcode('pickup_location', 'pickup_location_shortcode');
    }
    
    • This reply was modified 4 years ago by george1225.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shipping by Distance – Customer enter Store Location’ is closed to new replies.