Posted by bumathan on April 5, 2011 at 8:48pm
3 followers
Jump to:
| Project: | Ubercart AJAX Cart |
| Version: | 6.x-2.0-beta5 |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | postponed |
Issue Summary
Hello,
I wanted to replace the table with full CSS div in the block template (uc_ajax_cart_block_content.tpl.php). I did it, it works fine.
Just wanted to share it with the other users of this module.
Here's the code (CSS is hardcoded, but you can easily remove it from the html and pu it in a separate file):
<div id="table-items">
<?php foreach ( $items as $item ):?>
<div id="remove-link" style="text-align: right; padding-bottom: 7px;"><?php print $item['remove_link'] ?></div>
<div class="item-wrapper" style="min-height: 40px; border-bottom: 1px dashed #CCC; margin-bottom: 4px;">
<div class="item-qty" style="float:left; width: 30px;">
<?php print $item['qty'] ?>
</div>
<div class="item-title" style="float:left;">
<a title="<?php print check_plain($item['descr']); ?>" href="<?php print $item['link'] ?>"><?php print $item['title'] ?><?php print $item['descr'] ?></a>
</div>
<div class="price" style="float:right;>
<?php print $item['total'] ?>
</div>
</div>
<?php endforeach; ?>
<div id="total" style=" border-top: 1px solid #CCC; padding-top: 8px; height: 25px; margin-top: -5px">
<div class="print-text" style="float: left;"><?php print $items_text; ?></div>
<div class="print-total" style="float: right;"><label><?php print t('Total'); ?>: </label><?php print $total ;?></div>
</div>
<div class="cart-links" style="float:right; padding:0; margin: 5px 0 0 0; height: 25px;"><?php print $cart_links; ?></div>
</div>You can easily replace the "remove product" text with a "x" or even an image I think, if you go in uc_ajax_cart.theme.inc.
Bye !
Comments
#1
First I want to thank you for sharing your code.
At this moment this module needs some care in other areas, so I'm postponing this feature request. It seems to me that the table is a good choice because the cart info is table data. I mean it is data that fits pefectly in a table. Table is not used for layput purposes.
What is more, there are a lot of sites with the actual table cart and changing HTML markup could broke their themes.
However if more people are interested in use markup without tables we can discuss the pros and conts in this issue.
#2
You're right Tunic. Indeed, if others want to use it, they will find it here :-)
#3
Thank you very much!
#4
Hello again! It's important to wrap the above code inside
<div id="ajaxCartUpdate">
<div id="cart-block-contents-ajax">
Code here...
</div>
</div>
otherwise the collapsible option wont work.