Overview
Publishing products on Mis Compras is a straightforward process designed to get your items listed quickly. The platform provides an intuitive form where you can add all necessary product details, images, and pricing information.Accessing the Publishing Form
You must be logged in to publish products. The platform verifies your authentication status via localStorage before allowing product submissions.
Product Publishing Form
The product publishing interface (publicar_producto.html) contains the following fields:
Required Fields
Product NameThe title of your product. Make it descriptive and search-friendly.Example: “Samsung Galaxy S23 Ultra 256GB”
Product DescriptionDetailed description of your product. Include features, specifications, condition, and any other relevant details.Minimum height: 140px text area for comprehensive descriptions
PriceProduct price in USD. Supports decimal values for cents.Example: 999.99
Product ImageUpload a product photo. Accepted formats: image files (JPG, PNG, GIF, etc.)The form includes:
accept="image/*"CategorySelect the appropriate category for your product. Categories are dynamically loaded from the database via
php/obtener_categorias.php.Available categories include: Electronics, Laptops, Smartphones, and more.Publishing Workflow
Fill Out Product Information
Complete all required fields in the form. The form validates that all fields are filled before submission.
Submit the Form
Click the “Publicar” button. The form data is sent to the backend as multipart/form-data to support image uploads.Backend Endpoint:
php/vender.phpThe submission includes:- All form field data
- User ID (
id_vendedor) from localStorage - Product image file
Technical Implementation
Form Submission Handler
Category Loading
Categories are dynamically loaded when the page loads:Success Animation Component
The platform uses React to display a polished success animation:Best Practices for Product Listings
Write Clear Titles
Use descriptive, keyword-rich titles that accurately represent your product
Detailed Descriptions
Include specifications, condition, features, and any defects or issues
Quality Images
Use high-resolution, well-lit photos showing the product from multiple angles
Competitive Pricing
Research similar products to set competitive prices
Troubleshooting
Authentication Error
Authentication Error
Issue: “⚠️ Debes iniciar sesión para publicar productos.”Solution: Ensure you’re logged in. Check that
localStorage.id_usuario contains a valid user ID. Log out and log back in if necessary.Image Upload Fails
Image Upload Fails
Issue: Product publishes but image doesn’t displaySolution:
- Verify the image file format is supported (JPG, PNG, GIF)
- Check file size isn’t too large
- Ensure proper permissions on the server’s image upload directory
Categories Not Loading
Categories Not Loading
Issue: Category dropdown shows only “Seleccionar categoría”Solution:
- Check browser console for API errors
- Verify
php/obtener_categorias.phpis accessible - Ensure database connection is working
Form Validation Errors
Form Validation Errors
Issue: Can’t submit the formSolution:
- Fill out all required fields
- Ensure price is a valid number
- Select a category from the dropdown
- Choose an image file
What Happens After Publishing?
Once your product is published:- Immediate Visibility: Your product appears in the marketplace and category listings
- Profile Update: The product is added to your seller profile’s product grid
- Statistics Tracking: View tracking begins immediately for analytics
- Search Integration: Your product becomes searchable by title and category
After publishing, you can edit or delete your product from your profile page. See the Managing Listings guide for details.
Next Steps
Learn to Manage Your Products
Discover how to edit, update, and optimize your product listings