Home Forums WC Vendors Pro Support Custom Ships From *How To*

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30720
    Joe
    Participant

    Perhaps Ben can share this in the knowledgeBase.

    Say you want to show more detailed location information under single product view “Ships From” section.

    Add this to your theme functions.php
    ———————————————–
    /* Custom “Ships From” */
    function custom_ships_from(){
    global $post;
    $vendor_id = WCV_Vendors::get_vendor_from_product( $post->ID );
    $town = get_user_meta( $vendor_id, ‘_wcv_store_city’, true );
    $county = get_user_meta( $vendor_id, ‘_wcv_store_state’, true );
    if ( $town && $county && $county !=” ) {
    $town = $town.’, ‘.$county;
    } elseif ( !$town && $county && $county !=” ) {
    $town = $county;
    }
    if ( !$town || $town==” ) {
    $countries = WCVendors_Pro_Form_Helper::countries();
    $store_country = WC()->countries->get_base_country();
    $town = $countries[ strtoupper( $store_country ) ];
    }
    return array(
    ‘store_country’ => $town,
    ‘wrapper_start’ => ‘<br /><span class=”wcvendors_ships_from”>’,
    ‘wrapper_end’ => ‘</span><br />’,
    ‘title’ => __( ‘Ships From: ‘, ‘wcvendors-pro’ )
    );
    }
    add_filter(‘wcv_product_ships_from’, ‘custom_ships_from’);
    ———————————————–

    This will show in addition the city and state/province.

    #30730
    WC Vendors Support
    Participant
    #36309
    Sculpify
    Participant

    Maybe i’m doing something wrong, but now this code replaces country with city for me.
    So it shows only the city it ships from, not the country.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.