Closed djordje-petrovic closed 8 years ago
The extension doesn't generate a product count for the header link, it renders the links html, and then strips out the contents of the link element and updates this on the page. If you are not seeing this updating it might be that the contents of the skip-cart
anchor element is not rendering correctly.
Ok. I can see json key linktext is always null. This means there is no output from this regex line:
preg_match('/<a.+skip-cart.+>(.+)<\/a>/Us', $cartlink, $linktext);
Right?
You want to be looking at the _getLinkText()
method here.
Yes, I'm aware, the line above is from that function exactly. Could you please just confirm what I've asked in the previous post? Please bear with me for this. If my cart link html is like this:
<a href="http://localhost/magento/index.php/checkout/cart/" data-target-element="#header-cart" class="skip-link skip-cart"> <span class="label"><i class="fa fa-cart-arrow-down fa-2x"></i></span> <span class="count">1</span> </a>
Preg_matchs should output something like:
<span class="label"><i class="fa fa-cart-arrow-down fa-2x"></i></span> <span class="count">0</span>
which should be in $linktext. Correct?
You can very easily determine what is output for your store by adding a breakpoint into that method to allow you to inspect the contents of $linktext
in your IDE, or just put the values into something like this. Remember that array key 1
is returned. not 0
.
Actually the code snippet I've posted is from one those generators :) Anyway I've solved my problem. It was just a block name I had to change in _getLinkText(). Thank you for your help. You may close the issue.
Ok great, thanks for the update.
Hi. Thanks for this great extension. I've managed to integrate it successfully with my custom theme. However there is a small issue of items count for minicart in header. It's not being update at all. Relevant excerpt from my header.phtml looks like this:
I've read all in Issue #21 where user had the similar issue but there is not a hint how to solve this?