开发者

Display sample download in list view

I have a storefront that has just downloadable products. In my design, all products are displayed in list view. On that list view i want to have a button to play the sample audio file from the downloads.

I'm having an issue retrieving that sample file. I just want开发者_如何学编程 to play the first sample attached to a product.

Has anyone done this , or would know how to accomplish this ? Using the same code to retrieve a sample file from the product page doesnt seem to work.


You can try with something like this:

<?php if ( $_links = $_product->getDownloadableLinks() ) {
    foreach ($_links as $_link) {
        // Do what you want with $_link
        //Mage::log($_link->getData());
    }
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜