Post by sabine1 » Sat Feb 12, 2011 5:05 am

I've seen many questions regarding this, and many offered solutions, but not one that helps solve my specific question.

Running OpenCart 1.4.9.3. I have uploaded a category image that pops up in the products page. I'd like to delete the category image, but can't find the proper solution. Other posts have been close, but no cigar.

Here's a link that's illustrative:

http://lindalannon.com/store/index.php? ... ry&path=35

Most posts with suggested fixes lead me to: catalog\view\theme\default\template\product\category.tpl and suggest changes to source code. However, I have not found any suggested code resembling mine.

Any help is very much appreciated.

Mark

New member

Posts

Joined
Thu Feb 10, 2011 3:19 am

Post by SXGuy » Sat Feb 12, 2011 6:31 am

catalog/view/theme/YOURTHEME/template/product/category.tpl

Around line 14 find:

Code: Select all

<td><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></td>
Remove line, save and reload page.

If your category file looks different, could be wise to paste all the code here so we can see.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by sabine1 » Tue Feb 15, 2011 2:29 am

Thanks SXGuy!

That did the trick! Taking your suggestion, here is the first 25 lines or so of code. The code you had me delete was exactly where you said it would be. If there is a need, I can post the entire code for "Catagory".

Once again, thats for the help!

Amended code:

Code: Select all

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
  <div class="top">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center">
      <h1><?php echo $heading_title; ?></h1>
    </div>
  </div>
  <div class="middle">
    <table style="padding-bottom:10px;">
	  <tr>
	    <?php if ($thumb) { ?>
          <?php } ?>
        <?php if ($description) { ?>
	    <td><?php echo $description; ?></td>
	    <?php } ?>
	  </tr>
	</table>
	<?php if (!$categories && !$products) { ?>
    <div class="content"><?php echo $text_error; ?></div>
    <?php } ?>
    <?php if ($categories) { ?>
    <table class="list">
      <?php for ($i = 0; $i < sizeof($categories); $i = $i + 4) { ?>
      <tr>
        <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
Last edited by sabine1 on Tue Feb 15, 2011 2:32 am, edited 1 time in total.

New member

Posts

Joined
Thu Feb 10, 2011 3:19 am

Post by SXGuy » Tue Feb 15, 2011 2:32 am

you can go ahead and also remove these lines as they are no longer needed

Code: Select all

<?php if ($thumb) { ?>
<?php } ?>

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by sabine1 » Tue Feb 15, 2011 2:33 am

Done & thanks very much.

New member

Posts

Joined
Thu Feb 10, 2011 3:19 am

Post by visnetmedia » Fri May 06, 2011 2:34 pm

Hi sorry to ask so late - I am wanting to know how to have no image show if not uploaded instead of the no_image.jpg - would prefer to have text saying no image available but if you do an image with text in the product page where there are no images it looks distorted.

Thanks a bundle.

Active Member

Posts

Joined
Fri Feb 12, 2010 7:17 am

Post by SXGuy » Fri May 06, 2011 2:58 pm

it only looks distorted because your text image isnt the correct width and height.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by Sidecutter » Mon May 09, 2011 7:03 am

For anyone else who is trying to do this and can't find the right code, here's another piece you may need to look for in catalog/view/theme/template/YOUR TEMPLATE/product/category.tpl to accomplish this change. The code above, like the OP's issue, was not the code in my file.

If your file has the code below:

Code: Select all

      <tr>
        <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
        <td width="25%"><?php if (isset($categories[$j])) { ?>
          <a href="<?php echo $categories[$j]['href']; ?>"><img src="<?php echo $categories[$j]['thumb']; ?>" title="<?php echo $categories[$j]['name']; ?>" alt="<?php echo $categories[$j]['name']; ?>" style="margin-bottom: 3px;" /></a><br />
          <a href="<?php echo $categories[$j]['href']; ?>"><?php echo $categories[$j]['name']; ?></a>
          <?php } ?></td>
        <?php } ?>
      </tr>
Replace it with this to comment it out:

Code: Select all

      <!--<tr>
        <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
        <td width="25%"><?php if (isset($categories[$j])) { ?>
          <a href="<?php echo $categories[$j]['href']; ?>"><img src="<?php echo $categories[$j]['thumb']; ?>" title="<?php echo $categories[$j]['name']; ?>" alt="<?php echo $categories[$j]['name']; ?>" style="margin-bottom: 3px;" /></a><br />
          <a href="<?php echo $categories[$j]['href']; ?>"><?php echo $categories[$j]['name']; ?></a>
          <?php } ?></td>
        <?php } ?>
      </tr>-->

Active Member

Posts

Joined
Tue Jan 18, 2011 6:58 am

Post by dragon17 » Tue Aug 16, 2011 4:54 pm

I also need to remove categories image, but sorry why so complicate procedure to just remove an image?!? Is it not possible to make it easier just adding a "Remove Image" button close the image field?

My website runs on OC 1.5.1, is it possible remove category images easier than work with code?

Thanks for helping, best.

New member

Posts

Joined
Thu Mar 25, 2010 7:15 pm

Post by SXGuy » Tue Aug 16, 2011 8:41 pm

dragon17 wrote:I also need to remove categories image, but sorry why so complicate procedure to just remove an image?!? Is it not possible to make it easier just adding a "Remove Image" button close the image field?

My website runs on OC 1.5.1, is it possible remove category images easier than work with code?

Thanks for helping, best.
its hardly a major code change its simply enclosing the code with a comment out bracket.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by vkaltchev » Thu Aug 18, 2011 7:55 am

I use 1.4.9. OC and uploaded a category pic for a category for which I don't need a pic. What's the way to remove it? I'm paranoid with touching my coding as it's a running store but if somebody provides a step by step advice I'll follow!

Thank you!

New member

Posts

Joined
Fri Apr 16, 2010 11:02 am
Who is online

Users browsing this forum: No registered users and 7 guests