how to link product images on homepage/category page to product page
For this site I need the product images from the homepage or the category page to link to the product. Right now when you click on a product image it doesn't link to the product page. It does nothing. You have to click the name of the product in order to get to the product page. Anyone know a way to do this with reference to where to put the necessary code. I was thinking something with xml files but i am not sure which file and where it is located....
Thanks for the help...
product product-images
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
For this site I need the product images from the homepage or the category page to link to the product. Right now when you click on a product image it doesn't link to the product page. It does nothing. You have to click the name of the product in order to get to the product page. Anyone know a way to do this with reference to where to put the necessary code. I was thinking something with xml files but i am not sure which file and where it is located....
Thanks for the help...
product product-images
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
the theme i was using had a css conflict which made the product image not a link but its fixed now
– jstayfaded
Mar 28 '16 at 19:48
add a comment |
For this site I need the product images from the homepage or the category page to link to the product. Right now when you click on a product image it doesn't link to the product page. It does nothing. You have to click the name of the product in order to get to the product page. Anyone know a way to do this with reference to where to put the necessary code. I was thinking something with xml files but i am not sure which file and where it is located....
Thanks for the help...
product product-images
For this site I need the product images from the homepage or the category page to link to the product. Right now when you click on a product image it doesn't link to the product page. It does nothing. You have to click the name of the product in order to get to the product page. Anyone know a way to do this with reference to where to put the necessary code. I was thinking something with xml files but i am not sure which file and where it is located....
Thanks for the help...
product product-images
product product-images
asked Mar 16 '16 at 20:34
jstayfadedjstayfaded
105
105
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
the theme i was using had a css conflict which made the product image not a link but its fixed now
– jstayfaded
Mar 28 '16 at 19:48
add a comment |
the theme i was using had a css conflict which made the product image not a link but its fixed now
– jstayfaded
Mar 28 '16 at 19:48
the theme i was using had a css conflict which made the product image not a link but its fixed now
– jstayfaded
Mar 28 '16 at 19:48
the theme i was using had a css conflict which made the product image not a link but its fixed now
– jstayfaded
Mar 28 '16 at 19:48
add a comment |
2 Answers
2
active
oldest
votes
You would need to give more info, like what template are you using, or if you are just using the regular default template, below is where the general location of the file would be, hopefully it points you in the right direction - also I need to mention that it is recommended to extend your theme, so that you don't make edits to the original template and lose your changes during an update.
Depending on what theme you are using for magento, you would need to edit the file located here:
app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml
you will need to make your edits in two places, you will notice an if/else statement that designates whether the listing will show as grid or list mode. just edit both places to be safe. Look for something like this:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
The above code spits out the image.
Then you need to wrap it in your anchor tag:
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
Don't forget to close your anchor tag after the image code.
From my experience, most templates already link the image to the product itself, unless you have some kind of error or are using a custom template.
Hope this helps.
add a comment |
the theme i was using had a css conflict which made the product image not a link but its fixed now
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f106615%2fhow-to-link-product-images-on-homepage-category-page-to-product-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You would need to give more info, like what template are you using, or if you are just using the regular default template, below is where the general location of the file would be, hopefully it points you in the right direction - also I need to mention that it is recommended to extend your theme, so that you don't make edits to the original template and lose your changes during an update.
Depending on what theme you are using for magento, you would need to edit the file located here:
app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml
you will need to make your edits in two places, you will notice an if/else statement that designates whether the listing will show as grid or list mode. just edit both places to be safe. Look for something like this:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
The above code spits out the image.
Then you need to wrap it in your anchor tag:
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
Don't forget to close your anchor tag after the image code.
From my experience, most templates already link the image to the product itself, unless you have some kind of error or are using a custom template.
Hope this helps.
add a comment |
You would need to give more info, like what template are you using, or if you are just using the regular default template, below is where the general location of the file would be, hopefully it points you in the right direction - also I need to mention that it is recommended to extend your theme, so that you don't make edits to the original template and lose your changes during an update.
Depending on what theme you are using for magento, you would need to edit the file located here:
app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml
you will need to make your edits in two places, you will notice an if/else statement that designates whether the listing will show as grid or list mode. just edit both places to be safe. Look for something like this:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
The above code spits out the image.
Then you need to wrap it in your anchor tag:
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
Don't forget to close your anchor tag after the image code.
From my experience, most templates already link the image to the product itself, unless you have some kind of error or are using a custom template.
Hope this helps.
add a comment |
You would need to give more info, like what template are you using, or if you are just using the regular default template, below is where the general location of the file would be, hopefully it points you in the right direction - also I need to mention that it is recommended to extend your theme, so that you don't make edits to the original template and lose your changes during an update.
Depending on what theme you are using for magento, you would need to edit the file located here:
app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml
you will need to make your edits in two places, you will notice an if/else statement that designates whether the listing will show as grid or list mode. just edit both places to be safe. Look for something like this:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
The above code spits out the image.
Then you need to wrap it in your anchor tag:
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
Don't forget to close your anchor tag after the image code.
From my experience, most templates already link the image to the product itself, unless you have some kind of error or are using a custom template.
Hope this helps.
You would need to give more info, like what template are you using, or if you are just using the regular default template, below is where the general location of the file would be, hopefully it points you in the right direction - also I need to mention that it is recommended to extend your theme, so that you don't make edits to the original template and lose your changes during an update.
Depending on what theme you are using for magento, you would need to edit the file located here:
app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml
you will need to make your edits in two places, you will notice an if/else statement that designates whether the listing will show as grid or list mode. just edit both places to be safe. Look for something like this:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
The above code spits out the image.
Then you need to wrap it in your anchor tag:
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
Don't forget to close your anchor tag after the image code.
From my experience, most templates already link the image to the product itself, unless you have some kind of error or are using a custom template.
Hope this helps.
answered Mar 16 '16 at 21:02
RubberToeRubberToe
711
711
add a comment |
add a comment |
the theme i was using had a css conflict which made the product image not a link but its fixed now
add a comment |
the theme i was using had a css conflict which made the product image not a link but its fixed now
add a comment |
the theme i was using had a css conflict which made the product image not a link but its fixed now
the theme i was using had a css conflict which made the product image not a link but its fixed now
answered May 6 '16 at 16:19
jstayfadedjstayfaded
105
105
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f106615%2fhow-to-link-product-images-on-homepage-category-page-to-product-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
the theme i was using had a css conflict which made the product image not a link but its fixed now
– jstayfaded
Mar 28 '16 at 19:48