1

I have made adbanners for my website and the title of the product does have a fine working link by using the following code: <a href="<?php echo $_product->getProductUrl() ?>" title="wefewf"></a>

But using the same code for the image and buy here doesn't work. In element inspect you can actually see the link in the html but it's just plain text. Any Ideas?

EDIT: I found the problem, well not really but I've found a problem. It works if I put it somewhere outside my ad banner. So It might be css but I can't seem to find the issue here. This is the css for the image applied:

.products-grid .product-image { 
    display: block;
    float: left;
    height: auto;
    max-width: 270px;
    overflow: hidden;
    position: relative;
    text-align: left;
    margin-left: 10px;
}

But then again, the css for both the working and not working is the same.

  • for getting getProductUrl() value, $product should be object of Mage_Catalog_Model_product – Amit Bera Apr 14 '15 at 7:44
  • It does get a value but it's simply not clickable. – Mustafa Tosuncu Apr 14 '15 at 7:46
1

Can you check to see if any css property is pushing back the image in the visibility stack level. May be due to z-index of other element the click is blocked by the overiding layer. If possible can you show inspect screenshot with applied css properties.

| improve this answer | |
  • Can you please check my edited post – Mustafa Tosuncu Apr 14 '15 at 8:00
  • Okay, this worked! Thanks alot dude! I thought it wasn't the CSS but ofcourse it could've been other CSS cockblocking the productUrl's div CSS. Holy crap I might be a decent webdeveloper(kuchcan'tevengetpastcsskuch) – Mustafa Tosuncu Apr 14 '15 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.