1

このファイル(frontend / base / default / template / catalog / product / list.phtml)は編集されましたが、現在は適切な価格が表示されていません 。http://www.personalproducts4u.co.uk/hotel-toiletries/au-lait

上記のファイルの3番目のテーブルタグ(3番目のテーブルタグのみ)を変更しましたが、価格はすべて同じ(割引価格で)表示されていますか?

これは私が変更したコードです:(リストファイルの3番目のテーブルタグに貼り付けました)

 <table border="1" cellpadding="0" cellspacing="0">
                    <tr>
                        <th class="buy_heading">Buy</th>
                        <td class="buy_pay_content">1</td>
                     <?php 
                            /*foreach($tierPrices as $key=>$value) 
                            {
                                echo "<td class='buy_pay_content'>".number_format($tierPrices[$key]['price_qty'],0)."</td>";
                            } */
                        ?>
                        <?php
                     if(count($tierPrices)):
                     foreach($tierPrices as $key=>$value) 
                          {
                              echo "<td class='buy_pay_content'>";
                              echo number_format($tierPrices[$key]['price_qty'],0);
                              if($key == $count-1) 
                              {
                                    echo "+";
                              }
                              echo "</td>";
                          } 
                     else:
                    echo '<td class="buy_pay_content">5</td>
                     <td class="buy_pay_content">10+</td>';
                     endif; 

                      ?>
                        <td class="buy_pay_content">Quantity</td>
                    </tr>
                    <tr>
                        <th class="pay_heading">Pay</th>
                        <td class="buy_pay_content"><?php echo $this->getPriceHtml($_product) ?><?php //echo Mage::helper('core')->currency($_product->getPrice()) ; ?>

                        <?php //echo Mage::helper('core')->currency($_product->getPrice()) ; ?> <?php //echo $this->getPriceHtml($_product, true)

                         ?>
                        </td>
                       <?php 
                       $specialprices = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice(); 
                       if($specialprices)
                       {
                           $specialprice =$specialprices; 
                       }
                       else
                       {
                           $specialprice = 0;
                       }
                         if(count($tierPrices)):
                            foreach($tierPrices as $key=>$value) 
                            {
                                if($specialprice < $tierPrices[$key]['price'] && $specialprice != '0'):
                                //echo 'special less'.$specialprice;
                                ?>
                                <td class='buy_pay_content'><div class="price-box"> 
                                      <p class="old-price"><span id="old-price-182" class="price"> <?php echo Mage::helper('core')->currency($tierPrices[$key]['price']) ?> </span>  </p>
                                      <p class="special-price"> <span id="product-price-182" class="price"><?php echo Mage::helper('core')->currency($specialprice) ?></span></p>
                                   </div></td>
                                <?php
                                else:
                                ?>
                                <td class='buy_pay_content'><?php echo Mage::helper('core')->currency($tierPrices[$key]['price']) ?></td>
                                <?php
                                endif;
                                ?>


                            <?php } 
                            else:
                                echo "<td class='buy_pay_content'>".$this->getPriceHtml($_product, true)."</td>";
                                    echo "<td class='buy_pay_content'>".$this->getPriceHtml($_product, true)."</td>";
                            endif;
                        ?>

                        <td class="buy_pay_content"><input type="text" class="input-text qty" title="Qty" value="" maxlength="12" id="qty" name="qty"></td>
                    </tr>
                    </table>
4

1 に答える 1

0

問題は、 getSpecialPrice() が特別価格フィールドにあるものを返すという事実のようです。私は間違っているかもしれませんが、Magento で特別な段階的価格を提供できるとは思えません。静的な特別価格を追加することはできますが、既に経験したように、反復ごとに同じ価格が表示されます。

このような売上を適切に表示するには、おそらく何らかのカスタム拡張機能またはテンプレート ロジックが必要になるでしょう。

現在、段階的価格設定をどのように管理されているかわかりませんが、段階ごとに固定パーセンテージである場合は、段階的価格を計算された販売価格に設定し、各段階的割引率を割って元の段階的価格を計算して表示し、それを表示することができます。番号。

于 2013-02-07T13:39:01.710 に答える