a340300
Forum Replies Created
-
I just updated and the site seems much quicker now. However, I still get emails for both the main order and sub order even though I have configured the settings to send the main order email only.
Also, I was wondering what the shortcakes are for the vendor registration. The settings mention both [store_registration] and [marketplace_registration], but [store_registration] appears as plaintext when I preview the page, and [marketplace_registration] loads for a while before timing out and sending my back to my WordPress admin dashboard.
Thank you for flagging the bug!
For the emails, when a test order is placed through a vendor, the emails (both customer and store/vendor emails) are not rendering product details correctly. Specifically, product image is displayed correctly but the product name/price/quantity is missing, as is the subtotal, shipping, etc.
I confirmed the following:
- Using the WP Mail Logging plugin, the raw email content shows that all product details (name, quantity, price, subtotal, etc.) are present in the generated email HTML
- The issue only occurs in the final rendered email received by the customer/vendor (tested both iCloud and gmail emails)
- WooCommerce email templates are not overridden in my theme (checked under WooCommerce → Status → Templates)
Is this a bug you can replicate on your end?
I also tried placing a test order with two products (each from different vendors), and in “Customer-facing order presentation & invoicing” I had opted for “Main Order (Combined)- Customers receive one combined order and one invoice for their entire purchase.” However, I got two emails, one for each product (and two different order numbers). How can I send one main email, and separately, where can I edit the look of the emails?
- This reply was modified 1 month ago by a340300.
I see that issue was fixed in 5.0.4, thank you! Some of the repeated database query issues were fixed, and I noticed that the load time to view a store’s page went from 17-20 seconds to about 8. However, Query monitor shows about 7200 duplicate queries when trying to view a store’s page:
- MultiVendorX\Store\Store->get_meta — 3,201 calls (1.76s)
- MultiVendorX\Store\Store->get_all_meta — 1,074 calls (0.65s)
- MultiVendorX\Store\Store->load — 1,049 calls (0.63s)
- MultiVendorX\StoreReview\Util::get_reviews_by_store — 300 calls (0.18s)
- MultiVendorX\StoreReview\Util::get_overall_rating — 300 calls (0.17s)
- MultiVendorX\Store\StoreUtil::get_primary_owner — 300 calls (0.16s)
- MultiVendorX\Store\StoreUtil::get_store_users — 300 calls (0.15s)
- MultiVendorX\Store\Store::get_store — 147 calls (0.08s)
- Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->get_orders_type — 50 calls (0.03s)
- WC_Shipping_Zone_Data_Store->get_methods — 50 calls (0.03s)
- WC_Shipping_Zone_Data_Store->get_zone_data_for_ids — 50 calls (0.03s)
- WC_Shipping_Zone_Data_Store->get_zone_locations_for_ids — 50 calls (0.03s)
- WC_Shipping_Zone_Data_Store->get_zones — 25 calls
BUG 1: FrontendScripts::localize_scripts() renders the full product loop inside wp_head()
I traced the following call stack via Query Monitor:
wp_head()
→ wp_enqueue_scripts()
→ FrontendScripts::localize_scripts()
→ StoreUtil::get_specific_store_info()
→ loads store-tabs.php
→ loops through every product via content-product.php
→ fires add_sold_by_in_shop_and_single_product_page() per product
→ calls get_reviews_by_store(), get_overall_rating(), user_has_product() per productThis means the entire product loop — including reviews, store info, and wishlist checks — is being executed inside wp_head() before the page has even rendered, purely to gather JavaScript localization data. This results in the following queries firing once per product:
- MultiVendorX\StoreReview\Util::get_reviews_by_store — 300 calls (0.18s)
- MultiVendorX\StoreReview\Util::get_overall_rating — 300 calls (0.17s)
- MultiVendorX\Store\StoreUtil::get_primary_owner — 300 calls (0.16s)
- MultiVendorX\Store\StoreUtil::get_store_users — 300 calls (0.15s)
- NMGR\Lib\AddToWishlist->user_has_product — 300 calls (0.25s)
localize_scripts() should pass simple scalar variables to JavaScript, not render full templates.
BUG 2: Store->load() has no internal object caching
On a single store page load, the following query runs 1,048 times:
SELECT * FROM wp_multivendorx_stores WHERE ID = 1
This is the same row, for the same store, fetched over a thousand times in one request because Store->load() performs a fresh database query every time it is called with no in-memory caching. The same pattern applies to related functions:
- MultiVendorX\Store\Store->get_meta — 3,201 calls (1.76s)
- MultiVendorX\Store\Store->get_all_meta — 1,074 calls (0.65s)
- MultiVendorX\Store\Store->load — 1,049 calls (0.63s)
- MultiVendorX\Store\Store::get_store — 147 calls (0.08s)
Thank you! I see it was closed, does that mean it will be pushed in the next update?
Also, in the Product Category block in the store’s sidebar, is there a way to nest the subcategories? For example, it currently looks like
- Category
- Subcategory
instead of
- Category
- Subcategory
Thank you, I was able to fix issues 1 & 4!
For issue 3: On every page load — including single product pages — the function MultiVendorX\Block->enqueue_all_block_assets() is being called 40 times instead of once. Each call triggers a full chain of database queries including:
- MultiVendorX\Store\Store::get_store() — 40 to 41 calls
- MultiVendorX\Store\Store->get_all_meta() — 40 to 41 calls (including repeated calls for store_id = 0)
- WC_Shipping_Zone_Data_Store->get_zones() — 40 to 41 calls
- WC_Shipping_Zone_Data_Store->get_zone_data_for_ids() — 80 to 82 calls
- WC_Shipping_Zone_Data_Store->get_zone_locations_for_ids() — 80 to 82 calls
- WC_Shipping_Zone_Data_Store->get_methods() — 80 to 82 calls
This results in 450+ duplicate queries on all pages, causing 20-second load times and frequent 502 bad gateway errors. Query Monitor shows all of these trace back to enqueue_all_block_assets() being called in a loop — apparently once per registered block rather than once per page. This occurs on all pages from those with vendor content (like vendor storefronts, product pages) to simple pages without any vendor data like ‘about us’ and the privacy policy
A few additional issues/questions
- When a store adds a product and enables stock management, the product says out of stock even with an SKU and quantity entered.
- I find that my site runs very slowly now. It takes upwards of 10 seconds to see a store’s page, and the vendor dashboard takes several clicks and several seconds to load a page, add a product, etc.
- When using the shortcode [marketplace_stores order=”ASC”], the products are displayed and the product title text is very large. Is it possible to just display the store logos and names, rather than showing the products as well? This is just for a page to search vendors, customers can still purchase from the store’s page.
- This reply was modified 1 month, 1 week ago by a340300.
Thank you for letting me know about the update. I tested my site and it appears that the format still has the store name and logo over the banner instead of below (i.e. no matter what format I choose, it defaults to the style of Luxe Display).
Got it, thank you.
Another thing I wanted to mention was that in Settings -> Store Configuration -> Appearance, no matter which option I choose, the store page always has the logo, store name, and description overlayed on top of the banner (like the Luxe display). I wanted to enable the Dynamic option (store info below the banner), but it always appears as the Luxe configuration. I also tried Signature View but they all look like Luxe.
Thank you very much. I was able to fix the tax issue and the update cleared up the shipping problem!
I did have another question: I’d like to add a page where people can search for vendors based on location. It seems this was a shortcode before (https://multivendorx.com/docs/faqs/how-can-customer-search-vendor-by-location/) but it does not seem to work with the new update. Is there a new shortcode I can use to achieve this?
Thank you!
I checked my database from my backup pre-update and this is what I had used to calculate taxes based on the vendor’s store location for local pickup orders rather than the customer’s shipping address:
/**
* FORCE TAX BY VENDOR LOCATION FOR LOCAL PICKUP
*/
// 1. Tell WooCommerce NOT to automatically use the main shop base for local pickup
add_filter( 'woocommerce_apply_base_tax_for_local_pickup', '__return_false' );
// 2. Inject the Vendor's billing address into the tax calculation
add_filter( 'woocommerce_customer_taxable_address', 'mvx_local_pickup_vendor_tax_location', 10, 1 );
function mvx_local_pickup_vendor_tax_location( $address ) {
// Only run on frontend checkout/cart updates
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return $address;
if ( ! WC()->session ) return $address;
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
$is_local_pickup = false;
// Check if the user selected a local pickup method
if ( ! empty( $chosen_methods ) ) {
foreach ( $chosen_methods as $method ) {
if ( strpos( $method, 'local_pickup' ) !== false ) {
$is_local_pickup = true;
break;
}
}
}
if ( $is_local_pickup && WC()->cart ) {
$cart = WC()->cart->get_cart();
foreach ( $cart as $item ) {
// Get the vendor for the current product
$vendor = get_mvx_product_vendors( $item['product_id'] );
if ( $vendor && isset( $vendor->id ) ) {
$vendor_id = $vendor->id;
// Pull address from the billing meta keys you identified
$country = get_user_meta( $vendor_id, 'billing_country', true );
$state = get_user_meta( $vendor_id, 'billing_state', true );
$postcode = get_user_meta( $vendor_id, 'billing_postcode', true );
$city = get_user_meta( $vendor_id, 'billing_city', true );
// If the vendor has a valid country and state set, use it
if ( ! empty( $country ) && ! empty( $state ) ) {
return array( $country, $state, $postcode, $city );
}
}
}
}
return $address;
}I am also wondering if you can suggest a code snippet to force taxes to be calculated based on the vendor’s address when the customer has selected local pickup. I had a snippet that worked before the update but it does not anymore.
Thank you!
This is the error I get on every page when trying to edit them (it was working up until the update):
Uncaught Error: Call to a member function needs_shipping() on null
in [REDACTED]/plugins/dc-woocommerce-multi-vendor/modules/StoreShipping/Frontend.php on line 170Call stack:
MultiVendorX\StoreShipping\Frontend::multivendorx_checkout_user_location_fields()
wp-includes/class-wp-hook.php:341WP_Hook::apply_filters()
wp-includes/plugin.php:205apply_filters()
wp-content/plugins/woocommerce/includes/class-wc-checkout.php:298WC_Checkout::initialize_checkout_fields()
wp-content/plugins/woocommerce/includes/class-wc-checkout.php:322WC_Checkout::get_checkout_fields()
wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php:512WC_Stripe_UPE_Payment_Gateway::javascript_params()
wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-blocks-support.php:242WC_Stripe_Blocks_Support::get_gateway_javascript_params()
wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-blocks-support.php:190WC_Stripe_Blocks_Support::get_payment_method_data()
wp-content/plugins/woocommerce/src/Blocks/Payments/PaymentMethodRegistry.php:62Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry::get_all_registered_script_data()
wp-content/plugins/woocommerce/src/Blocks/Payments/Api.php:92Automattic\WooCommerce\Blocks\Payments\Api::add_payment_method_script_data()
wp-includes/class-wp-hook.php:341WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:365WP_Hook::do_action()
wp-includes/plugin.php:522do_action()
wp-content/plugins/woocommerce/src/Blocks/BlockTypes/MiniCart.php:287Automattic\WooCommerce\Blocks\BlockTypes\MiniCart::enqueue_data()
wp-content/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php:111Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock::enqueue_editor_assets()
wp-includes/class-wp-hook.php:341WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:365WP_Hook::do_action()
wp-includes/plugin.php:522do_action()
wp-admin/edit-form-blocks.php:339require('[REDACTED]/wp-admin/edit-form-blocks.php')
wp-admin/post.php:187