Post by sash_007 » Sat Oct 09, 2010 8:28 pm

Hello friends,

As i was having some issues regarding limiting the number of products viewed in the category page i decided to upgrade to 1.4.9 from 1.4.7 but now i see errors like these

webdesi1/public_html/store/catalog/view/theme/mytheme3/template/common/header.tpl on line 67Warning: Invalid argument supplied for foreach() in /home/webdesi1/public_html/store/catalog/view/theme/mytheme3/template/common/header.tpl on line 67 //headermenu module//

showing on my home page and i cant see any products though they are still there on the categories page

link to my store
http://www.webdesigncut.com/store/index ... ry&path=41

New member

Posts

Joined
Wed Apr 28, 2010 10:33 am

Post by sash_007 » Sun Oct 10, 2010 7:09 am

ok now i see this error on my index page and latest products is not showing

Notice: Undefined variable: text_latest in /home/webdesi1/public_html/store/catalog/view/theme/mytheme3/template/common/home.tpl on line 12
Notice: Undefined variable: products in /home/webdesi1/public_html/store/catalog/view/theme/mytheme3/template/common/home.tpl on line 14


home.tpl

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">
    <div><?php echo $welcome; ?></div>
    <div class="heading"><?php echo $text_latest; ?></div>
    <table class="list">
      <?php for ($i = 0; $i < sizeof($products); $i = $i + 3) { ?>
      <tr>
        <?php for ($j = $i; $j < ($i + 3); $j++) { ?>
        <td style="width: 25%;"><?php if (isset($products[$j])) { ?>
          <a href="<?php echo str_replace('&', '&', $products[$j]['href']); ?>"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a><br />
          <a href="<?php echo str_replace('&', '&', $products[$j]['href']); ?>"><?php echo $products[$j]['name']; ?></a><br />
          <span style="color: #999; font-size: 11px;"><?php echo $products[$j]['model']; ?></span><br />
          <?php if ($display_price) { ?>
          <?php if (!$products[$j]['special']) { ?>
          <span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />
          <?php } else { ?>
          <span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $products[$j]['price']; ?></span> <span style="color: #F00;"><?php echo $products[$j]['special']; ?></span>
          <?php } ?>
          <?php } ?>
          <?php if ($products[$j]['rating']) { ?>
          <img src="catalog/view/theme/default/image/stars_<?php echo $products[$j]['rating'] . '.png'; ?>" alt="<?php echo $products[$j]['stars']; ?>" />
          <?php } ?>
          <?php } ?></td>
        <?php } ?>
      </tr>
      <?php } ?>
    </table>
  </div>
  <div class="bottom">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center"></div>
  </div>
</div>
<?php echo $footer; ?> 

New member

Posts

Joined
Wed Apr 28, 2010 10:33 am

Post by jty » Sun Oct 10, 2010 12:30 pm

Change your template back to the default Open Cart template and see if that template works
If the default template works, then you need to upgrade your template to match 1.4.9
The errors are saying that you are asking for things in your .tpl that have not been defined in the corresponding controller file.
All mods need to be upgraded with every upgrade. Template changes are considered to be mods in this context.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by sash_007 » Sun Oct 10, 2010 2:44 pm

ok i got it fixed now but can u tell me how i reduce the number of columns to 3 instead of 4 for latest products i changed it to 3 in ver 1.4.7 but this ver has different coding cant find where to change?

New member

Posts

Joined
Wed Apr 28, 2010 10:33 am

Post by jty » Sun Oct 10, 2010 3:36 pm

change i + 4 to i + 3
I think it occurs twice
Also change width="24%" to width = "33%"
I think it's in template/module/latest_home.tpl
Also, have a look at the main site > documentation > development (I think) > themes
that contains info on how to properly do templates
If you follow Qphoria's instructions, you will reduce the likelihood of making more changes than necessary in an upgrade
Always listen to Q. He is worth listening to. LOL.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by sash_007 » Sun Oct 10, 2010 7:51 pm

hello mate yes you are right it was there in ver 1.4.7 but in 1.4.9 the code is totrally changed and i cant find those variables

have a loot at the latest.tpl
store/catalog/view/theme/mytheme3/template/module/latest.tpl

Code: Select all

<div class="box">
  <div class="top"><img src="catalog/view/theme/default/image/latest.png" alt="" /><?php echo $heading_title; ?></div>
  <div class="middle">
    <?php if ($products) { ?>
    <table cellpadding="2" cellspacing="0" style="width: 100%;">
      <?php foreach ($products as $product) { ?>
      <tr>
        <td valign="top" width="1"><a href="<?php echo str_replace('&', '&', $product['href']); ?>"><img src="<?php echo $product['image']; ?>" alt="<?php echo $product['name']; ?>" /></a></td>
        <td valign="top"><a href="<?php echo str_replace('&', '&', $product['href']); ?>"><?php echo $product['name']; ?></a>
          <?php if ($display_price) { ?>
          <br />
          <?php if (!$product['special']) { ?>
          <span style="font-size: 11px; color: #900;"><?php echo $product['price']; ?></span>
          <?php } else { ?>
          <span style="font-size: 11px; color: #900; text-decoration: line-through;"><?php echo $product['price']; ?></span> <span style="font-size: 11px; color: #F00;"><?php echo $product['special']; ?></span>
          <?php } ?>
          <?php } ?></td>
      </tr>
      <?php } ?>
    </table>
    <?php } ?>
  </div>
  <div class="bottom">&nbsp;</div>
</div>

New member

Posts

Joined
Wed Apr 28, 2010 10:33 am

Post by jcsmithy » Mon Oct 11, 2010 11:19 pm

Your looking in the wrong file, the one you mentioned is for the mini module that sits either left or right, the main one in the center is
store/catalog/view/theme/mytheme3/template/module/latest_home.tpl

Active Member

Posts

Joined
Fri Oct 01, 2010 9:54 pm
Who is online

Users browsing this forum: No registered users and 75 guests