promita

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 37 total)
  • Author
    Posts
  • in reply to: Conflict with other plugins #204054
    promita
    Keymaster

    Hi @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;
    }
    Copy

    You 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.

    in reply to: VENDORS CANNOT ADD PRODUCTS #197158
    promita
    Keymaster

    Hi, 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
    Copy
    promita
    Keymaster

    Hi @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'];
    
    Copy
    in reply to: Vendor Store Page – Store Tabs Not Showing #193393
    promita
    Keymaster

    Please 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;
    }
    Copy
    promita
    Keymaster

    Kindly 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;
                }
            }
        }
    }
    
    Copy
    in reply to: vendor panel, dropdown, modifications #191984
    promita
    Keymaster

    Hi, 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);
    Copy

    3. 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);
    Copy

    This will also stop our default redirect flow.

    promita
    Keymaster

    Hi @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;
    }
    
    Copy
    in reply to: Deleted fields still showing #191643
    promita
    Keymaster

    Hi @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' );
    
    Copy
    in reply to: Add Vendor Email to the Vendor details on order page #191234
    promita
    Keymaster

    Hi @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>
    
    Copy
    in reply to: I can’t activate Multivendor X on my site. #190915
    promita
    Keymaster

    Hi @kevajo, when you are adding a custom payment mode, you need to display its corresponding field using ‘mvx_vendors_tab_routes’ filter.

    promita
    Keymaster

    Hi @Justin Harrison, There is no hook/filter so you have to overwrite the vendor-order-details.php template file.

    in reply to: Help to Complete My Custom Code #190688
    promita
    Keymaster

    Hi @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>
    
    Copy
    promita
    Keymaster

    @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

    promita
    Keymaster

    Hi @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.

    in reply to: How can one vendor sell several brands from 1 account? #190319
    promita
    Keymaster

    Hi 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
Viewing 15 posts - 1 through 15 (of 37 total)