debreli
OpenCart-TR
yeni ürünler bloğunu çift rekli yaptım.resimler üzerinde fare ile gezince hem renk değişiyor hemde alta bir blok varsa aşağı oynuyor.
aşağıdaki kodu tamanızın stylesheet dosyasının en altına kaydedin.
Kod:
.thumb {
text-align:center; vertical-align:top; border: 1px solid #e8e8e8;
background: #f5f9fc;
cursor: pointer;margin: 8;
padding: 8px;}
.thumb2 {
text-align:center; vertical-align:top; border: 1px solid #cde0f0;
background: #edf4fa;
cursor: pointer;margin: 10;
padding: 10px;}
latesthome.tpl dosyasını da aşağıdaki gibi değiştirin.
Kod:
<?php if ($products) { ?>
<div class="top">
<div class="left"></div>
<div class="right"></div>
<div class="center">
<div class="heading"><?php echo $heading_title; ?></div>
</div>
</div>
<div class="middle">
<table class="">
<?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?>
<tr>
<?php for ($j = $i; $j < ($i + 4); $j++) { ?>
<td style="width: 25%;"class="thumb" onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'"><?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>
<?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 } ?>
<a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a>
<?php } ?>
<br />
<?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>
<?php } ?>
orta blokta kullandığınız modulerde de kullanabilirsiniz.
ürün isimlerinide bloğun üstüne aldım.geliştirebilirsiniz acizane bukadar yapabildim.dğer ortabloktaki modüllerde de kullanabilirsiniz
lates_home.tpl dosyasını aşağıdaki ile değiştirin.
Kod:
<?php if ($products) { ?>
<div class="top">
<div class="left"></div>
<div class="right"></div>
<div class="center">
<div class="heading"><?php echo $heading_title; ?></div>
</div>
</div>
<div class="middle">
<table cellpadding="0" cellspacing="1" class="">
<?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?>
<tr>
<?php for ($j = $i; $j < ($i + 4); $j++) { ?>
<td style="width: 25%;" class="thumb" onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'"><?php if (isset($products[$j])) { ?><a href="<?php echo str_replace('&', '&', $products[$j]['href']); ?>"><?php echo $products[$j]['name']; ?></a><?php } ?>
</td>
<?php } ?>
</tr>
<?php } ?>
<?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?><tr> <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
<td style="width: 25%;"class="thumb" onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'"><?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 />
<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>
<?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 } ?>
<br />
<?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 } ?><br><a class="" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" ><image src="catalog/view/theme/default/image/satinal.png"></a>
<?php } ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>
</div>
<div class="bottom">
<div class="left"></div>
<div class="right"></div>
<div class="center"></div>
</div>
<?php } ?>
stylesheet css deki üste verdiğim kodları aşağıdakiyle değiştirin.
Kod:
.thumb {
text-align:center; font-weight: bold; vertical-align:top;
border: 1px solid #e8e8e8;
background: #f5f9fc;
cursor: pointer;margin:9;
padding: 9px;}
.thumb2 {
text-align:center; font-weight: bold; vertical-align:top;
border: 1px solid #cde0f0;
background: #edf4fa;
cursor: pointer;margin: 8;
padding: 8px;}