issues with images and add to cart
-
I have been working on to migrate a website from magento2 to bagisto. Things are good but facing an issue with the image and adding products to cart. The images on the product page keeps showing the shimmer image and console is showing 404 for the images. Images loaded here are via cache and small , large etc.
Another issue is with the add to cart process and add to cart button is disabled, we have the required inventory and all but still is saleable is returning false.
Any guidance to fix these would be a great help. -
Already did indexing using the artisan indexer:index command but still issue persists.
-
@samparker said in issues with images and add to cart:
Already did indexing using the artisan indexer:index command but still issue persists.
Hi,
Both issues are generally related to incomplete product migration data rather than indexing alone.
1. Product Images Showing Shimmer / 404 Errors
Please verify the following:
-
Check whether the original product images exist in the
storage/app/public/productdirectory. -
Ensure image paths stored in the
product_imagestable are correct and match the actual file locations. -
Run the storage symlink command:
php artisan storage:link -
Clear cache and regenerate indexes:
php artisan optimize:clear php artisan indexer:index -
Open the image URL that returns 404 and verify whether the source image actually exists.
-
If images were migrated directly from Magento, confirm they were copied to Bagisto's expected product image storage structure.
2. Add to Cart Disabled (
isSaleable()Returns False)Please check:
- Product status is enabled.
- Product is assigned to the current channel.
- Product is assigned to the current locale.
- Product has a valid price.
- Inventory source quantity is greater than zero.
- The inventory source is assigned to the channel.
- Product is not marked as out of stock.
- Parent-child associations are correct for configurable, grouped, or bundle products.
For debugging, inspect the result of:
$product->haveSufficientQuantity(1); $product->isSaleable(); $product->totalQuantity();Also verify inventory records exist in:
product_inventories channel_inventoriesAdditional Check
Since the data was migrated from Magento 2, compare a newly created Bagisto product against a migrated product. If a newly created product works correctly while migrated products do not, the issue is likely caused by missing channel, inventory, image, or attribute mapping data during migration.
If you can share the Bagisto version and the exact 404 image URL along with the
isSaleable()debug output, we can help identify the root cause more precisely.Thanks
Aviral
Team Bagisto -
-
@01aviral-webkul Thanks alot, these points helped to fix the issue.