0
votes

Hello I am trying to fix an issue where our add to cart button does not work but only on our search results page so i'm asking if anyone knows where this file is located. My problem is that each product listing in category and search results page has a quick add to cart button which allows the user to add to cart without navigating to the product page.

This button works on the category pages fine however it does not work on the search results page and so I would like to take a look at the phtml file that is being used to generate the product listings in the search results. Template path hints does not work on my magento so I cannot turn this on to find the location of files unfortunately.

I think Ihave found the code for the category grid pages to be here app/design/frontend/default/mytemplate/template/catalog/product/list.phtml and would like to know where the search page phtml file that is used for the product listings on a search result page.

Thanks Harri

1

1 Answers

2
votes

This is the path to the search page template.

app > design > frontend > [package] > [theme] > template > catalogsearch > result.phtml

It then calls in the same product list.phtml that your product page uses within it. You'll need to change the package and theme to whatever you're using.

I've just tested this button and it seems to work for me on the search page

<?php if($_product->isSaleable()):?>
    <button class="form-button" onclick="setLocation('<?=$this->getAddToCartUrl($_product)?>')">Add to Cart</button>
<?php endif;?>