Bug on image path

Hi I run Magento 1.5.0.1 and installed JMSlideshow 1.0.0.

I run a multiple websites / stores with Magento. For example on http://shopUrl/store/ I run the easyshop template and on http://shopUrl/store/Oganis the Oganis template.

All config has been done correctly in admin.

While the JMSlideshow is working properly on http://shopUrl/store/ it is not on http://shopUrl/store/Oganis.

My settings are as following:

System -> Config -> Web -> Base Media URL: http://shopUrl/store/media/ for both sites.

The JMSlideshow configs are:

For Main Web Site -> media/jmslideshow/easyshop
For Oganis -> media/jmslideshow/oganis

When I load http://shopUrl/store/Oganis I can see JMSlideshow is trying to load images from http://shopUrl/store/Oganis/media/re…-1_580_280.jpg

which is wrong since the Base Media URL has been set as http://shopUrl/store/media/ and the JMSlideshow Oganis to media/jmslideshow/oganis.

Could you provide any help please?

Thank you so much for your permanent support !

2 answers

Profile photo of Antoine Ubavicius 0.00 $tone August 9, 2011
Public

I was able to locate the bug in

/app/design/frontend/default/jm_oganis/template/joomlart/jmslideshow in files list.phtml / list_products.phtml

I located this:

PHP Code:

<div class="jm-slide-item"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$mainsThumbs[$i];?>" alt="Main Thumb"/>


and

PHP Code:

<?php if ($config['navigation']=='thumbs'){?><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$thumbArray[$i]?>" alt="Photo Thumb" />


The problem is that you refer to Mage_Core_Model_Store::URL_TYPE_WEB for the Media URL while it should be Mage_Core_Model_Store::URL_TYPE_MEDIA. I tried to replace Mage_Core_Model_Store::URL_TYPE_WEB with Mage_Core_Model_Store::URL_TYPE_MEDIA but it wont work cause you are inserting somewhere else another media/ folder so to achieve my goal I did as below:

PHP Code:

<div class="jm-slide-item"><img src="<?php echo str_replace('Oganis/','',Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)).$mainsThumbs[$i];?>" alt="Main Thumb"/>


and

PHP Code:

<?php if ($config['navigation']=='thumbs'){?><img src="<?php echo str_replace('Oganis/','',Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)).$thumbArray[$i]?>" alt="Photo Thumb" />


In that case I take the sustract "Oganis/" from the base URL.

I hope this will help fixing this small bug.

Cheers

#1

This question is now closed

Written By

Comments