Jump to content
Sign in to follow this  
vivivor

Не обновляет количество товаров в корзине при удалении товара

Recommended Posts

Изменил корзину, все что смог сам настроил, но никак не получается сделать чтоб при удалении товара из выпадающей корзины, обновлялось количество оставшихся товаров.

Помогите решить проблему(скорее всего она кроется в этих строках $('.content').load('index.php?route=module/cart&remove=<?php echo $product['key']; ?>' + '#cart-total > *');" /></td>

Код из cart.tpl

<span id="cart-total"><?php echo $text_items; ?></span>
 <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 } ?>
		</div></td>
	  <td class="quantity">x <?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']; ?>' : $('.content').load('index.php?route=module/cart&remove=<?php echo $product['key']; ?>' + '#cart-total > *');" /></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 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']; ?>' : $('.content').load('index.php?route=module/cart&remove=<?php echo $voucher['key']; ?>' + '#cart-total > *');" /></td>
	</tr>
	<?php } ?>
  </table>

Код из header.tpl (в меню добавил к списку в конце еще один li )

<li class="cart-in-li"><a class="cart-href" href="checkout"></a><?php echo $cart; ?></li>

Код из common.js (хотя и без него работает)

$('.cart-in-li').live('hover', function() {
$('.content').load('index.php?route=module/cart .content '); });

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.