Magento Top Cart Ajax Issue
I have implemented an Ajax based button on the listing page that will add the product through Ajax. However i am having problems with the cart shown on the top. I want to update开发者_开发问答 the cart as well.
The cart phtml file is located in checkout/cart/topbar.phtml
topbar.phtml
so i can update the div with the content.
If anything is unclear please let me know.
I tried to be very specific about my problem.
I want to update the div containing top cart, the cart phtml is already there its being called from$this->getChildHtml('topcart')
the file path in server is checkout/cart/topbar.phtml
Have you considered using one of these ready made extensions?
- Ajax Cart LITE
- Ajax Cart Pro
- Ajax Cart Basket
- Ajax Cart Simple
- Ajax Cart Professional
- Ajax Cart Advanced
- Ajax Add To Cart
- Easy Ajax Product
In the admin section go to
System -> Configuration -> developer
after that go to the top left of the page and change the Current Configuration Scope to "Main website" and then change "Template Path Hints" and "Add Block Names to Hints" to Yes
Now, when you open the magento store you'll see the block names of every magento object, so look for the one you need and finally do:
$this->loadLayout();
$block = $this->getLayout()->getBlock('header_cart');
精彩评论