After adding and removiming product I have this html:

<div style="display: block; overflow: hidden;">
  <!-- Order object present and cart is not empty. -->
  <div>
  <!-- Cart is empty or order object is null. -->
  <div id="cd-cart" class="ajax-shopping-cart-wrapper">
	<h2>Cart</h2>
    <div class="empty-shopping-cart">
      Shopping cart is empty    </div>
    <div class="ajax-shopping-cart-total"></div>
    <div class="ajax-shopping-cart-checkout"></div>
  </div>
</div>
</div>

First level div and second level div are new wrappers after ajax cart manipulations.

In template file I just changed:

<div id="cd-cart" class="ajax-shopping-cart-wrapper">

Comments

anikitin35’s picture

<div id="cd-cart" class="">
    
  <!-- Order object present and cart is not empty. -->
  <div>
  <!-- Cart is empty or order object is null. -->
  <div style="display: block; overflow: hidden;">
  <!-- Order object present and cart is not empty. -->
  <div>
  <!-- Order object present and cart is not empty. -->
  <div>
  <!-- Order object present and cart is not empty. -->
  <div>
  <!-- Order object present and cart is not empty. -->
  <div>
  <!-- Order object present and cart is not empty. -->
  <div class="ajax-shopping-cart-wrapper">
	<h2>Cart</h2>
    <table class="cd-cart-items ajax-shopping-cart-table">
<tbody>
 <tr class="odd"><td class="quantity"><form action="/system/ajax" method="post" id="dc-ajax-add-cart-update-quantity-27--5" accept-charset="UTF-8"><div><div class="form-item form-type-textfield form-item-quantity-27">
 <input type="text" id="edit-quantity-27--5" name="quantity_27" value="5" size="3" maxlength="3" class="form-text">
</div>
<input type="submit" id="edit-submit-27--5" name="op" value="Update" class="form-submit ajax-processed"><input type="hidden" name="form_build_id" value="form-88tafl6iwTsSpGPJ-UJOZjCK5tAHioGMMIYB8R4Lm9Q">
<input type="hidden" name="form_token" value="I4XH9YpgZP8xu84TQz5FPDMi7wDrVsW3R5WlLj8gBrE">
<input type="hidden" name="form_id" value="dc_ajax_add_cart_update_quantity_27">
</div></form></td><td class="name">Стопка серебряная</td><td class="price">3 000,00 руб.</td><td class="remove-from-cart"><a href="/remove-product/nojs/27" class="use-ajax ajax-processed"><img src="http://masterasevera.ru/sites/all/modules/dc_ajax_add_cart/images/remove-from-cart.png" alt="Remove from cart" title="Remove from cart"></a></td> </tr>
</tbody>
</table>

    <div class="ajax-shopping-cart-more-info clearfix">
      
      <div class="ajax-shopping-cart-total">
        Total: 15 000,00 руб.      </div>
      <div class="ajax-shopping-cart-checkout">
        <a href="/cart" class="dc-ajax-add-cart-checkout-link dc-ajax-add-cart-checkout-cart">Checkout</a>      </div>
    </div>
  </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
subhojit777’s picture

Yes I am aware of this issue. I am trying to find an alternate for ajax_command_replace().
Again, patches are welcome.

anikitin35’s picture

Sorry, yours code is very hard for understanding.

torgospizza’s picture

EDIT: Unrelated.

joelpittet’s picture

I was having a hard time checking if it was related based on the Issue Summary, but following to see what comes of this. @anikitin35 can you provide more details about the bug/incorrect markup?

anikitin35’s picture

For example:
we just added product to shopping cart and we have html:

<div id="cd-cart" class="">
    
  <!-- Order object present and cart is not empty. -->
  <div>
  <!-- Cart is empty or order object is null. -->
  <div style="display: block; overflow: hidden;">
  <!-- Order object present and cart is not empty. -->
  <div>

Old strings in the beginning...

joelpittet’s picture

Hmm it's hard to tell if the issues are the same still, though could you try the patch and see if it help?

joelpittet’s picture

Never mind they are unrelated.

torgospizza’s picture

Rats. Thanks for the confirmation, I'll update my comment.

subhojit777’s picture

Status: Active » Needs work
subhojit777’s picture

Assigned: anikitin35 » Unassigned
Status: Needs work » Closed (duplicate)

Closing this on behalf of #2318385: Extra div after ajax updates