Home Forums WC Vendors Free Support Insert vendor telphone and address in user email when he buy

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
  • #7543
    AmitAsthana
    Participant

    I need to design the templates.
    I want to insert the vendors telephone number and address in the email which goes to the user after placing the order and making the payment.

    #7547
    AmitAsthana
    Participant

    Thanks Ben for this prompt reply.
    Tell me if I am right.
    Vendor is also a kind of user and has his information as address and telephone number.
    We can use his billing and shipping data as the vendor data.
    We have to usr get_user_meta($vendor_id) to get all the data that vendor has saved as a user or admin can also save the telephone and address of vendor in his shipping and billing data.

    IF this is right,

    Where do I have to use the get_user_meta($vendor_id). And use the information to pass in the email template for the user.

    One more thing, Suppose I have a function sendsmsviamyprovider($number, $message) to send sms to user and vendor while a user buys something. Where I should write this function and where I can use this to to notify vendors and users when the order is placed.

    Thanks a lot again. You answer was very helpful.

    #7548
    WC Vendors Support
    Participant

    That is correct. Vendors are users with the role “Vendor”, similar to how you are a user with the role “Administrator”.

    https://codex.wordpress.org/Function_Reference/get_user_meta shows you how to use get_user_meta.

    As for where in the email to add things, you’ll have to experiment with that and find out yourself. 🙂 Custom coding is all you!

    If you had a function that sent the vendor a SMS, I’d probably add it to the notification email template since any function in there will run, too.

    #7549
    AmitAsthana
    Participant

    Cool,

    That means we have the information of vendor which is already saved, we just have to use it at the right place.

    Once again a lot of thanks for your answer.

    #7554
    AmitAsthana
    Participant

    Hey Ben I used

    https://www.wcvendors.com/knowledgebase/custom-fields-to-shop-settings-page/

    It does not work as expected, I put the code in the functions.php file, the rendered html shows on the shop setting page, but none of the functions work, as I it did not save the field when I try to save or even the user data is not fetched on the functions.php file in this code. I can print the get_user_meta in html-vendor-settings-page.php, but the same thing does not work on functions.php.

    #7569
    WC Vendors Support
    Participant

    The code on https://www.wcvendors.com/knowledgebase/custom-fields-to-shop-settings-page/ is for adding custom fields to your shop settings page. As with all code, it’s sample code. 😉 Try adding it to your themes functions.php file which is where it goes. Once it’s there, on the Vendor Dashboard > Shop Settings page you will see the extra field. And it will work, too. 🙂 Once you verify this, then start customizing it to change the fields and the metas to those that you want. And if it doesnt work after you changed it, you forgot to change something or made a mistake which is fairly common.

    You can verify it works since that code also adds the fields to the edit user page, too.

    #7771
    AmitAsthana
    Participant

    Hey, ben thanks for your answers. Though I was not able to figure out that code to work. I started to edit the plugin code itself and added the function

    
    public static function get_vendor_sold_by_number( $vendor_id ){ 
    		$vendor_display_name = WC_Vendors::$pv_options->get_option( 'vendor_display_name' ); 
    		$vendor =  get_user_meta($vendor_id, 'billing_phone', true);
    		return $vendor; 
    	}
    

    in class-vendors.php and added the function

    And did some little tweaks and edited the vendor user from admin, later on I added a separate in plugin itself. So far everything worked well.

    Now I am trying to send sms to vendors, with this number. However not having much luck. I am trying to edit the class-wc-notify-vendor.php and trying to send the sms. I tried to put the function in this class as well as email class.

    
    foreach ( $vendors as $user_id => $user_email ) {
    			$this->current_vendor = $user_id;
    			$this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
    		}
    

    This code already exists I am hoping to add this third line sms.

    
    foreach ( $vendors as $user_id => $user_email ) {
    			$this->current_vendor = $user_id;
    			$this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
    $this->sendsmstovendor($number,$message); 
    		}
    

    Not able to figure out where should I define this function sendsmstovendor($number,$message);

    Hope you can provide some of your valuable input. Thanks in advance.
    If anything not clear, please let me know. Thanks once again.

    #7821
    WC Vendors Support
    Participant

    I have no idea to save my life. This is waaaaaaaaaay beyond the realm of normal WC Vendors Support. 🙂 This one’s all you! 🙂

    #9273
    AmitAsthana
    Participant

    Hey ben, Thanks for you help. I was able to figure out all of those and much more all worked well. Thanks once again.
    Now there what one of the vendors have a shipping charge if someone gives a order of less than X amount. You can say a product of Rs. 200 has a shipping charge of Rs. 100. If someone orders two of these products then it make Rs. 400. On that amount there is not shipping charge. How can I implement this logic. Any help will be very useful. Thanks

    #9276
    WC Vendors Support
    Participant

    Hi Amit,

    Better shipping options are coming with WC Vendors Pro’s second release, around the middle of October.

    Cheers

    Ben

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