View Single Post
  #10  
Old 05-31-2010, 12:28 PM
 
zenpig zenpig is offline
 

Member
  
Join Date: Nov 2004
Posts: 19
 

Default Re: Quick and dirty method to put another ajax-minicart in the header of each page

Quote:
Originally Posted by ynotcreative
Similar, but in the top right, so I think the answer would be yes. Was it difficult?

Sorry for the delay....in the end I guess it wasn't too difficult but man the css is crazy took a bit to figure out and still not sure if it was the best way to do it but works....except in IE there is an issue where the text for the breadcrumbs show within the minicart. I see another here has the same issue, http://forum.x-cart.com/showthread.php?t=53669 but where I have mine placed isn't really too big a deal because the breadcrumb text doesn't interfere.

Since I have my "extra" minicart located in the auth div I pretty much just copied the existing attributes for the minicart and put them at the bottom of main.css like where I could individually tweak them without effecting the main minicart.

.auth .minicart-block {
height: 25px;
background: #a3cbf9;
position: relative;
}

.auth .minicart {
padding-left: 30px;
line-height: 25px;
vertical-align: middle;
white-space: nowrap;
}

.auth .minicart a {
float: none;
}

.auth img.full {
margin: 10px 4px auto auto;
width: 23px;
height: 12px;
background: transparent url(images/fashion_mosaic/cart.gif) no-repeat left top;
}
.auth img.ajax-minicart-icon {
position: relative;
left: 0px;
top: 0px;
}
.auth img.empty {
margin: 5px 4px auto auto;
width: 23px;
height: 12px;
background: transparent url(images/fashion_mosaic/cart.gif) no-repeat left top;
}

.auth .ajax-minicart img.minicart-button {
background-image: url(images/fashion_mosaic/cart_button.gif);
width: 38px;
height: 21px;
cursor: pointer;
overflow: hidden;
margin-top: 3px;
margin-bottom: 2px;
position: absolute;
}

.auth .ajax-minicart img.minicart-button-show {
background-position: left -21px;
}

For the actual "link" to the minicart I created a custom menucart.tpl file(do something like menucart_custom.tpl or however you like your directory or naming scheme) and link to it from within the header where you want it. Mine probably won't help except for an idea but it is..and it's xcart v4.3.2

{*
$Id: menu_cart.tpl,v 1.51 2009/06/24 07:45:22 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
<script type="text/javascript">
<!--
var lbl_error = '{$lng.lbl_error|wm_remove|escape:javascript}';
var txt_minicart_total_note = '{$lng.txt_minicart_total_note|wm_remove|escape:ja vascript}';
--></script>
{if $config.General.ajax_add2cart eq 'Y' && $config.General.redirect_to_cart ne 'Y' && $main ne 'cart' && $main ne 'anonymous_checkout' && $main ne 'checkout'}
{include file="customer/ajax.minicart.tpl" _include_once=1}
{/if}
<script type="text/javascript" src="{$SkinDir}/jquery.tooltip.min.js"></script>

{capture name=menu}

<div class="minicart-block">

<img src="{$ImagesDir}/spacer.gif" class="ajax-minicart-icon {if $minicart_total_items gt 0}full{else}empty{/if}" alt="" />

{include file="customer/minicart_total.tpl"}

</div>
{/capture}
{if $config.General.ajax_add2cart eq 'Y' && $config.General.redirect_to_cart ne 'Y' && $main ne 'cart' && $main ne 'anonymous_checkout' && $main ne 'checkout' && $minicart_total_items gt 0}
{assign var=additional_class value="menu-minicart ajax-minicart"}
{else}
{assign var=additional_class value="menu-minicart"}
{/if}
{if $minicart_total_items gt 0}
{assign var=additional_class value="`$additional_class` full-mini-cart"}
{/if}
{include file="customer/custom/menu_dialog.tpl" title=$lng.lbl_your_cart content=$smarty.capture.menu}

you'll see that towards the end I had a link to a custom menu_dialog.tpl file which had a bunch of the extra stuff in that file I did not want displayed in the minicart in the auth div but wanted the main file left alone for it's full display in it's default xcart location.

Hopefully this helps
__________________
Xcart 4.6.5 gold
Apache 2.2.29
PHP 5.4.34
MySQL 5.6.17
Reply With Quote