Displaying Vendors
-
Please, I noticed that there is “Vendor” Taxonomy Drop Down List displayed just above the “Product Short Description” in the Add/Edit Product Page.
Please, How can products be filtered by Vendor?
Do you have a shortcode for that?
-
Of course! We have a ton of shortcodes.
You’ll find: https://www.wcvendors.com/knowledgebase/ to be quite useful.
And especially this: https://www.wcvendors.com/knowledgebase/shortcodes/
Cheers
Ben
Dear Ben,
Thank you so much for your kind and lightning response.
I will check the links and revert back to you on the status.
Best Regards,
Stardrive
Dear Ben,
I went to the link: https://www.wcvendors.com/knowledgebase/shortcodes/
I read that “All other arguments to the shortcodes from WooCommerce will also work on these shortcodes.”
So, I placed this shortcode in a product page:
[wcv_vendorslist show_products=”no” per_page=”12″ columns=”3″]1. Instead of displaying 3 vendors in a row, it is displaying 2 vendors in a row, irrespective of the value of columns that is set.
2. The avatar image of the vendors displayed is large. I need it to be smallerPlease, assist with the above 2 issues.
Best Regards,
Stardrive
Hi Stardrive,
For the wcv_vendorslist shortcode, you can tweak that by editing the vendor templates. In the Knowledgebase there is an article on the vendor template system:
https://www.wcvendors.com/knowledgebase/changing-vendor-templates/
The file you want is in:
https://github.com/wcvendors/wcvendors/blob/master/templates/front/vendor-list.php
Once you’ve copied that to the /wp-content/themes/yourtheme/wc-vendors/front/vendor-list.php you see the “200” part that is in there? That’s the avatar size. Change it to 150 and it’ll be 150×150. Change it to 75 and they will be 75×75.
If it is ignoring your columns argument, then it’s your theme that’s doing that and will need to figure out what css to tweak in the theme and where. That’s a bit out of my reach, every theme is different. π
Hope this helps!
Ben
Dear Tom,
Thank you for your prompt and detailed response.
1. I followed the article on the vendor template system. I copied vendor-list.php to my child theme: /wp-content/themes/yourtheme/wc-vendors/front/vendor-list.php, and changed the avatar size from “200” to “100”. But, the size of the vendor avatar displayed at the frontend product page is still “200”. But, when I change the size directly in your plugin folder, it worked. Then, I copied the vendor-list.php file to /wp-content/themes/yourtheme/wc-product-vendor/front/vendor-list.php. Still the same problem.
2. I am OK with this now. I noticed that my theme does not ignore the columns argument in [recent_products per_page=”12″ columns=”4″]; it displays the 4 columns.
And when the avatar size was reduced to “100” directly in your plugin folder, I noticed that my theme displayed 3 avatar columns in a row, and even displayed 4 columns in a row when the columns was set to 4. I think the issue is caused by avatar size and the spacing between each avatar (55px)3. Please, is there a shortcode attribute that will exclude the Vendor Avatar and display only the hyperlink of the Vendor Shop?
The only issue I have now is item #1 above. Please, kindly assist
Best Regards,
Stardrive
Hi Stardrive,
Make sure you are replacing /yourtheme/ with the correct directory for your child theme. The templates will display when in the correct directory. If you want to eliminate the avatar entirely, you can surely do so just by deleting the line of code that pulls it in the template which is line #13:
“><?php echo get_avatar($vendor_id, 200); ?>
Cheers
Ben
Looks like the forums software garbled up the line I was quoting. It’s just the line of code on line #13 in the template that will wipe out the avatar entirely. π
https://github.com/wcvendors/wcvendors/blob/master/templates/front/vendor-list.php#L13
Dear Ben,
Thank you for your response.
The directory of my child theme is correct. It is in that directory i placed functions.php file which has codes that are all working. It is in the sub-directory of this child theme directory i have woocommerce directory where i placed some files that are working too.
I am really surprised that vendor-list.php, I placed in /wp-content/themes/mychildtheme/wc-vendors/front/, is not working
Any hint to what might be going wrong at my end?
Best Regards,
Stardrive
Hi Stardrive,
It could be a permissions issue on the file or the directory, that’s about my only real guess.
That’s where the code pulls the template file, and you’ll see within it that first the code checks for the ./wc-vendors/front/vendor-list.php file in your theme folder, and if it is not there or accessible, it loads the one from /plugins/wc-vendors/templates/front/vendor-list.php instead.
Here’s a nice article on child themes and templates that might be worth reading:
http://www.childthemeconfigurator.com/how-child-themes-work/
Ben
Thank you Ben.
I am really surprised to be experiencing this problem.I will do as you advised and revert back
Regards,
Stardrive
Dear Ben,
It is OK now.
I just pasted vendor-list.php code in notepad++, the copied the code from notepadd++ to the server and it worked.Thank you so much for your patience, excellent support well structured code.
Best Regards,
Stardrive
Dear Ben,
It is OK now.
I just pasted vendor-list.php code in notepad++, the copied the code from notepadd++ to the server and it worked.Thank you so much for your patience, excellent support well structured code.
Best Regards,
Stardrive
Awesome. Glad you got it all sorted out. Have fun!
Ben
Yeah! Thank you. I am enjoying your awesome plugin.
Hi I want to display vendors instead pf products on shop page can you please help me
The topic ‘Displaying Vendors’ is closed to new replies.