Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Pricing Grid [solved]
 
bobbrodie
Sr. Member
 
Avatar
Total Posts:  132
Joined:  2008-04-02
Philadelphia, PA
 

Hello,

I am writing a product grid that displays on /catalog/product/list.phtml - here is the code:

<?php $_productCollection=$this->getLoadedProductCollection() ?>
<?php 
if(!$_productCollection->count()): ?>
<div class="note-msg">
    
<?php echo $this->__('There are no products matching the selection.'?>
</div>
<?php else: ?>

<?php 
//SW Price Grid ?>
<?php setlocale(LC_MONETARY'en_US'); ?>
<div>
    <
table>
        <
caption>Prices Per Case</caption>
        <
thead>
            <
tr style="background-color: #ececec; border-bottom: solid 1px #000;">
                <
th>Size</td>
                <
th>TIER1</td>
                <
th>TIER2</td>
                <
th>TIER3</td>
                <
th>Qty/Case</td>
                <
th>View Item</td>
            </
tr>
        </
thead>
        <
tfoot>
            <
tr>
                <
th>FOOTER</th>
            </
tr>
        </
tfoot>
        <
tbody>
    
<?php foreach ($_productCollection as $_product): ?>
            
<tr style="background-color:#fff; border-bottom: 1px solid #f0f0f0;">
                <
td><?php echo $_product->getResource()->getAttribute('size')->getFrontend()->getValue($_product?></td>
                <
td><?php echo money_format('%n'$_product->getPrice()) ?></td>
                <
td></td>
                <
td></td>
                <
td><?php echo $_product->getResource()->getAttribute('qty_case')->getFrontend()->getValue($_product?></td>
                <
td><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">View</a></td>
            </
tr>
    
<?php endforeach; ?>
        
</tbody>
    </
table>
</
div>
<?php endif; ?>

What I am trying to do is replace TIER1, TIER2, and TIER3 with my price breakdowns (1-5, 6,11, 12+). Then in those columns pull the prices from those tiered prices. Size and Qty/Case are custom attributes that I am pulling in. Any help would be greatly appreciated.

Image Attachments
Capture.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
 
AndreusPT
Jr. Member
 
Total Posts:  15
Joined:  2008-07-25
 

I saw something like this, maybe you can use it: $_product->getTierPrice($qty)

 
Magento Community Magento Community
Magento Community
Magento Community
 
bobbrodie
Sr. Member
 
Avatar
Total Posts:  132
Joined:  2008-04-02
Philadelphia, PA
 

That’s interesting - do you know what $qty should be defined as?

Thanks,
Bob

 
Magento Community Magento Community
Magento Community
Magento Community
 
bobbrodie
Sr. Member
 
Avatar
Total Posts:  132
Joined:  2008-04-02
Philadelphia, PA
 

I have tried everything I can with this, so if anyone can help, that’d be great.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

I don’t think there’s enough info for us to figure out exactly what you’re doing here. Can you elaborate? How do your prices work? What exactly is the “math” behind figuring it out?

 
Magento Community Magento Community
Magento Community
Magento Community
 
bobbrodie
Sr. Member
 
Avatar
Total Posts:  132
Joined:  2008-04-02
Philadelphia, PA
 

I’ve got it,

The trick is to use getTierPrice(x) in list.phtml. That will give you the price for qty of x for each product in that category.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top