I would like my Magento product custom options to be positioned below the price. I tried moving the blocks in catalog.xml file but nothing worked. I did flush all cache every time.
4 回答
这可以在管理员的管理产品部分中完成。在design下,设置“Display Product Options In”>“Product Info Column”
这个函数可以在
/app/design/frontend/your_package/your_theme/template/catalog/product/view.phtml
或者,如果它不存在,请查看
/app/design/frontend/your_package/default/template/catalog/product/view.phtml
如果文件不存在,则通过从复制创建它
/app/design/frontend/base/default/template/catalog/product/view.phtml
或者,如果您使用的是企业版,则来自:
/app/design/frontend/enterprise/default/template/catalog/product/view.phtml
切记不要碰任何东西/app/design/frontend/enterprise/default/
The code responsible for showing prices is:
<?php echo $this->getChildHtml('tierprices') ?>
You have to move the code responsible for showing the options, that looks like this:
<?php if (!$this->hasOptions()):?>
<div class="add-to-box">
<?php if($_product->isSaleable()): ?>
<?php echo $this->getChildHtml('addtocart') ?>
<?php endif; ?>
<?php echo $this->getChildHtml('addto') ?>
</div>
<?php else:?>
<?php if ($_product->isSaleable() && $this->hasOptions() && $this->getChildChildHtml('container1') ):?>
<div class="options-container-small">
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
</div>
<?php else: ?>
<?php echo $this->getChildHtml('addto') ?>
<?php endif;?>
<?php endif; ?>
directly below the code that's responsible for prices. Remember that the code above is an example, it may look different in your template, so don't copy-paste it.
Anyway, the file responsible for showing prices is usually /app/design/frontend/your_package/your_theme/template/catalog/product/view/tierprices.phtml
(与往常一样的后备),但你不应该在你的情况下修改它。
修改模板或在您的主题中覆盖它!
/app/design/frontend/base/default/template/catalog/product/view.phtml
This is where the price is :
<?php echo $this->getTierPriceHtml() ?>
This means customer options showing between this if (){}
<?php if (!$this->hasOptions()):?>
因此,您可以在模板文件中随意移动它们!或者您可以使用 CSS 设置它们的样式以将它们放在自定义位置!
您可以通过编辑模板 (.phtml) 文件来更改它们:app/design/frontend/{default}/{default}/catalog/product/view.phtml