2

我想通过toolbar.phtml中的特价或折扣产品的下拉列表扩展排序

 <div class="sort-by" style="float:left">
        <fieldset class="sort-by">
          <label><?php echo $this->__('Sort by') ?></label>
            <select onchange="setLocation(this.value)">
              <option value="<?php echo $this->getOrderUrl('price', 'asc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>> Price - Low to High </option>
              <option value="<?php echo $this->getOrderUrl('price', 'desc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>> Price - High to Low </option>
              <option value="<?php echo $this->getOrderUrl('name', 'asc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>> Name - A to Z </option>
              <option value="<?php echo $this->getOrderUrl('name', 'desc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>> Name - Z to A </option>
             <option value="<?php echo $this->getOrderUrl('update_at', 'desc') ?>"<?php if($this->isOrderCurrent('update_at') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>Newest First</option>
            </select>
      </fieldset>
    </div>

我如何添加一个折扣选项,以便产品按特价 ASC 排序?

4

1 回答 1

-1
<option value="<?php echo $this->getOrderUrl('special_price', 'asc') ?>"
<?php if($this->isOrderCurrent('special_price') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"
<?php endif; ?>>Special Price</option>
于 2018-10-10T10:02:13.940 回答