如何在 Magento 中使用对象回显托管属性?

发布于 2024-12-15 09:21:23 字数 414 浏览 2 评论 0原文

我又来了,因为我在 magento 中的学习问题。我为我的产品目录/属性/管理属性创建了一个字段。现在我想用产品信息显示此字段。当我使用此代码时,

$_product = new Mage_Catalog_Model_Product();
$_product->load($product->getId());
echo "<pre>"; print_r($_product->getDelivery());exit;

我可以通过编写以下内容来打印其他值,例如名称:

 echo "<pre>"; print_r($_product->getName());exit;

任何人都可以告诉我如何打印我通过管理界面手动添加的那些属性。

I am Again here with my learning problem in magento. I created a field in for my products Catalog/Attributes/Manage Attributes. Now I want to display this Field with the product Information. When I use This Code

$_product = new Mage_Catalog_Model_Product();
$_product->load($product->getId());
echo "<pre>"; print_r($_product->getDelivery());exit;

I am able to print other values like name by writing this :

 echo "<pre>"; print_r($_product->getName());exit;

Can anyone tell me how can I print those attributes that i have added manually through Admin interface..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吹梦到西洲 2024-12-22 09:21:23

你可以尝试看看里面有什么

echo "<pre>"; print_r($_product->getData());exit;

you can try and see what's inside

echo "<pre>"; print_r($_product->getData());exit;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文