PDA

View Full Version : turning off other images for this product



lgreitzer
08-11-2005, 05:26 PM
One more question from a noob. I can't seem to find a setting to turn off the 'other images for this product' box. Any hints? TIA.

Bsnrjones
10-27-2005, 12:32 PM
I wish I knew! I have fumbled around in the templates, but not sure which part to remove.

I just have a thumbnail, and a big image. I don't need to show extra images, and just want to turn that box off.

Anyone??

spottedhaggis
03-31-2006, 01:27 PM
I did this manually by editing the template and removed the code.

Its surprisingly easy to be honest

load up the following page into notepad.

catalog/templates/yourtemplate/content/product_info.tpl.php

Its easier in dreamweaver, so if you have dreamweaver, load that page into it, change the view to design view, and look for a large clear table near the center, directly under this is the table you need to remove.

For those who do not have or know dreamweaver, open the file in notepad and look for and delet the following lines (based on OSCMAX RC2

<tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText"><?php echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
</div>
<div class="screenshotsBlock">
<?php include(DIR_WS_MODULES . 'dynamic_mopics.php'); ?>
</div>
</td>
</tr>

---------------------------------------
so it will now look like this

</td>
</tr>
<?php
//// BEGIN: Added for Dynamic MoPics v3.000
?>
<?php
//// END: Added for Dynamic MoPics v3.000
?>
<tr>

and thats all there is too it.

met00
03-31-2006, 04:12 PM
Um, don't delete the lines, move them to the mopics file where they belong. Then when product_info.tpl.php runs it will go to mopics, and if there is no mopics to display it won't put up anything, but if there are mopics it will put up the box.

Bad coding, goes against style (osc style guide is to display if there is something to display, and do not display if there is nothing to display, unlike IBM's styleguide of "this page intentionally left blank.").

product_info.tpl.php


//// BEGIN: Added for Dynamic MoPics v3.000
?>
<!-- <tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText"><?php
echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
</div>
<div class="screenshotsBlock"> -->
<?php include(DIR_WS_MODULES . 'dynamic_
mopics.php'); ?>
<!-- </div>
</td>
</tr> -->
<?php
//// END: Added for Dynamic MoPics v3.000
?>

modules/dynamic_mopics.php


if (mopics_file_exists(DIR_FS_CATALOG . str_replace($search, $replace, D
YNAMIC_MOPICS_PATTERN))) {
//
// moved the mopics box to here from the products info template
//
?> <tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText"><?php
echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
</div>
<div class="screenshotsBlock">
<?


and


// All thumbnails have been found and displayed; clear all of th
e CSS floats
echo '<div class="clearScreenshots"><hr /></div>';
//
// moved the mopics box from the products template to here
//
?> </div>
</td>
</tr>
<?
} else {
// No extra images found for this product
// echo '<p class="noScreenshots"><span class="smallText">' . TEXT_
NO_MOPICS . '</span></p>';
}
?>

Now the code displays NOTHING if there is nothing to display, and mopics if it finds them.

spottedhaggis
04-24-2006, 05:21 PM
Thats cool, but you still end up with the "No other images currently available" which is the part I want rid off.

michael_s
04-24-2006, 09:16 PM
C'mon, use your noggin! met00 provided such a neat solution. All you need to do is look at the code, the answer is right there ...

Remove this:


' . TEXT_
NO_MOPICS . '

Or just edit the value for the contstant TEXT_NO_MOPICS to be blank in /includes/languages/english/product_info.php. There is always more than one way to get the job done.

clauska
08-04-2006, 12:35 AM
Um, don't delete the lines, move them to the mopics file where they belong. Then when product_info.tpl.php runs it will go to mopics, and if there is no mopics to display it won't put up anything, but if there are mopics it will put up the box.

Bad coding, goes against style (osc style guide is to display if there is something to display, and do not display if there is nothing to display, unlike IBM's styleguide of "this page intentionally left blank.").

product_info.tpl.php


//// BEGIN: Added for Dynamic MoPics v3.000
?>
<!-- <tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText"><?php
echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
</div>
<div class="screenshotsBlock"> -->
<?php include(DIR_WS_MODULES . 'dynamic_
mopics.php'); ?>
<!-- </div>
</td>
</tr> -->
<?php
//// END: Added for Dynamic MoPics v3.000
?>

modules/dynamic_mopics.php


if (mopics_file_exists(DIR_FS_CATALOG . str_replace($search, $replace, D
YNAMIC_MOPICS_PATTERN))) {
//
// moved the mopics box to here from the products info template
//
?> <tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText"><?php
echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
</div>
<div class="screenshotsBlock">
<?


and


// All thumbnails have been found and displayed; clear all of th
e CSS floats
echo '<div class="clearScreenshots"><hr /></div>';
//
// moved the mopics box from the products template to here
//
?> </div>
</td>
</tr>
<?
} else {
// No extra images found for this product
// echo '<p class="noScreenshots"><span class="smallText">' . TEXT_
NO_MOPICS . '</span></p>';
}
?>

Now the code displays NOTHING if there is nothing to display, and mopics if it finds them.


Just to be clear you make a comment out in product_info.tpl.php.

And you make a file named dynamic_mopics.php that contains the following code:


if (mopics_file_exists(DIR_FS_CATALOG . str_replace($search, $replace, D
YNAMIC_MOPICS_PATTERN))) {
//
// moved the mopics box to here from the products info template
//
?> <tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText"><?php
echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
</div>
<div class="screenshotsBlock">
<?

// All thumbnails have been found and displayed; clear all of th
e CSS floats
echo '<div class="clearScreenshots"><hr /></div>';
//
// moved the mopics box from the products template to here
//
?> </div>
</td>
</tr>
<?
} else {
// No extra images found for this product
// echo '<p class="noScreenshots"><span class="smallText">' . TEXT_
NO_MOPICS . '</span></p>';
}
?>

Is this correct?

FlipC
09-27-2006, 10:25 AM
Answer to last questions is NO.
Unfortuantely some can code but cant write isntructions. So here you go.

Open file- tempaltes/your-tempalte/content/product_info.tpl.php

Remove the following code: (lines 124-137 for me)



//// BEGIN: Added for Dynamic MoPics v3.000
?>
<!-- <tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText"><?php
echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
</div>
<div class="screenshotsBlock"> -->
<?php include(DIR_WS_MODULES . 'dynamic_
mopics.php'); ?>
<!-- </div>
</td>
</tr> -->
<?php
//// END: Added for Dynamic MoPics v3.000
?>


Save and upload.


Open file- includes/modules/dynamic_mopics.php
Find the following code: (line 42 for me)



if (mopics_file_exists(DIR_FS_CATALOG . str_replace($search, $replace, DYNAMIC_MOPICS_PATTERN))) {

Insert the following code below that:


//// moved the mopics box to here from the products info template
//
?>
<tr>
<td>
<div class="screenshotsHeader">
<div class="screenshotsHeaderText">
<?php
echo TEXT_OTHER_PRODUCT_IMAGES;
?>
</div>
</div>
<div class="screenshotsBlock">


NEXT search for (in same file)

TEXT_NO_MOPICS (line 112 at bottom for me)
Just delete it.

Save and upload.

learoypc
10-09-2006, 06:29 PM
If your not going to ever use it, I'm with spottedhaggis.

Fast fix and easy to do.