Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Images in Product Descriptions not working properly


DKarr

Recommended Posts

When I add an image to the  Backend Product Description, it uploads it to the server and records the dimensions and looks just fine. But it does not display it in Frontend Product.  Looking at the source code I see the error.  It is adding /shop/ to the image source.

ie: <img alt="" src="/shop/images/corrector.jpg" style="width: 600px; height: 464px;" />

If I manually correct that to:

<img alt="" src="images/corrector.jpg" style="width: 600px; height: 464px;" />

The image displays fine in the Frontend product but does not display in the Backend product and generates and error log:

Error description:
yii\base\InvalidRouteException: Unable to resolve the request "images/corrector.jpg". in /home/domain/public_html/shop/lib/vendor/yiisoft/yii2/base/Module.php:561

At least 90% of my programming problems lie somewhere between my keyboard and my chair.

Link to comment
Share on other sites

It sounds like the issue is with the image path being incorrectly prefixed with /shop/ in the frontend, but not in the backend. This discrepancy could be due to a configuration issue or a bug in your CMS or store settings.

To resolve this:

  1. Check Your CMS Configuration: Ensure that the base URL for media or image paths is set correctly in your CMS settings.

  2. Inspect Template or Theme Files: There might be hardcoded paths or specific configurations in your theme or template files that prepend /shop/ to the image URLs. Review these files to adjust the path settings.

  3. Review File Upload Code: If you have custom code handling image uploads, verify that it sets the correct paths for images in both the frontend and backend.

  4. Clear Caches: After making changes, clear any caches to ensure the updates are applied.

If the problem persists, consult the documentation for your CMS or seek support from the CMS community or developer for a more specific fix.

Link to comment
Share on other sites

  • 2 weeks later...

I figured out that the problem is hidden in the code some where:  it uploads the image to "shop/images" file but displays the url on the frontend as "shop/admin/images" file.

Hopefully, this can be corrected in the next update.  Meanwhile, I have added this to my list of work-around solutions/ignored errors.

At least 90% of my programming problems lie somewhere between my keyboard and my chair.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...