How to integrate dynamically JS code in success page in magento

天大地大妈咪最大 提交于 2019-12-08 09:51:32

This seems like a bad way of solving this, but from what I can deduce, they want you to do something like this at the top of success.phtml:

<?php require_once "path/to/commissionjunction.php" ?>
<script>var MasterTmsUdo = <?php echo CommissionJunction::getCommissionJunctionUdo($this->getOrderId()); ?></script>

UPDATE:

I just realized that's a helper class. Assuming the module is properly configured with config.xml and having that file in the Helper dir, this should work--without a require_once like my original example.

<script>var MasterTmsUdo = <?php echo Mage::helper('commissionjunction')->getCommissionJunctionUdo($this->getOrderId()); ?></script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!