Home Forums WC Vendors Pro Support Can we change 'Product Name' to Product Title'?

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 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #13193
    Karen Thomas
    Participant

    Hiya Ben and Jamie,

    Is there a way for me to change “Product Name’ to ‘Product Title’ on the Add Product screens?
    I’ve looked in the template and can’t work it out sorry.

    Many thanks,

    Karen

    #13202
    WC Vendors Support
    Participant

    That wouldn’t be part of the templates, but the code that works that is:

    WCVendors_Pro_Form_Helper::input( apply_filters( 'wcv_product_title', array( 
    		 	'post_id' 	=> $post_id, 
    		 	'id'	 	=> 'post_title', 
    		 	'label' 	=> __( 'Product Name', 'wcvendors-pro' ),
    		 	'value' 	=> $product_title 
    		 	) )

    Since there’s a filter there, wcv_product_title, you’d create a filter to look identical except change it to Product Title rather than Product Name.

    Or, you can use POEdit to translate the default.mo/po file into your language you use (en-US?) and then change the string for Product Name in there and put the new language file in /wp-content/languages/ (if folder doesnt exist, create!)

    #13210
    Karen Thomas
    Participant

    Thanks Ben,

    I added it to my Functions.php file but it didn’t like it and gave me a blank screen when saving, so had to remove it via my wp-content.

    Any ideas?

    Ta,

    Karen

    #13343
    WC Vendors Support
    Participant

    No no, silly, that’s the code that WC Vendors Pro uses in our source code. 🙂 That’s not code for adding to your themes functions.php file. 🙂

    Now read that code, and look at what it does. Then compare it to this code that you WILL put in your themes functions.php file, and it should make sense how everything works. 🙂

    https://gist.github.com/bentasm1/60024c8381f110baaf5f

    #13362
    Karen Thomas
    Participant

    Oops sorry thought it looked different to other filters! Being a thicko sorry lol

    Would really love to teach myself how to create filters, so I’m going to study this in the morning 🙂

    Also is there a way to add placeholder text in the text fields so I can add little help tips for my vendors?

    Thanks a million Ben!

    Karen

    #13368
    WC Vendors Support
    Participant

    Sure, just add the placeholder text to the array. Look at the code I pasted 2 posts up I’ve updated it with placeholder text. 🙂

    #13382
    Karen Thomas
    Participant

    HUGE THANK YOU!!!!! 🙂

    One more question and I’ll leave u alone. Is there a way to restrict the number of characters in the titis? Some vendors like to write war and peace in there!

    Many thanks,

    Karen

    #13383
    WC Vendors Support
    Participant

    You’re welcome! Last question’s answer: Titis? 🙂 Nope. 🙂

    #13388
    Karen Thomas
    Participant

    Oops sorry meant Product Title or name!
    Oh well thought I’d ask

    #13547
    Karen Thomas
    Participant

    Hi Ben glad to see your site back up 🙂

    This filter code worked wonders with changing the Product Name and Description field titles plus placeholder text:

    /* This will rename the Product Name to <whatever you want> on the Pro Dashboard's add/edit product page */
    add_filter('wcv_product_title', 'custom_wcv_product_title');
    function custom_wcv_product_title(){
      $new_title = array( 
          'post_id' 	=> $post_id, 
    		 	'id'	     	=> 'post_title', 
    		 	'label' 	  => __( 'Product Something Else other than Name', 'wcvendors-pro' ), // Change this to whatever you like
    		 	'value' 	  => $product_title 
    			);
    return $new_title;
    }
    
    /* This will rename the Product Description to whatever you want */
    add_filter('wcv_product_description', 'custom_wcv_product_description');
    function custom_wcv_product_description(){
      $new_desc = array(
                            'post_id'       => $post_id,
                            'id'            => 'post_content',
                            'label'         => __( 'Product Something Else Besides Description', 'wcvendors-pro' ),
                            'value'         => $product_description,
                            'placeholder'   => 'Placeholder Text'
                            );
    return $new_desc;
    }

    However, it caused a problem for my Vendors. If they entered text in the product title or description and Saved to Drafts, when they opened the product to edit, the product name and description was blank. As the text in those fields was visible in wp-admin I guessed that this had something to do with the above code. So I removed it and the text in the fields returned for the vendor.

    Are you able to take a look at the above code to see why it caused the issue pretty please?

    Many thanks,

    Karen

    #13574
    WC Vendors Support
    Participant

    That’s interesting. I don’t know why it would be doing that. I bet Jamie will have to patch that one up, let’s page him in on this one so he can check it out tonight. @digitalchild

    #13811
    Karen Thomas
    Participant

    Hi Jamie and Ben, any chance of checking the filter code above to see why it’s blanking out the Product Name and Description when editing drafts?

    @digitalchild

    Ta,
    Karen

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.