Home Forums WC Vendors Free Support issue after update

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
  • #64596
    amany
    Participant

    hi

    I just update the plugin and the layout of loop products has changed
    I add soldby as custome code in function.php and it was work fine but after update the soldby is move under product details container

    #64724
    Anna
    Member

    @amany
    What is the custom code that you used in the functions.php?
    The hook may have changed, or your theme may have changed it. We did not alter that with this update..

    #64777
    amany
    Participant

    I used this code

    
    
    remove_action( 'woocommerce_after_shop_loop_item', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 9, 2);
    remove_filter( 'woocommerce_get_item_data', array( 'WCV_Vendor_Cart', 'sold_by' ), 10, 2 );
    remove_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
    remove_filter( 'woocommerce_order_product_title', array( 'WCV_Emails', 'show_vendor_in_email' ), 10, 2 );
    remove_filter( 'woocommerce_product_tabs', array( 'WCV_Vendor_Shop', 'seller_info_tab' ) );
    remove_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 );
    remove_action( 'woocommerce_after_shop_loop_item', 'loop_sold_by', 8 );
    remove_action( 'woocommerce_product_meta_start','product_sold_by', 8 );
    
    add_action( 'woocommerce_after_shop_loop_item', 'custom_template_loop_sold_by', 9 );
    function custom_template_loop_sold_by() {
    
                    $vendor_id   = WCV_Vendors::get_vendor_from_product( $product_id );
        $author = get_the_author( $vendor_id);
    
    $users = ( '<a href=http://mybadil.com/profile/' . $author. '>See my profile</a>' );
    
                    if ( $vendor_id != '1') { // Change "1" to the admins user id #
    
                      $sold_by = WCV_Vendors::is_vendor( $vendor_id  )
    
         ? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $sold_by), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
    
                            : get_bloginfo( 'name' );
    
                echo '<small class="wcvendors_sold_by_in_loop">' .apply_filters('wcvendors_sold_by_in_loop', __( 'Sold by: ',  'wcvendors'))   .$author .$users  . '</small><br />';
                    }
            }
    
    //new code
    add_filter( 'woocommerce_get_item_data', 'custom_sold_by', 10, 2 );
    add_action( 'woocommerce_product_meta_start', 'custom_sold_by_meta', 10, 2 );
    function custom_sold_by( $values, $cart_item )
            {               
                    $vendor_id = WCV_Vendors::get_vendor_from_product( $product_id );
                    $author = get_the_author( $vendor_id);
                    if ( $vendor_id != '1' ) { // Change "1" to the admins user id #
                    $sold_by   = WCV_Vendors::is_vendor( $vendor_id )
                            ? sprintf( '<a href="%s" target="_TOP">%s</a>', WCV_Vendors::get_vendor_shop_page(  $sold_by), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
                            : get_bloginfo( 'name' );
                    $values[ ] = array(
                            'name'    => apply_filters('wcvendors_cart_sold_by', __( 'Sold by', 'wcvendors' ))  .$author .$users ,
                            'display' => $sold_by,
                    );
                    return $values;
                    }
            }       
                    
            function custom_sold_by_meta()
            {               
                    $vendor_id = WCV_Vendors::get_vendor_from_product( $product_id );
                        $author = get_the_author( $vendor_id);
                        $users = ( '<a href=http://mybadil.com/profile/' . $author. '> See my profile</a>' );
    
                    if ( $vendor_id != '1' ) { // Change "1" to the admins user id #
                    $sold_by = WCV_Vendors::is_vendor( $vendor_id )
                            ? sprintf( '<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page(  $sold_by ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
                            : get_bloginfo( 'name' );
                    echo apply_filters('wcvendors_cart_sold_by_meta', __( 'Trader by: ', 'wcvendors' )) .$author .$users  . '<br/>';
                    }
            }
           
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.