Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Customized of Success Page from Layout file…
 
SAFETYPAY
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2009-06-11
Miami
 

HI Friends,

Before, Sorry for my English…

I am creating a new payment method to SafetyPay with good progress, but I still have headaches.

* For now, the payment process is completed successfully. You can choice and pay with this new payment method.

However:
* I need to show within the “Confirmation Message”, in “success.phtml” template… additional information for the buyer.

Files:
* I have a XML file call: safetypay.xml, your location is: “/app/design/frontend/default/default/layout/safetypay.xml”

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
    </default>
    <
checkout_onepage_success>
        <
reference name="root">
            <
action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </
reference>
        <
reference name="content">
            <
action method="unsetChild"><name>checkout.success</name></action>
            <
block name="checkout.success" template="safetypay/confirmation.phtml" type="safetypay/confirmation" />
        </
reference>
    </
checkout_onepage_success>
</
layout>

* I have my block template call: confirmation.phtml (This replace the “Success Default Page of Magento”, for now with data in hardcore.. sorry)

<div class="page-head">
    <
h3><?php echo $this->__('Your order has been received'?></h3>
</
div>

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<p><img src="<?php echo $this->getSkinUrl('images/media/safetypay/logo.png') ?>" alt="SafetyPay Inc." /><br />
    <
strong><?php echo $this->__('Thanks for using SafetyPay!'?></strong><br />
</
p>

<
p<?php if ($this->canPrint()) :?>
    <?php 
echo $this->__('Your order # is: <a href="%s">%s</a>'$this->getViewOrderUrl(), $this->getOrderId()) ?>.<br/>
    
<?php  else :?>
    <?php 
echo $this->__('Your order # is: %s'$this->getOrderId()) ?>.<br/>
    
<?php endif;?>
</p>

<
p><strong><?php echo $this->__('To complete payment of this transaction, please go to your Online Banking, and use the following information:'

?></strong></p>
<
p>
Your Transaction ID: <strong>11611</strong><br />
Your Purchase Amount: <strong>41.27 Euro (EUR)</strong><br />
<
br />
You can <a href="">[Click here]</ato go directly to <strong>SAFETYPAY Default Bank</strong>.
</
p>
<
p><strong>IMPORTANTThis Transaction will expire in 2 hours.</strong></p>

<
p<?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.'?><br/>
    
<?php if ($this->canPrint()) :?>
    <?php 
echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.'$this->getPrintUrl()) ?>
    <?php 
endif;?>
    <?php 
echo $this->getChildHtml() ?>
</p>
<
div class="button-set">
    <
button type="button" class="form-button" onclick="[removed]='<?php echo $this->getUrl() ?>'"><span><?php echo $this->__('Continue Shopping'

?></span></button>
</
div>

* This is my block class code, call:  Confirmation.php

class Mage_SafetyPay_Block_Confirmation extends Mage_Core_Block_Template
{
    
private $_order;
    
    protected function 
_construct()
    
{
        parent
::_construct();
        
$this->setTemplate('safetypay/confirmation.phtml');
    
}

    
/**
     * Retrieve identifier of created order
     *
     * @return string
     */
    
public function getOrderId()
    
{
        
return Mage::getSingleton('checkout/session')->getLastRealOrderId();
    
}

    
/**
     * Check order print availability
     *
     * @return bool
     */
    
public function canPrint()
    
{
        
return Mage::getSingleton('customer/session')->isLoggedIn() && $this->isOrderVisible();
    
}

    
/**
     * Get url for order detale print
     *
     * @return string
     */
    
public function getPrintUrl()
    
{
        
return $this->getUrl('sales/order/print', array('order_id'=>Mage::getSingleton('checkout/session')->getLastOrderId()));
    
}

    
/**
     * Get url for view order details
     *
     * @return string
     */
    
public function getViewOrderUrl()
    
{
        
return $this->getUrl('sales/order/view/', array('order_id'=>Mage::getSingleton('checkout/session')->getLastOrderId(), '_secure' => true));
    
}

    
/**
     * See if the order has state, visible on frontend
     *
     * @return bool
     */
    
public function isOrderVisible()
    
{
        
if (!$this->_order{
            $this
->_order Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
        
}
        
if (!$this->_order{
            
return false;
        
}
        
return !in_array($this->_order->getState(), Mage::getSingleton('sales/order_config')->getInvisibleOnFrontStates());
    
}
}

* Attachment a picture on this “Customized Success Page”.... what replace the “Success Default Page of Magento"… view attach image..

* THE PROBLEM:
This “Confirmation Message” is displayed, selected or not to SafetyPay as Payment Method, when it should only appear when you select SafetyPay payment

method. For example, when i select as payment method to “Credit Card” y complete my order, the confirmation message is always the same....

I hope I can understand ...

Help me, my friends!!!.....  Suggest??

Thanks for advance, Greetings from Peru.

Image Attachments
Magento_Confirmation.PNG
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top