Post by TheBedderPlace » Mon Dec 15, 2014 8:23 pm

Image

Not sure when this started but when the shopping cart is previewed '*');" />' shows after the remove 'X'

The 'X' remove button also does not remove any product when clicked.

Everything works fine in the shopping cart page itself.

http://www.thebedderplace.co.uk


The cart.tpl file is the following
<div id="cart">
<div class="heading">
<h4><?php echo $heading_title; ?></h4>
<a><span id="cart-total"><?php echo $text_items; ?></span></a></div>
<div class="content">
<?php if ($products || $vouchers) { ?>
<div class="mini-cart-info">
<table>
<?php foreach ($products as $product) { ?>
<tr>
<td class="image"><?php if ($product['thumb']) { ?>
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" /></a>
<?php } ?></td>
<td class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
<div>
<?php foreach ($product['option'] as $option) { ?>
- <small><?php echo $option['name']; ?> <?php echo $option['value']; ?></small><br />
<?php } ?>
<?php if ($product['recurring']): ?>
- <small><?php echo $text_payment_profile ?> <?php echo $product['profile']; ?></small><br />
<?php endif; ?>
</div></td>
<td class="quantity">x&nbsp;<?php echo $product['quantity']; ?></td>
<td class="total"><?php echo $product['total']; ?></td>
<td class="remove"><img src="catalog/view/theme/default/image/remove-small.png" alt="<?php echo $button_remove; ?>" title="<?php echo $button_remove; ?>" onclick="(getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') ? location = 'index.php?route=checkout/cart&remove=<?php echo $product['key']; ?>' : $('#cart').load('index.php?route=module/cart&remove=<?php echo $product['key']; ?>' + ' #cart > *');" /></td>
</tr>
<?php } ?>
<?php foreach ($vouchers as $voucher) { ?>
<tr>
<td class="image"></td>
<td class="name"><?php echo $voucher['description']; ?></td>
<td class="quantity">x&nbsp;1</td>
<td class="total"><?php echo $voucher['amount']; ?></td>
<td class="remove"><img src="catalog/view/theme/default/image/remove-small.png" alt="<?php echo $button_remove; ?>" title="<?php echo $button_remove; ?>" onclick="(getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') ? location = 'index.php?route=checkout/cart&remove=<?php echo $voucher['key']; ?>' : $('#cart').load('index.php?route=module/cart&remove=<?php echo $voucher['key']; ?>' + ' #cart > *');" /></td>
</tr>
<?php } ?>
</table>
</div>
<div class="mini-cart-total">
<table>
<?php foreach ($totals as $total) { ?>
<tr>
<td class="right"><b><?php echo $total['title']; ?>:</b></td>
<td class="right"><?php echo $total['text']; ?></td>
</tr>
<?php } ?>
</table>
</div>
<div class="checkout"><a href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a> | <a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
<?php } else { ?>
<div class="empty"><?php echo $text_empty; ?></div>
<?php } ?>
</div>
</div>
Has anyone any ideas what could be causing this?

Many Thanks,
Stefan
Last edited by TheBedderPlace on Mon Dec 15, 2014 11:23 pm, edited 1 time in total.


Posts

Joined
Wed Aug 20, 2014 7:15 pm

Post by pprmkr » Mon Dec 15, 2014 10:05 pm

Yes, you have an extensions installed wich adds image width and height to all images.

Last part of onclick event:

Code: Select all

#cart  width="7" height="7"> *');"
It breaks the code.

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by TheBedderPlace » Mon Dec 15, 2014 11:23 pm

Thanks, It was the [MOD] Auto-Include width/height tags for images

For anyone with a similar issue my fix was;
in system/library/response.php

CHANGE
foreach($result[0] as $img_tag) {

preg_match_all('/(width|height|src)=("[^"]*")/i',$img_tag, $img[$img_tag]);
}
TO
foreach($result[0] as $img_tag) {
if (!strpos($img_tag,'remove-small.png'))
preg_match_all('/(width|height|src)=("[^"]*")/i',$img_tag, $img[$img_tag]);
}
:good:


Posts

Joined
Wed Aug 20, 2014 7:15 pm
Who is online

Users browsing this forum: No registered users and 146 guests