Magento Checkout 成功页面产品价格和 SKU 检索
我想将佣金连接添加到我的客户站点,因为他们询问每个产品的 SKU 和价格。在确认页面/成功页面之后,我们只需要传递这些值。但在这里我如何获得所有产品详细信息。包括sku,价格我需要通过。有没有办法分别获取每个产品的详细信息。
谢谢 苏雷什
I want to add Commission junction to my client site, in that they asked for each product sku's and price. After the confirmation page/ success page only we need to pass thes values. But here how i can get all the product details. Including sku, price i need to pass. Is there any way to get each product details separately.
Thanks
Suresh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,你是对的@leek
,但是如果你想使用 CJ 添加高级设置,那么请遵循此方法。
它工作得很好。
Yeah you are right @leek
But if you want to add advanced setup with CJ then follow this method.
Its worked perfectly.
留意这样的事件:
接下来,您需要一些东西来处理事件。
app/code/local/Yourcompany/Yourmodule/Model/Observer.php
查看数据库表“sales_flat_order_item”或执行
var_dump($item->debug ())
查看可用的值类型。由于它是一个平坦的桌子,查找有关产品的更多信息的唯一方法如下:Watch for an event like this:
Next, you need something to handle the event.
app/code/local/Yourcompany/Yourmodule/Model/Observer.php
See the database table "sales_flat_order_item" or do a
var_dump($item->debug())
to see what sort of values are available. As it's a flat table the only way to find more information about a product is like this:注意:这不是最好的方法!您应该为此创建一个新的块/模板并通过其他方式传递数据。您也不应该在视图/模板中实例化数据库连接。
话虽如此,这就是我在学习如何覆盖模块/模板/等之前很久就在 Magento 商店上实现 Commission Junction 的方法。
app\design\frontend\enterprise\default\template\checkout\success.phtml
Note: This is NOT the best method! You should be creating a new block/template for this and pass the data via another means. You should also not ever instantiate a Db connection in the view/template.
With that said - here is how I implemented Commission Junction on a Magento store long before I learned how to override modules/templates/etc.
app\design\frontend\enterprise\default\template\checkout\success.phtml