Post by psutinrerk » Sat Feb 04, 2012 1:15 pm

Hello, I tried to edit the
catalog\view\theme\default\template\product\category.tpl

after edit, the javascript function display(view) that switch between the grid view and list view stop working

not sure what I did wrong, the following is what I did

Replace
<div class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<br />
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
<?php } ?>
</div>

with

<div class="price">
<table class="price-table">
<tr>
<td class="priceBlockLabel"><?php echo $text_msrp; ?></td>
<td><span class="price-msrp"><?php echo $product['msrp']; ?></span></td>
</tr>
<tr>
<td class="priceBlockLabel"><?php echo $text_price; ?></td>
<td>
<?php if (!$product['special']) { ?>
<span class="price-new"><?php echo $product['price']; ?></span>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span>
<?php } ?>
</td>
</tr>
<?php if ($product['special']) { ?>
<tr>
<td class="priceBlockLabel"><?php echo $text_special_price; ?></td>
<td><span class="price-new"><?php echo $product['special']; ?></span></td>
</tr>
<?php } ?>
<?php if ($product['tax']) { ?>
<tr>
<td class="priceBlockLabel"><?php echo $text_tax; ?></td>
<td><span class="price-tax"><?php echo $product['tax']; ?></span></td>
</tr>
<?php } ?>
</table>
</div>

Newbie

Posts

Joined
Tue Sep 20, 2011 12:57 pm

Post by grgr » Sat Feb 04, 2012 4:44 pm

If you look at the bottom of the file you will find a load of ajax script which will no longer work because of the changes that you have made to the html above. To get it to work again you will need to reflect the changes you made in the html in the ajax script.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by psutinrerk » Mon Feb 06, 2012 1:37 pm

Thank you for your reply :)

I'm not very good at javascript could you please give me some advise of how to do that
may be point out some row that I should look into

Here are what I understand

from the Javascript Row 128

var price = $(element).find('.price').html();

This will retrieve the HTML code = XXX (for example) in the <div class="price">XXX</div>

then the following code will put the XXX to the new construct html

if (price != null) {
html += '<div class="price">' + price + '</div>';
}

Based on the Original code, the html that javascript retrieve from should be just the normal text price
EX
$price = "$250"


If I modified the way as I post on my first post, which replace the price with table

The html for $price should be the <table></table> for example
<table class="price-table">
<tr>
<td class="priceBlockLabel">Price:</td>
<td>
<span class="price-new">$250</span>
</td>
</tr>
</tbody>
</table>

Everything look ok but it not working as I suspect, could you please help

Thank you

Newbie

Posts

Joined
Tue Sep 20, 2011 12:57 pm

Post by psutinrerk » Mon Feb 06, 2012 2:14 pm

This is My website URL that has the problem

http://littlemonkeyshop.com/index.php?r ... path=59_73

the list view is render wrong and I can't click to switch between grid view and list view :(

Newbie

Posts

Joined
Tue Sep 20, 2011 12:57 pm

Post by psutinrerk » Tue Feb 07, 2012 1:51 pm

Found the problem it is my VQMod, fixed now :) thanks

Newbie

Posts

Joined
Tue Sep 20, 2011 12:57 pm
Who is online

Users browsing this forum: No registered users and 376 guests