【问题标题】:Calling variable value in Magento在 Magento 中调用变量值
【发布时间】:2013-02-06 12:44:56
【问题描述】:

我在 Magento 中调用变量值时遇到了一点问题。

如果产品的库存状态为库存有限,我想在产品页面的库存状态下方向客户显示一条新消息。

所以我觉得这里什么都没有:

/public_html/app/design/frontend/mytheme/default/template/catalog/product/view.phtml

<?php if ( $_product->getResource()->getAttribute('stoc')->getFrontend()->getValue($_product) = 'stoc limitat' : ?>
<?php echo '<div id="nota.produs"> Nota : Va rugam verificati telefonic disponibilitatea acestui produs.   </div>' ?>
<?php endif; ?>

开心地撸起袖子,保存、上传、刷新,但是产品页面加载不出来。

我明白了,我没有正确调用值,是吗?

谢谢。

附:对不起,如果这是一个愚蠢的简单问题。 (就 Magento 或 PHP 而言,我不是天花板上最亮的灯泡)

【问题讨论】:

    标签: php magento html


    【解决方案1】:

    试试这个:

    <?php if ($_product->getAttributeText('stoc') == 'stoc limitat') : ?>
    

    【讨论】:

    • 能否请您发布$_product-&gt;getAttributeText('stoc')的输出?
    • yahoo .. 10x 一百万 oleg,这是你第二次救了我。我开始欠一卡车熊了。 :))
    • 好的,然后是一卡车啤酒,我会加熊作为奖励(你知道作为酒友)。真的再次感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-30
    • 2023-03-19
    相关资源
    最近更新 更多