Home Forums WC Vendors Pro Support Change ships from country to city

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 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #20462
    Arvid Viderberg
    Participant

    Is it possible to show which city a single product ships from, instead of the country?
    Not very effective to show the country when we only have national customers/vendors. 🙂

    #20476
    WC Vendors Support
    Participant

    Of course!

    /templates/front/shipping/shipping-panel.php#L14

    #20486
    Arvid Viderberg
    Participant

    Thanks Ben, but I’m not sure how to change the line..
    <strong>Shipping From: </strong> <?php echo $countries[ strtoupper( $store_city ) ]; ?> ? 🙂

    #20499
    WC Vendors Support
    Participant

    Probably just add an additional php tag after that to echo the store id’s city which is the meta key _wcv_store_city

    #20563
    Arvid Viderberg
    Participant

    @ben Not very fantastic at PHP, really.. Which post id should I use? 🙂
    This is what I got so far:
    <?php $test = get_post_meta ( int $post_id, string $key = '_wcv_store_city', bool $single = false ); ?>

    #20565
    WC Vendors Support
    Participant

    Ditch the “int” and “string” parts, you don’t need those, and the “bool” part too.

    <?php $test = get_post_meta ( $post_id, '_wcv_store_city', true ); ?>

    that’s the correct syntax =)

    #20605
    Arvid Viderberg
    Participant

    I’ve tested this on a vendor product that has a city set. It doesn’t show anything however..

    <h2>Shipping</h2>
    <?php $test = get_post_meta ( $post_id, '_wcv_store_city', true ); ?>
    <p>
    <strong>Shipping from:: </strong> <?php echo $test; ?>
    </p>
    #20628
    WC Vendors Support
    Participant

    What is $post_id? Is that the vendors store ID? If not, that’s where it’s failing.

    In Pro v1.2.0 you will replace get_post_meta with get_user_meta and then instead of $post_id it will be the vendors ID.

    #20669
    Arvid Viderberg
    Participant

    I see, how do I get the vendor ID?
    $vendor_id?

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