1

In my success.phtml file I'm having a script that escapes the subtotal (among other) to an affiliateprogram. This used to work fine in version 1.7 but after upgrading to 1.9 it only outputs the value 0. Other values like order id is still being sent correct.

Here is the line of code that used to output the value:

transactionAmount: '<?php echo $this->__('%s', $this->escapeHtml($this->getSubtotal())) ?>',

Anyone knows why it fails to output the correct value, and how to fix it?

0

I don't know why this would even work in Magento 1.7

This is the order data, available on the success block:

'is_order_visible' => $isVisible,
'view_order_id' => $this->getUrl('sales/order/view/', array('order_id' => $orderId)),
'print_url' => $this->getUrl('sales/order/print', array('order_id'=> $orderId)),
'can_print_order' => $isVisible,
'can_view_order'  => Mage::getSingleton('customer/session')->isLoggedIn() && $isVisible,
'order_id'  => $order->getIncrementId(),

See Mage_Checkout_Block_Onepage_Success::_prepareLastOrder()

There is no "subtotal", so to even get "0", and not an empty string, there has to be custom code that adds additional attributes to this block. Find this custom code (class rewrite, local code pool override or observer) and debug from there.

  • Thanks @fschmengler, but I'm really not sure what you mean about that 'there is no subtotal'.. As I recall, the suscess page contains information about the purchase, including the subtotal. Shouldn't it be possible to grab that value in the script? Thanks! -Espen – Espen Jun 24 '16 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.