X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Quick and dirty method to put another ajax-minicart in the header of each page (https://forum.x-cart.com/showthread.php?t=53777)

ynotcreative 05-17-2010 06:20 AM

Quick and dirty method to put another ajax-minicart in the header of each page
 
I need to quickly put another cart status on the top of every page. I found a way to do it, but it has unintended consequences. Has anyone successfully done this?

If I cannot get the full ajax minicart, I at least need the basics.

Cart items, cart dollar total

I assume these are session variables, but am not quite sure how to best pull them.

balinor 05-17-2010 09:05 AM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
There is no ajax in 4.1.10 - is this an add-on or are you using a version different than the one in your signature?

ynotcreative 05-17-2010 09:09 AM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
I have many installations of x-cart for various clientele. This case is for 4.3.1.

balinor 05-17-2010 09:11 AM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
Ah, kind of need to know that info when posting :) Have you simply tried moving the existing mini-cart to the header?

ynotcreative 05-17-2010 09:17 AM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
Yes, but the way it is working is rather conditional. I need it to show up in the header always, but on the left bar on product catalog pages, front page, etc.

See the following:

http://www2.devita.net/store/

Note the navbar is not working properly, so just use either categories or bestsellers list to navigate.

Many thanks for the help!
-jason

hoosierglass 05-17-2010 09:23 AM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
In Jason's defense he did post under 4.2 / 4.3 template editing.

zenpig 05-18-2010 06:46 PM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
Is something like at http://www.mommysown.com like what you are looking for?

ynotcreative 05-19-2010 03:19 PM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
Similar, but in the top right, so I think the answer would be yes. Was it difficult?

ynotcreative 05-24-2010 08:27 PM

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

Originally Posted by balinor
There is no ajax in 4.1.10 - is this an add-on or are you using a version different than the one in your signature?


So, where's your server config in your signature?

zenpig 05-31-2010 12:28 PM

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

ARW VISIONS 05-31-2010 12:39 PM

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

Originally Posted by ynotcreative
So, where's your server config in your signature?

When you get to 27,000 posts you don't need it either. :roll:

hoosierglass 05-31-2010 01:19 PM

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

Originally Posted by ynotcreative
So, where's your server config in your signature?


Besides he did not say server, he was talking about x-cart version.

Huge difference!

Nadeem 09-30-2010 05:32 AM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
any one know a "how-to" for adding ajax-minicart in a specific location in the page ?

earlgreg 11-20-2010 08:59 PM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
zenpig: I am going out of my mind trying to create the sort of ajax minicart implementation you referenced at http://www.mommysown.com. I want to do exactly the same thing except I want to place it on the right rather than the left. I have adapted your CSS and custom menucart tpl but have not succeeded in making it work like the site your pointed to. Can you offer any more details on how you did this? Specifically, a) how to position the minicart, and b) how to hide the menu box below the items/subtotal summary. Any advice would be greatly appreciated.

BTW, our 4.4.1 site is under development but can currently be viewed at http://www.teawithgrace.com/441test/home.php?shopkey=tea. (Our live store uses 4.1.12.)

isaels@i-artsupplies.co.u 12-08-2010 07:47 AM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
Im trying to do exactly the same as well, but only have a limited knowledge. I have found the cart container box, and the files it calls.

Any ideas on where to start?

Im not sure about what the minicart is?

Fascinations 12-15-2010 01:54 PM

Re: Quick and dirty method to put another ajax-minicart in the header of each page
 
Does anyone Have a clear description on how to do this? I am trying to do the exact same thing. I am new to x-cart and have limited knowledge of the methodology used thus far. Any pointers would be greatly appreciated! :mrgreen:

Also, is it possible to include the ajax mini cart on another page that I am using as an include on the same server in a different part of the website?


All times are GMT -8. The time now is 05:10 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.