Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-17-2010, 06:20 AM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Exclamation 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.
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #2  
Old 05-17-2010, 09:05 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-17-2010, 09:09 AM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Default 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.
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #4  
Old 05-17-2010, 09:11 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 05-17-2010, 09:17 AM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Default 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
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #6  
Old 05-17-2010, 09:23 AM
  hoosierglass's Avatar 
hoosierglass hoosierglass is offline
 

X-Adept
  
Join Date: Aug 2006
Location: Zionsville, IN
Posts: 974
 

Default 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.
__________________
X-Cart Gold 4.7.7
Custom Work from www.luminointernet.com
www.indy-pen-dance.com
Reply With Quote
  #7  
Old 05-18-2010, 06:46 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

Is something like at http://www.mommysown.com like what you are looking for?
__________________
Xcart 4.6.5 gold
Apache 2.2.29
PHP 5.4.34
MySQL 5.6.17
Reply With Quote
  #8  
Old 05-19-2010, 03:19 PM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Default 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?
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #9  
Old 05-24-2010, 08:27 PM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Default 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?
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #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
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:42 AM.

   

 
X-Cart forums © 2001-2020