Jump to content

How To Move Blockcart Button To Blocktopmenu


Recommended Posts

I want to put the shopping cart button in the blocktopmenu area so that it will be at the end of my horizontal nav bar. I managed to get it to display there by moving this code from blockuserinfo.tpl to blocktopmenu.tpl:

 

{if !$PS_CATALOG_MODE}

<li id="shopping_cart">

<a href="{$link->getPageLink($order_process, true)}" title="{l s='Your Shopping Cart' mod='blockuserinfo'}">{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>

{/if}

 

But now the link to the cart doesn't work, it looks like this: "http://www.myshop.com/shop/index.php?controller=" It just goes to the home page. I have the ajax hover cart summary menu disabled, by the way.

 

I'm sure that there is some other code I need to move. Also, do I change mod='blockuserinfo' to mod='blocktopmenu' ? Can anyone tell me what I'm missing? Thanks.

Link to comment
Share on other sites

Hi yaniv14,

 

Thanks for your reply! Actually, I have the css positioning right. The problem I'm having is that the cart URL for checkout is not being formed by the ajax script so that when you click on it, it goes nowhere. So I must not have the code that grabs the variables in the right place....

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...