Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set gift message to existing order programmatically [closed]

Tags:

php

magento

I'm looking for a bit of code to add a gift message to existing order programmatically in Magento.

====================

An update

I like that moderators (@Charles, etc etc) flagged this question as not real even though it had 228 views - obviously no one really having same issue... lol Would be great to see up-vote from everyone who reads it. How much more specific can you be? lol

like image 879
Miroslav Avatar asked Feb 19 '23 14:02

Miroslav


1 Answers

$giftMessage = Mage::getModel('giftmessage/message'); 
$giftMessage->setCustomerId($customer->getId()); 
$giftMessage->setSender('sender']); 
$giftMessage->setRecipient('recepient'); 
$giftMessage->setMessage('message'); 
$giftObj = $giftMessage->save(); 
$order->setGiftMessageId($giftObj->getId()); 
$order->save(); 
like image 102
Miroslav Avatar answered Mar 08 '23 01:03

Miroslav