hi again
I'd like to use this mod on a store which uses a custom theme. What ever I try to do, I cannot get it working. The cart.tpl is modified in this theme, and even if I make the adjustments to the file path in the vqmod file, or if I try to manually insert this mod, it is just not working :/
Would anyone be so kind to look at the cart.tpl code and see what might be throwing it off?
Code: Select all
<?php ob_start(); ?>
<div id="module_cart">
<div class="az_cart">
<a href="<?php echo $view?>"><img src="<?php echo TMPL_IMAGES ?>/az_cart_icon.png" alt="cart_icon"/></a>
<span>
<span class="_title"><?php echo $heading_title ?></span>
<br />
<span class="_items">
<?php
if ($products) {
$prod_quantity = 0;
foreach($products as $prod){
$prod_quantity += (int)$prod['quantity'];
}
echo sprintf(AZ_HEADER_NOW_IN_CART, $prod_quantity);
echo " - ";
echo $totals[sizeof($totals)-1]['text'];
}else{
echo $text_empty;
}
?>
</span>
</span>
</div>
<div class="middle">
<?php if ($products) { ?>
<table cellpadding="2" cellspacing="0" style="width: 100%;">
<?php foreach ($products as $product) { ?>
<tr>
<td align="left" valign="top" style="width:1px"><span class="cart_remove" id="remove_<?php echo $product['key']; ?>"> </span></td><td valign="top" align="right" style="width:1px"><?php echo $product['quantity']; ?> x </td>
<td align="left" valign="top"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
<div>
<?php foreach ($product['option'] as $option) { ?>
- <small style="color: #999;"><?php echo $option['name']; ?> <?php echo $option['value']; ?></small><br />
<?php } ?>
</div></td>
</tr>
<?php } ?>
</table>
<br />
<?php if ($display_price) { ?>
<table cellpadding="0" cellspacing="0" align="right" style="display:inline-block;">
<?php foreach ($totals as $total) { ?>
<tr>
<td align="right"><span class="cart_module_total"><b><?php echo $total['title']; ?></b></span></td>
<td align="right"><span class="cart_module_total"><?php echo $total['text']; ?></span></td>
</tr>
<?php } ?>
</table>
<?php } ?>
<div style="padding-top:5px;text-align:center;clear:both;"><a href="<?php echo $view; ?>"><?php echo $text_view; ?></a> | <a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
<?php } else { ?>
<!--<div style="text-align: center;"><?php echo $text_empty; ?></div>-->
<?php } ?>
</div>
</div>
<?php
$cart_string = ob_get_contents();
ob_end_clean();
$infobox = new azInfoBox();
//$infobox->azSetBoxHeading($heading_title);
$infobox->azSetBoxHeading();
$infobox->azSetBoxContent($cart_string);
$infobox->azSetBoxFooter();
$infobox->azCreateBox('box2');
?>
<?php if ($ajax) { ?>
<script type="text/javascript">
$(document).ready(function () {
$('#add_to_cart').removeAttr('onclick');
$('#add_to_cart').click(function () {
$.ajax({
type: 'post',
url: 'index.php?route=module/cart/callback',
dataType: 'html',
data: $('#product :input'),
success: function (html) {
$('#module_cart .middle').html(html);
},
complete: function () {
var image = $('#image').offset();
var cart = $('#module_cart').offset();
$('#image').before('<img src="' + $('#image').attr('src') + '" id="temp" style="position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />');
params = {
top : cart.top + 'px',
left : cart.left + 'px',
opacity : 0.0,
width : $('#module_cart').width(),
height : $('#module_cart').height()
};
$('#temp').animate(params, 'slow', false, function () {
$('#temp').remove();
});
}
});
});
$('#add_to_cart').click(function () {
$.ajaxq("add_queue",{
type: 'post',
url: 'index.php?route=module/az_cart/callback',
dataType: 'html',
data: $('#product :input'),
success: function (html) {
$('.az_cart ._items').html(html);
},
complete: function () {}
});
});
$('.az_add').each(function(){
$(this).removeAttr('href');
$(this).click(function(){
var img = $('.image IMG', $(this).parents('.az_pbox_new')[0])[0];
var holder = $('.image', $(this).parents('.az_pbox_new')[0])[0];
$.ajaxq("add_queue",{
type: 'post',
url: 'index.php?route=module/cart/callback',
dataType: 'html',
data: '&product_id=' + this.name + '&quantity=1',
success: function (html) {
$('#module_cart .middle').html(html);
$.ajaxq("add_queue",{
type: 'post',
url: 'index.php?route=module/az_cart/callback',
dataType: 'html',
data: '&product_id=' + this.name + '&quantity=1',
success: function (html) {
$('.az_cart ._items').html(html);
},
complete: function () {}
});
},
complete: function () {
var image = $(img).position();
var cart = $('#module_cart .az_cart').offset();
$(holder).after('<img src="' + img.src + '" id="temp" style="z-index: 999; position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />');
params = {
opacity : 0.0,
width : $(img).width()*1.25,
heigth : $(img).height()*1.25
};
$('#temp').animate(params, 'slow', false, function () {
$('#temp').remove();
});
}
});
});
});
});
</script>
<?php } ?>
<script type="text/javascript"><!--
function getUrlParam(name) {
var name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null)
return "";
else
return results[1];
}
$(document).ready(function () {
$('.cart_remove').live('click', function () {
if (!confirm('<?php echo $text_confirm; ?>')) {
return false;
}
$(this).removeClass('cart_remove').addClass('cart_remove_loading');
$.ajax({
type: 'post',
url: 'index.php?route=module/cart/callback',
dataType: 'html',
data: 'remove=' + this.id,
success: function (html) {
$('#module_cart .middle').html(html);
if (getUrlParam('route').indexOf('checkout') != -1) {
window.location.reload();
}
},
complete: function(){
$.ajaxq("add_queue",{
type: 'post',
url: 'index.php?route=module/az_cart/callback',
dataType: 'html',
data: $('#product :input'),
success: function (html) {
$('.az_cart ._items').html(html);
},
complete: function () {}
});
}
});
});
});
//--></script>
Thanks in advance
tom