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

Magento API via .NET Retrieve Gift Message “From” and “To” Fields
 
klimk
Jr. Member
 
Total Posts:  2
Joined:  2012-12-10
 

I am using VB.NET to connect to a client’s V2_soap Magento API, and have run into some trouble trying to find specific fields related to gift messages.

For example, when a customer places an order, they are able to specify a gift message, and also the “To” and “From” fields.

The gift message looks like this when they place the order:

From: John
To: Jane
Message: Happy Birthday!

On my side, using the API calls, I have no problems finding the “Happy Birthday!” message on the order. However, I cannot find these “to” and “from” fields.

Using something similar to:
Protected ms As MagentoService

Dim Order As salesOrderEntity = ms.salesOrderInfo(SessionID, increment_id)

I can get and use:
Order.gift_message
Order.gift_message_id

But nothing along the lines of
Order.gift_message_to
Order.gift_message_from

I have also tried to dim a giftMessageEntity, but there is no ms.giftMessageInfo call to return that type. I can only find methods to set a gift message, not retrieve one.

Does anyone know where this info can be found via the API? Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jjbigfish
Sr. Member
 
Total Posts:  109
Joined:  2010-01-30
 

I am using the API, but with PHP, and I use sender and recipient to get my information, thats how it’s stored in the DB. Not sure if that helps you, but it may point you in the right direction.

 
Magento Community Magento Community
Magento Community
Magento Community
 
klimk
Jr. Member
 
Total Posts:  2
Joined:  2012-12-10
 

Thank you for replying, I think I may be closer to an answer

I saw some of the PHP examples, such as:

$gift_message_id $order->getOrder()->getGiftMessageId();
        if(!
is_null($gift_message_id)) {
              $message
->load((int)$gift_message_id);
              
$gift_sender $message->getData('sender');
              
$gift_recipient $message->getData('recipient');
              
$gift_message $message->getData('message');

And that seems to be exactly what I’m looking for, only I need to do the same thing in .NET.  I just need to load up the gift message object based on the gift_message_id from the order.

I looked through the SOAP API docs again, and I see that the definition for a gift message includes the fields I’m looking for:
The giftMessageEntity content is as follows:
Type Name Description
string from Gift message sender
string to Gift message recipient
string message Gift message text

However, there doesn’t appear to be a method for retrieving a specific gift message based on gift_message_id:
Methods:
giftmessage.setForQuote - Set a gift message for the shopping cart (quote)
giftmessage.setForQuoteItem - Set a gift message for an item in the shopping cart (quote)
giftmessage.setForQuoteProduct - Set a gift message for a product in the shopping cart (quote)

In other objects, such as sales_order, there is a specific method for retrieval:
Methods:
sales_order.list - Retrieve the list of orders using filters
sales_order.info - Retrieve the order information
sales_order.addComment - Add a comment to an order
sales_order.hold - Hold an order
sales_order.unhold - Unhold an order
sales_order.cancel - Cancel an order

Does anyone know if retrieving a specific gift message object is possible in .NET?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sarad1978
Jr. Member
 
Total Posts:  6
Joined:  2012-05-14
 

Hi did you ever resolve this, i have the same issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lklepner2
Jr. Member
 
Total Posts:  2
Joined:  2013-08-13
 

I’ve got the same problem - has anyone found a fix?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top