0

マジェントカートブロックをドロップダウンボックスにロードするのを手伝ってください。具体的には、モジュールのタイトルまたはメニューに「マイ バスケット」などを表示し、「マイ バスケット」の下にカート内のアイテム数のメッセージを表示する必要があります。ユーザーがメニューにカーソルを合わせると、ドロップダウン ボックスに cart/sidebar.phtml の内容が表示されます。これを実現する方法を教えてください。

前もって感謝します。

4

2 に答える 2

0

私が取り組んでいるサイトのためにこれをやっています。残念ながら、静的ブロックを介してこれを行う必要がありました...しかし、問題なく動作するように見えました. これは私にとってはうまくいっています。プレイして、様子を見てください。

CSS は非常にシンプルで、ドロップダウン自体を表示および非表示にするための鍵です。

CSS

// this is the panel where the cart is displayed
DIV#cart-panel {
    width:100px; //arbitary width
    position:absolute; // need this so that it doesn't interfere with the layout
    display:none; // hides the block
    z-index:200; // makes it way it in front of other content
}

#cartBtn:hover #cart-panel { display: block; } // basically, when you hover over the cartBtn, the cart-panel displays

静的ブロックが含まれています

<li id="myCartBtn">
    <a href="{{store url=checkout/cart}}" rel="cart">My Cart</a>
    {{block type="checkout/cart_sidebar" template="checkout/cart/sidebar.phtml"}}
</li>

次に、sidebar.phtml で、id="cart-panel" を含む div がカート自体を囲んでいることを確認します。<div class="block block-cart">

<?php if ($this->getIsNeedToDisplaySideBar()): ?>
<div id="cart-panel">
...
</div>
<?php endif; ?>

そして最後に、静的ブロックをテンプレートの必要な場所に配置します

于 2012-04-14T00:04:10.723 に答える
0

Fatdivision AJAX Quick Cart の記事を確認してください。

于 2012-04-14T09:10:32.323 に答える