Magento 产品页面在新标签页中打开 Target Blank

Magento Product page open in new tab Target Blank

我正在尝试找到一种在新标签页中打开我的网站产品页面的方法。请帮助我。

将以下 list.phtml 文件放入主题文件夹并添加 HTML 属性

文件路径为app/design/frontend/your_package(base)/your_theme(默认)/template/catalog/product/list.phtml

target="_blank"

找到行

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">

改为

<a target="_blank" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">

也对列表和网格执行此操作...

如果您使用自定义主题,请检查路径:

app/design/frontend/{your_namespace}/{your_theme}/template/catalog/product/list.phtml

如果你使用rwd主题,那么检查路径:

app/design/frontend/rwd/default/template/catalog/product/list.phtml

找到任何锚点 link 并添加 traget="_blank"

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">

更改为:

<a href="<?php echo $_product->getProductUrl() ?>" target="_blank" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">

对于 codazon 主题,在下面的文件路径中添加 target="_blank"

/app/design/frontend/Codazon/unlimited/furniture/Magento_Catalog/templates/product/list/list-styles/list-style17.phtml

<a href="<?= $_product->getProductUrl() ?>" target="_blank" class="product photo product-item-photo">