Forum Replies Created
-
AuthorPosts
-
promita
ModeratorHi @l.gan, We’ve thoroughly debugged the code and identified an issue. Our plugin puts the product on Auto Draft to prevent any accidental deletions when vendors forget to save the product. However, we’ve noticed a problem when running the query to put the product on Draft. Two other plugins are running their queries using the same hook, leading to memory exhaustion errors.
Here’s the code snippet for creating the product draft on our end:
private function create_product_draft( $post_type ) { $user = wp_get_current_user(); $vendor = get_mvx_vendor( $user->ID ); if ( $vendor && $vendor->id ) { $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft', 'multivendorx' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) ); return get_post( $post_id ); } return false; }
CopyYou can find the reference in our GitHub repository here: https://github.com/multivendorx/MultiVendorX/blob/main/classes/products/class-mvx-products-edit-product.php
We kindly request that you contact the author of the conflicting plugin and inquire if they can investigate this issue to find a resolution. Thank you for your understanding.
promita
ModeratorHi, Since you are using similar hooks, the predefined fields in our codebase will naturally be present.
Now if you want to remove that predefined code of ours, you will have to remove that with the remove action first and then add your custom field using add action.
we use the below filter to add the piece section that you have mentioned in your screenshot:
woocommerce_get_price_html
CopyJuly 3, 2023 at 6:12 PM in reply to: How to remove tabs with reviews, and other features of reviews. #194028promita
ModeratorHi @l.gan, you can get the average rating of the vendor using this code.
$store_id = get_current_user_id(); $vendor_term_id = get_user_meta( $store_id, '_vendor_term_id', true ); $rating_val_array = mvx_get_vendor_review_info($vendor_term_id); $rating = $rating_val_array['avg_rating'];
Copypromita
ModeratorPlease reffer to this code and midify this as per your need :
add_filter( 'woocommerce_login_redirect', 'login_redirect_vendor', 99, 2); function login_redirect_vendor($redirect, $user) { if (class_exists('MVX')) { if (isset($user->roles) && is_array($user->roles)) { //check for vendor if (in_array('dc_vendor', $user->roles)) { // redirect page link $redirect = get_permalink(mvx_vendor_dashboard_page_id()); } else { $redirect = get_permalink(wc_get_page_id('myaccount')); } } } return $redirect; }
CopyMay 22, 2023 at 6:25 PM in reply to: Display Store Descriptions for products in the cart on Cart & Checkout pages #192348promita
ModeratorKindly add the below code in the functions.php file of your active theme –
add_action('woocommerce_before_checkout_form', 'display_vendor_store_descriptions_on_checkout'); function display_vendor_store_descriptions_on_checkout() { // Get the current cart instance $cart = WC()->cart; // Array to store the vendor IDs $vendor_ids = array(); // Loop through each cart item foreach ($cart->get_cart() as $cart_item_key => $cart_item) { // Get the product ID $product_id = $cart_item['product_id']; // Get the vendor ID for the product $vendor_id = get_mvx_product_vendors($product_id)->id; // Add the vendor ID to the array if it doesn't already exist if (!in_array($vendor_id, $vendor_ids)) { $vendor_ids[] = $vendor_id; } } // Loop through the vendor IDs and display the store descriptions if (!empty($vendor_ids)) { echo "Notices:"; foreach ($vendor_ids as $vendor_id) { $store_description = get_user_meta( $vendor_id, '_vendor_description', true ); if (!empty($store_description)) { echo $store_description; } } } }
Copypromita
ModeratorHi, our replies are inline :
2. how to add another option in dropdown that will allow me to redirect to “my account” page or any link of my choice, something like this: (Scrren2)
>> Use this hook to add the new menu:
apply_filters('mvx_vendor_dashboard_header_right_panel_nav', $panel_nav);
Copy3. how to redirect after logging in so that it directs to the page I choose, from which I will later redirect cta to the dashboard vendor.At this moment, after logging in, it immediately directs me to the vendor panel.
>> Use this hook to add redirect rule :
apply_filters( 'mvx_vendor_login_redirect_url', $redirect_to);
CopyThis will also stop our default redirect flow.
May 5, 2023 at 7:36 PM in reply to: Consulting on the Rental Pro Inventory Modification on Vendor Dashboard #191795promita
ModeratorHi @Chris, To delete the three fields add this below code in functions.php of your current active theme.
add_filter('mvx_frontend_dashboard_rental_pro_taxonomies', 'delete_fields', 10, 1); function delete_fields($link) { $link = array('resource', 'person', 'deposite', 'attributes', 'features'); return $link; }
Copypromita
ModeratorHi @mohsina.mce13, To remove vendor details add this below code in functions.php of your current active theme and you need to override vendor-new-order.php template file in your current active theme with this https://drive.google.com/file/d/1b6V5YH9mFmGyQBnCubAqu2jwUq3pjPnz/view?usp=share_link
add_filter( 'can_vendor_add_message_on_email_and_thankyou_page', '__return_false' ); add_filter( 'mvx_sold_by_text', '__return_false' );
Copypromita
ModeratorHi @Alex Dibben, To add the Vendor email you just need to overwrite the vendor-message-to-buyer.php template file of your cuurent active theme and add this code after line no 37
<p><?php echo esc_html_e('Vendor Email', 'multivendorx'); ?> <br> <?php echo $vendor->user_data->user_email; ?> </p>
Copypromita
ModeratorHi @kevajo, when you are adding a custom payment mode, you need to display its corresponding field using ‘mvx_vendors_tab_routes’ filter.
April 11, 2023 at 6:43 PM in reply to: Feature Request – Action Hooks on Vendor Dashboard – Order Detail page #190690promita
ModeratorHi @Justin Harrison, There is no hook/filter so you have to overwrite the vendor-order-details.php template file.
promita
ModeratorHi @Chris, You need to overwrite mvx-vendor-membership_template_vendor_plan.php template file and replace the code of line no 96 with this below code
<div class="wvm_price wvm_price_<?php echo $index; ?>" style="color: <?php echo get_mvx_vendor_settings('_plan_price_color', 'payment_membership_design'); ?>"><?php echo ($product->get_regular_price() == 0 || empty($product->get_regular_price())) ? __( 'FREE', 'mvx-pro' ) : wc_price($initial_billing_amt); ?></div>
CopyApril 10, 2023 at 5:44 PM in reply to: More offers-display the rating of the product itself instead of the store rating #190625promita
Moderator@l.gan kindly share a detailed video describing what customization you are looking for and where you want it to be displayed so that we can help you accordingly
April 5, 2023 at 5:58 PM in reply to: Supplier control pannel – can’t add pictures to new product listing #190449promita
ModeratorHi @popa_catalin1983 thanks for sharing the sftp access. However we do not have the permission of adding any code in your files . Kindly talk to your technical team and tell them to allow us to write in the files.
April 3, 2023 at 5:23 PM in reply to: How can one vendor sell several brands from 1 account? #190319promita
ModeratorHi l.gan, To get the value of the “pa_brand” attribute add this code in functions.php of your current active theme:
add_filter( 'mvx_vendor_dashboard_product_list_table_headers', function($headers) { $headers['vendor_brands'] = __( 'Brand', 'multivendorx' ); return $headers; } ); // For add that headers content add_filter( 'mvx_vendor_dashboard_product_list_table_rows', function( $row, $product ) { $row['vendor_brands'] = $product->get_attribute('brand'); return $row; }, 10, 2 );
Copy -
AuthorPosts