WCMp Core
-
AuthorPosts
-
-
March 17, 2021 at 6:34 PM #117707JamesParticipant
Hello,
When a customer rate a product the “stars and the comment” appear on the product.
When a customer rate a vendor the “stars and the comment” appear on the vendor shop.I would like, when a vendor get a Rate from a customer it atomaticaly goes on the Vendor rate in the vendor shop.
And on the product the rate that appear is the rate from the vendor shop.
(if you don’t see what i am talking about it like the rate system on etsy)Best Regards.
James. -
March 17, 2021 at 6:45 PM #117712MVX Support NinjaKeymaster
Hello,
Thank you for reaching out to us.
Our team is looking to it and we will update you by tomorrow.
-
March 18, 2021 at 6:36 PM #117798MVX Support NinjaKeymaster
Hello,
Thank you for reaching out to us.
By default flow, product review is only for the products. Now if you want the product review to go to the vendor store page then you have to do custom coding at your end. Kindly let us know if you need any help with the hooks and filter then our team will guide you accordingly .
-
March 19, 2021 at 4:14 PM #117841JamesParticipant
Hello,
I don’t mind to have the product review.
I juste would like them to appear on the vendor review also.
How do i do this ?
Best Regards.
James. -
March 19, 2021 at 7:04 PM #117867MVX Support NinjaKeymaster
Hi,
kindly follow this thread link – https://multivendorx.com/support-forum/topic/product-reviews-vendor-reviews/#post-106635regards,
-
March 21, 2021 at 2:59 PM #117931JamesParticipant
Hello,
Very nice !
It’s solve most of what i wanted ^^.
Only 1 last think i would like to change is the number of review beside the stars (like on the pdf i have added)
I want it to be the vendor review + the vendor product review.
Like this vendor have 1 product review and 1 vendor review so i want the review beside the star to be “2 reviews”.
(Avis : Review)
Best Regards,
James. -
March 22, 2021 at 6:58 PM #118012MVX Support NinjaKeymaster
Hi,
To change the data and text you have to override templates/review/rating.php template by copying it to yourtheme/dc-product-vendor/review/rating.php and add some custom code.Regards,
-
March 22, 2021 at 7:05 PM #118014JamesParticipant
Hello,
Ok do you have any code i can use to do this and paste in my “childtheme” php function ?
Best Regards.
James. -
March 23, 2021 at 8:24 PM #118108NerdySupportExpert MoumitaKeymaster
James, currently we don’t have any such code snippet. Our dev team will look into this, if this requires a small coding snippet, they will provide that.
-
March 24, 2021 at 5:18 PM #118156MVX Support NinjaKeymaster
Hi,
To change the data and text you have to override templates/review/rating.php template by copying it to yourtheme/dc-product-vendor/review/rating.php.Remove all code from the rating.php and add the below code on this page.
<?php /** * Vendor Review Comments Template * * Closing li is left out on purpose!. * * This template can be overridden by copying it to yourtheme/dc-product-vendor/review/rating.php. * * HOWEVER, on occasion WC Marketplace will need to update template files and you (the theme developer). * will need to copy the new files to your theme to maintain compatibility. We try to do this. * as little as possible, but it does happen. When this occurs the version of the template file will. * be bumped and the readme will list any important changes. * * * @author WC Marketplace * @package dc-woocommerce-multi-vendor/Templates * @version 3.3.5 */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly } global $WCMp; $rating_result_array = array(); if (is_tax($WCMp->taxonomy->taxonomy_name)) { // Get vendor ID $vendor_id = get_queried_object()->term_id; // Get vendor info $vendor = get_wcmp_vendor_by_term($vendor_id); $vendor_products = wp_list_pluck( $vendor->get_products_ids(), 'ID' ); $rating = $rating_pro_count = 0; if( $vendor_products ) { foreach( $vendor_products as $product_id ) { if( get_post_meta( $product_id, '_wc_average_rating', true ) ) { $rating += get_post_meta( $product_id, '_wc_average_rating', true ); $rating_pro_count++; }; } } if( $rating_pro_count ) { $rating_result_array['total_rating'] = $rating_pro_count; $rating_result_array['avg_rating'] = $rating / $rating_pro_count; } } $rating = round($rating_val_array['avg_rating'], 1); $count = intval($rating_val_array['total_rating']); $rating_type = $rating_val_array['rating_type']; if( !empty($rating_result_array) ){ $avg_rating = ($rating_val_array['avg_rating'] + $rating_result_array['avg_rating'])/2; $rating = round($avg_rating, 1); $count = intval($rating_val_array['total_rating'] + $rating_result_array['total_rating']); } if( $rating_type == 'product-rating' ) { $review_text = $count > 1 ? __('Products reviews', 'dc-woocommerce-multi-vendor') : __('Product review', 'dc-woocommerce-multi-vendor'); } else { $review_text = $count > 1 ? __('Reviews', 'dc-woocommerce-multi-vendor') : __('Review', 'dc-woocommerce-multi-vendor'); } ?> <div style="clear:both; width:100%;"></div> <?php if ($count > 0) { ?> <span class="wcmp_total_rating_number"><?php echo sprintf(' %s ', $rating); ?></span> <?php } ?> <a href="#<?php echo ($rating_type != 'product-rating' ) ? 'reviews' : ''; ?>"> <?php if ($count > 0) { ?> <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo sprintf(__('Rated %s out of 5', 'dc-woocommerce-multi-vendor'), $rating) ?>"> <span style="width:<?php echo ( round($rating_val_array['avg_rating']) / 5 ) * 100; ?>%"><strong itemprop="ratingValue"><?php echo $rating; ?></strong> <?php _e('out of 5', 'dc-woocommerce-multi-vendor'); ?></span> </span> <?php echo sprintf(' %s %s', $count, $review_text); ?> <?php } else { ?> <?php esc_html_e(' No Review Yet ', 'dc-woocommerce-multi-vendor'); ?> <?php } ?> </a>
CopyRegards,
-
March 24, 2021 at 9:32 PM #118210JamesParticipantThis reply has been marked as private.
-
March 24, 2021 at 9:47 PM #118211JamesParticipant
My bad i have done it wrong ,
There is no “vendor/review/rating.php” in “mytheme/dc-product-vendor” so i have done it directly in templates/review/rating.php
it is working perfect now 🙂 Thanks a lot for it.
just the code in templates/review/rating.php wouldn’t he be errased at the next wcmp update ?Best regards.
James. -
March 25, 2021 at 4:56 PM #118271NerdySupportExpert MoumitaKeymaster
@James, as you have overridden the template file in your theme, hence when you will update the theme it will override the edit.
So, please use a child theme and add all the modifications there. -
March 26, 2021 at 10:55 AM #118296JamesParticipantThis reply has been marked as private.
-
March 26, 2021 at 6:57 PM #118335MVX Support NinjaKeymaster
Hi,
As per your requirement you have to override the file
Kindly override wp-content/plugins/dc-woocommerce-multi-vendor/templates/review/rating.php template by copying it to yourchildtheme/dc-product-vendor/review/rating.php.**You have to create the folder structure in your child theme folder.
Create a rating.php file and then add the above shared code in this file.
Kindly follow the reply #118156Regards,
-
March 26, 2021 at 8:40 PM #118340JamesParticipant
Hello,
Ok i have create the folder structure “yourchildtheme/dc-product-vendor/review/rating.php” and put you code in this “rating.php”
So i think i have done it well, my website doesn’t show a critical error x) , Thanks for you’r patience with me !
Best Regards.
James. -
March 26, 2021 at 10:32 PM #118343MVX Support NinjaKeymaster
You are most welcome @James
I hope you are satisfied with our assistance and plugin. A 5/5 review here- https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post , would be a great way to share your experience with others.
This motivates us to continue providing the best experience possible and also helps others know how WC-Marketplace can make their life easier.
-
-
AuthorPosts
The topic ‘Customer Rate Product/Vendor’ is closed to new replies.