Jump to content

[SOLVED] NO MORE SCENE (image mapping) AFTER UPGRADING TO 1.5.3.1.


Recommended Posts

Hello,

I need your help please.

I have just upgraded my website from 1.4.7.0 to 1.5.3.1

and i have a problem with the images mapping.

In back office "catalog/image mapping", i can see the pictures.

BUT when i see my website, it is doesn't work :(((

 

Can somebody help me please ? Thanks

Edited by Marie18 (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Perusi, where do I have to change this?

Look for the following rule:

<div class="screen_scene" id="screen_scene_{$scene->id}" style="background:transparent url(img/scenes/{$scene->id}-large_scene.jpg); height:{$largeSceneImageType.height}px; width:{$largeSceneImageType.width}px; {if !$smarty.foreach.scenes.first} display:none;{/if}">

 

Replace it with your scene images height and width :)

Link to comment
Share on other sites

  • 2 years later...

Where are the following variables set?
 
$largeSceneImageType.height
$largeSceneImageType.width
 
I just upgraded from 1.5.6.2 to 1.6.0.11 (forced to because of theme) and now my scenes are not being displayed...
 
I am getting a value of 710 for the width when viewed in my chrome elements inspector, but the following code is produced:

<div id="scenes">
	<div>
				<div class="screen_scene" id="screen_scene_12" style="background:transparent url(/img/scenes/12-large_scene_default.jpg); height:px; width:px; ">
					</div>
			</div>
	</div>

FIXED!!

 

Ok, in /controllers/front/CategoryController.php the values above are pulled as an array from the db... the problem was - my theme was using this code:
 

<div class="screen_scene" id="screen_scene_{$scene->id}" style="background:transparent url({$base_dir}img/scenes/{$scene->id}-large_scene_default.jpg); height:{$largeSceneImageType.height}px; width:{$largeSceneImageType.width}px; {if !$smarty.foreach.scenes.first} display:none;{/if}">

for the image (notice the large_scene_default.jpg string?)

 

well the controller uses ImageType::getFormatedName('scene') to assign the information to the variable which means the array assumes the scene name will be scene_default.jpg or scene.jpg... NOT large_scene_default.jpg as the theme was looking for. I changed the theme code (since it will likely not be upgraded as often - I hope) to match the default core db value scene_default... but it would be nice if the controller would pull the filename from the database field [name] in table ps_image_type table instead of being hardcoded... or at least provide a warning in the admin panel that changing this will break the code - since it is simple to change in the admin panel.

This fix is truly NOT ideal - but I call what prestashop has done here a "kludge"... this should be part of the API structure and the file name should not be hardcoded into the controller - it should be called from the db as outlined above, either that or make this variable non-changeable and document that in the API documents... oh wait - there is no API document - well....

Edited by obewanz (see edit history)
Link to comment
Share on other sites

Look for the following rule:

<div class="screen_scene" id="screen_scene_{$scene->id}" style="background:transparent url(img/scenes/{$scene->id}-large_scene.jpg); height:{$largeSceneImageType.height}px; width:{$largeSceneImageType.width}px; {if !$smarty.foreach.scenes.first} display:none;{/if}">
Replace it with your scene images height and width smile.png

 

 

Edit the scenes.tpl file and replace the above code line with this... 

<div class="screen_scene" id="screen_scene_{$scene->id}" style="background:transparent url(img/scenes/{$scene->id}-scene_default.jpg); height:{$largeSceneImageType.height}px; width:{$largeSceneImageType.width}px; {if !$smarty.foreach.scenes.first} display:none;{/if}"> 

...also make sure in your admin panel [preferences/images] setting that the name for the large scene file is "scene_default" and it will work without hardcoding the image dimensions. (see my other post in this thread)

Edited by obewanz (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...