【发布时间】:2015-05-22 01:55:04
【问题描述】:
我一直在修复这家商店,基于 magento。这样做的主要问题是商店视图上显示的某些产品的尺寸不正确(这是属性)
如果您看一下图片,在网格视图 (list.phtml) 上,尺寸是 US 16/UK 18/EUR 48,而在单视图页面 (view.phtml) 上是 US 6/UK 8 / 38 欧元。
看看这个链接
http://www.sequinqueen.com/shop/in-stock.html
我浏览了view.phtml中的代码,似乎代码根据下面的代码正确请求了属性值
<?php
$categories =$_product->getCategoryCollection();
foreach($categories as $_category) {
$cat_arr[] = $_category['entity_id'];
}
if($currentCategoryId==102){
// CATEGORY ID = 102 is IN-STOCK PRODUCT CATEGORY
$sizeStock=$_product->getAttributeText('size');
$day="Ready To Ship";
$searchfabric=$_product->getSearchfabric();
$searchcolor=$_product->getSearchcolor();
$make=$_product->getHandmake();
$handmake="HandMake";
$topname=$_product->getTopname();
<?php $i=$j+1;?>
<?php $j=$j+1;?>
<?php if($j<5){?>
<?php if ($i%$_columnCount==1): ?>
<ul class="products-grid">
<?php endif ?>
<?php if($j==1):?>
<li class="item first" style="height:434px; background:#FFF;">
<?php echo $this->getChildHtml("catalog"); ?>
</li>
<li class="item">
<?php echo $topname; ?>
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(162,324); ?>" width="162" height="324" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
<div style="width:100%; border-bottom:none; height:80px;">
<?php echo $this->getPriceHtml($_product, true) ?>
<?php if($make==1){ echo "<p>".$handmake."</p>";}else{}?>
<?php if($currentCategoryId==102){?>
<!-- display size -->
<p><?php echo $sizeStock; ?></p>
<?php } ?>
<p> <?php echo $day; ?></p>
</div>
</li>
所以我想到它可能是商店后端的东西,在属性修改的某个地方。 下面是之前开发者如何对size值的位置进行排序和排列的,不知道是不是这个问题的原因。
有人熟悉这个问题吗? 任何答案表示赞赏。 提前谢谢你。
【问题讨论】:
-
你的属性是文本框还是向下类型?
-
下拉式。
标签: php magento attributes