0

In want to add an unique link in the transactional email template, that confirms the order and sets the Status from On Hold to Pending. To make the link unique I am using the order id. Is there a way to parse the orderid via php, like

example.com/index.php/shipping/confirm.php?orderid=100002205

or should it look like here:

example.com/index.php/shipping/confirm/100002205

Is there a way to generate these confirmational links?

0

I think if you are just emailing those links out, you can just build the URL manually, following the structure outlined in this answer: https://stackoverflow.com/a/19214765/6727815

I believe you should be able to generate the order's increment ID from within an email template.

Then to update the order status, you might have something that looks like this:

//Requested URL: example.com/modulename/order/confirmation/100002205
class Namespace_ModuleName_OrderController
{
    public function confirmationAction()
    {
        $param = $this->getRequest()->getParam('orderID');
        $order = Mage::getModel('sales/order')->loadByIncrementId($param);
        $order->setData('status', Mage_Sales_Model_Order::STATE_PENDING_PAYMENT);
        $order->save();
    }
} 

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.