Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wcfmmp_sold_by_label_product_page_after', function($vendor_id) {
- if(!is_product()) return;
- $store_user = wcfmmp_get_store( $vendor_id );
- $address = $store_user->get_address_string();
- $store_info = $store_user->get_shop_info();
- $store_lat = isset( $store_info['store_lat'] ) ? esc_attr( $store_info['store_lat'] ) : 0;
- $store_lng = isset( $store_info['store_lng'] ) ? esc_attr( $store_info['store_lng'] ) : 0;
- if( $address && ( $store_info['store_hide_address'] == 'no' ) && wcfm_vendor_has_capability( $store_user->get_id(), 'vendor_address' ) ) { ?>
- <p class="wcfmmp_store_header_address">
- <i class="wcfmfa fa-map-marker" aria-hidden="true"></i>
- <?php if( apply_filters( 'wcfmmp_is_allow_address_map_linked', true ) ) {
- $map_search_link = 'https://google.com/maps/place/' . rawurlencode( $address ) . '/@' . $store_lat . ',' . $store_lng . '&z=16';
- if( wcfm_is_mobile() || wcfm_is_tablet() ) {
- $map_search_link = 'https://maps.google.com/?q=' . rawurlencode( $address ) . '&z=16';
- }
- ?>
- <a href="<?php echo esc_url($map_search_link); ?>" target="_blank"><span><?php echo esc_attr($address); ?></span></a>
- <?php } else { ?>
- <?php echo esc_attr($address); ?>
- <?php } ?>
- </p>
- <?php }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement