Jump to content

Moving the Cart button/dropdown


tlman12

Recommended Posts

So I wanted to move the Cart Button/Dropdown from the header of the page (block customer info) into the navigation menu (block top menu). I wanted to maintain the dynamic price and items in cart and I really wanted to maintain the drop down. I figured it would be easier this way because the responsive design would keep it properly in place without having to test and manipulate css for all the possible screen sizes and it would keep the logo area cleaner. I only (kind of) succeeded with the first part. After further testing i found that there are major discrepancies with the count and price, and it seems to keep recalling a specific cart count and price even though I've changed the items in the cart. 

 

what i did was copy the portion i wanted out of the blockuserinfo.tpl and put it into the blocktopmenu.tpl and then added the hooks for the agjax variables into the blocktopmenu.php. Recompiled the templates and it "appeared" to be working. now i realize it isn't and i'm not sure exactly what i did wrong. If i can get the numbers right i don't really care about the drop down but if can can have both i'd be really happy.

 

**Edit: forgot the link [Link Removed]

 

***Edit: never mind, I went with the cart block in the column instead of trying to fix the button. not exactly what i wanted but it'll work for now. If anyone knows how to do it i'll still take the answer but if not don't worry about it. 

 

here is my blocktopmenu.tpl

{if $MENU != ''}
</div>
 
<!-- Menu -->
<div class="sf-contener clearfix">
<ul class="sf-menu clearfix">
{$MENU}
{if $MENU_SEARCH}
<li class="sf-search noBack" style="float:right">
<form id="searchbox" action="{$link->getPageLink('search')|escape:'html'}" method="get">
<p>
<input type="hidden" name="controller" value="search" />
<input type="hidden" value="position" name="orderby"/>
<input type="hidden" value="desc" name="orderway"/>
<input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|escape:'htmlall':'UTF-8'}{/if}" />
</p>
</form>
</li>
{/if}
<li id="shopping_cart2" style="float:right">
<a href="{$link->getPageLink($order_process, true)|escape:'html'}" title="{l s='View my shopping cart' mod='blockuserinfo'}" rel="nofollow">{l s='Cart' mod='blockuserinfo'}
 
<span class="ajax_cart_quantity{if $cart_qties == 0} hidden{/if}">{$cart_qties}</span>
<span class="ajax_cart_product_txt{if $cart_qties != 1} hidden{/if}">{l s='Product' mod='blockuserinfo'}</span>
<span class="ajax_cart_product_txt_s{if $cart_qties < 2} hidden{/if}">{l s='Products' mod='blockuserinfo'}</span>
<span class="ajax_cart_total{if $cart_qties == 0} hidden{/if}">
{if $cart_qties > 0}
{if $priceDisplay == 1}
{assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant}
{convertPrice price=$cart->getOrderTotal(false, $blockuser_cart_flag)}
{else}
{assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant}
{convertPrice price=$cart->getOrderTotal(true, $blockuser_cart_flag)}
{/if}
{/if}
</span>
<span class="ajax_cart_no_product{if $cart_qties > 0} hidden{/if}">{l s='(empty)' mod='blockuserinfo'}</span>
</a>
</li>
</ul>
 
<!--/ Menu -->
{/if}
Edited by tlman12 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...