Troubleshooting Wholesale
This guide will help you resolve common issues that may arise when using the Wholesale plugin.
Common Issues
Plugin Not Appearing in Admin
If the Wholesale plugin doesn't show in the admin panel:
Check File Permissions:
bashchmod -R 755 platform/plugins/ecommerce-wholesaleVerify plugin.json:
bashcat platform/plugins/ecommerce-wholesale/plugin.jsonClear Cache:
bashphp artisan cache:clear php artisan config:clearCheck Core Version:
- Verify Botble CMS is version 7.6.0 or higher
Wholesale Prices Not Showing
If wholesale customers can't see special pricing:
Check Customer Group Assignment:
- Go to Customers in admin
- Edit customer account
- Verify group assignment exists
- Check expiration date (if set)
Verify Group Status:
- Go to Ecommerce > Wholesale > Customer Groups
- Ensure group status is Published
Check Customer Login:
- Customer must be logged in
- Test with correct credentials
- Check session isn't expired
Verify Pricing Rules (if using tiered pricing):
- Go to Ecommerce > Wholesale > Pricing Rules
- Ensure rules are Published
- Check quantity ranges are correct
Clear All Caches:
bashphp artisan cache:clear php artisan config:clear php artisan view:clearTest in Incognito Mode:
- Rule out browser cache issues
- Rule out cookie problems
Pricing Table Not Displaying on Product Page
If the pricing table doesn't appear:
Check Product Visibility:
- Edit product in admin
- Verify visibility allows wholesale customers
- Check group access restrictions
Verify Pricing Rules Exist:
- Product must have active pricing rules
- Rules must be for correct customer group
- Status must be "Published"
Check Hook Integration:
- Theme must support
ecommerce_after_product_descriptionfilter - Most Botble themes support this by default
- Theme must support
Check JavaScript:
- Open browser console (F12)
- Look for JavaScript errors
- Ensure jQuery is loaded
Clear Browser Cache:
- Hard refresh: Ctrl+Shift+R
- Clear all site data
MOQ Not Being Enforced
If minimum order quantities aren't working:
Verify MOQ Settings:
- Edit product in admin
- Check "Wholesale Settings" tab
- Ensure MOQ values are set
Check Customer Group Match:
- MOQ can be group-specific
- Verify customer is in correct group
- Test with "All Wholesale" MOQ
Clear Cart:
- Empty cart completely
- Try adding product fresh
Check JavaScript Console:
- Open developer tools (F12)
- Look for validation errors
- Check for AJAX request failures
Test Quantity Increment:
- Try valid quantities (multiples)
- Verify system adjusts invalid amounts
Wrong Discount Applied
If customers get incorrect discounts:
Multiple Groups Conflict:
- Check customer's group assignments
- Review discount resolution strategy in settings
- Verify group priorities
Overlapping Pricing Rules:
- Check for multiple rules on same product
- Ensure quantity ranges don't overlap
- Review rule priorities
Cache Issues:
- Clear all caches (server and browser)
- Log out and log back in
- Test in incognito mode
Price Calculation:
- Verify discount type is correct
- Check discount value
- Test calculation manually
Product Visibility Issues
If products aren't showing/hiding correctly:
Check Visibility Setting:
- Edit product in admin
- Verify visibility option selected
- Save product
Verify Customer Status:
- Customer must be approved wholesale customer
- Must be logged in
- Group must be active
Check Group Access:
- If group access is set, verify customer is in allowed groups
- Empty group access = all wholesale customers
Clear Caches:
- Clear server cache
- Clear browser cache
- Test in incognito
Wholesale Application Issues
If applications aren't working:
Check Settings:
- Verify wholesale system is enabled
- Check approval requirements setting
- Confirm registration form is accessible
Test Form Submission:
- Fill out form completely
- Check for validation errors
- Verify CSRF token exists
Check Email Configuration:
- Verify email settings in
.env - Test email sending with any order
- Check spam folder
- Verify email settings in
Review in Admin:
- Go to Ecommerce > Wholesale > Applications
- Check if application was recorded
- Look for error messages
Check Permissions:
- Verify user has permission to view applications
- Check approval permissions
Settings Issues
Settings Not Saving
Check File Permissions:
bashchmod -R 775 storage chown -R www-data:www-data storageClear Config Cache:
bashphp artisan config:clearCheck Database:
- Verify database connection
- Check
settingstable exists - Look for constraint errors
Review Error Logs:
- Check
storage/logs/laravel.log - Look for save failures
- Check
Display Style Not Changing
Clear All Caches:
- Server cache:
php artisan cache:clear - View cache:
php artisan view:clear - Browser cache: Ctrl+Shift+Delete
- Server cache:
Check CSS Conflicts:
- Theme CSS may override plugin styles
- Use browser inspector to debug
- Check CSS specificity
Verify Asset Publishing:
bashphp artisan vendor:publish --tag=cms-public --force
Database Issues
Migration Errors
If you encounter migration errors:
# Rollback wholesale migrations
php artisan migrate:rollback --path=platform/plugins/ecommerce-wholesale/database/migrations
# Re-run migrations
php artisan migrate --path=platform/plugins/ecommerce-wholesale/database/migrationsVerify Tables Exist
SHOW TABLES LIKE 'ws_%';Expected tables:
ws_customer_groupsws_customer_group_assignmentsws_group_pricing_rulesws_product_moqws_product_visibilityws_product_group_accessws_wholesale_applications
Data Integrity Check
-- Check customer groups
SELECT * FROM ws_customer_groups WHERE status = 'published';
-- Check pricing rules
SELECT pr.*, p.name as product_name, cg.name as group_name
FROM ws_group_pricing_rules pr
JOIN ec_products p ON pr.product_id = p.id
JOIN ws_customer_groups cg ON pr.customer_group_id = cg.id
WHERE pr.status = 'published';
-- Check customer assignments
SELECT ca.*, c.name as customer_name, cg.name as group_name
FROM ws_customer_group_assignments ca
JOIN ec_customers c ON ca.customer_id = c.id
JOIN ws_customer_groups cg ON ca.customer_group_id = cg.id;Performance Issues
Slow Product Pages
Add Database Indexes:
sqlCREATE INDEX idx_pricing_product_group ON ws_group_pricing_rules(product_id, customer_group_id); CREATE INDEX idx_moq_product_group ON ws_product_moq(product_id, customer_group_id); CREATE INDEX idx_visibility_product ON ws_product_visibility(product_id);Enable Caching:
- Configure Redis or Memcached
- Set cache driver in
.env - Enable query caching
Optimize Rules:
- Remove unused pricing rules
- Archive old customer groups
- Clean up expired assignments
High Database Queries
Check Query Count:
- Use Laravel Debugbar
- Monitor N+1 query issues
- Review eager loading
Enable Query Caching:
- Cache pricing rules per product
- Cache customer group assignments
- Use Redis for session storage
JavaScript Debugging
Finding Console Errors
Open Developer Tools:
- Press F12 or right-click > Inspect
- Go to Console tab
Common Errors:
TypeError- Missing element or methodReferenceError- Undefined variableSyntaxError- Malformed code
Network Issues
Check Network Tab:
- Look for failed requests (red)
- Check API endpoints
- Verify response codes
Common Network Issues:
- 403 - CSRF token invalid
- 404 - Route not found
- 422 - Validation error
- 500 - Server error (check logs)
Testing Without Cache
// In browser console, check elements
document.querySelector('.wholesale-pricing-table')
document.querySelector('[data-moq]')Advanced Troubleshooting
Clearing All Caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clearOr via admin panel:
- Go to Admin > Platform Administration > Cache management
- Click "Clear all CMS cache"
Checking Logs
Review Laravel logs for errors:
tail -f storage/logs/laravel.logLook for:
- "wholesale" or "ws_" mentions
- Stack traces
- Timestamp correlation with issue
Testing Discount Calculation
// In tinker: php artisan tinker
$group = \Botble\EcommerceWholesale\Models\CustomerGroup::find(1);
$originalPrice = 100;
$discount = $group->calculateDiscount($originalPrice);
$finalPrice = $group->calculateFinalPrice($originalPrice);
echo "Original: $originalPrice, Discount: $discount, Final: $finalPrice";Testing MOQ Validation
// In tinker
$moq = \Botble\EcommerceWholesale\Models\ProductMOQ::where('product_id', 1)->first();
$quantity = 15;
$isValid = $moq->isValidQuantity($quantity);
$nextValid = $moq->getNextValidQuantity($quantity);
echo "Quantity: $quantity, Valid: " . ($isValid ? 'Yes' : 'No') . ", Next Valid: $nextValid";Resetting Customer Groups
// In tinker - CAUTION: This removes all group assignments
\Botble\EcommerceWholesale\Models\CustomerGroupAssignment::truncate();Error Messages
"Customer group not found"
Cause: Group ID doesn't exist or was deleted
Solution:
- Verify group exists in admin
- Check customer's group assignments
- Re-assign customer if needed
"Minimum order quantity not met"
Cause: Cart quantity below MOQ
Solutions:
- Increase quantity to meet minimum
- Check MOQ setting is correct
- Verify customer group matches
"Minimum order value not met"
Cause: Cart total below group's minimum
Solutions:
- Add more items to cart
- Check if discounts reduced total
- Verify minimum value setting
"Product not available for your customer group"
Cause: Product restricted to different groups
Solutions:
- Check product group access settings
- Verify customer's group assignments
- Contact admin to request access
Getting Support
Before Contacting Support
- Review this troubleshooting guide
- Check the FAQ
- Gather relevant error messages and logs
Information to Provide
Environment Details:
- Botble CMS version
- PHP version
- Wholesale plugin version
- Browser and version
- Theme name
Issue Description:
- Detailed description
- Steps to reproduce
- Expected vs actual behavior
Screenshots/Logs:
- Screenshots of error messages
- Relevant log entries from
storage/logs/laravel.log - Browser console errors
- Database query errors
Contact Methods
- Documentation: https://docs.botble.com/wholesale
- Support Tickets: https://botble.ticksy.com
- Email: [email protected]
We typically respond within 12-24 hours during business days.
