Hi all, apologize if this actually not the right place to put this kind of issue.
First of all, not sure whether this is problem in Commerce PayPal, or DC Kickstart v.2, or maybe Message module that by default installed and used in DC Kickstart v2.
I'm using DC Kickstart v2 with Commerce PayPal v.7.x-1.0 with WPS.

After the customer redirected to PayPal page and made the payment, drupal site (DC Kickstart v2 site) send an email notification of order summary along with image thumbnail of the product to the customer.

The problem is, the image thumbnail of the product is not showing up.

I checked that this order summary is actually coming from Views (/admin/structure/views/view/commerce_cart_summary/edit) with order id as the argument, which also being used as a Token in Message module for sending the email notification of order summary (/admin/structure/messages/manage/commerce_order_order_confirmation). The token name is !order-summary.

This is the code that I meant (/profiles/commerce_kickstart/modules/contrib/commerce_message/commerce_message.module):

function commerce_message_order_summary(Message $message) {
  $wrapper = entity_metadata_wrapper('message', $message);
  $view = views_get_view('commerce_cart_summary');
  $view->set_arguments(array($wrapper->message_commerce_order->getIdentifier()));
  $view->hide_admin_links = TRUE;
  return $view->preview();
}

I debug it also, the order_id is there in the argument, but for some reason the Views is not being rendered.

Anyone encounter this before?
Any help would be greatly appreciated.
Thanks

Comments

ardnet’s picture

OK, strangely enough, if I put http authentication in my site, I can see image thumbnail of the product in my email notification of order summary.
But I got that email after I click "Return to the store" link in PayPal page.

And I'm still using PayPal sandbox to test btw.

Anyone encounter this before? Any help would be greatly appreciated.
Many thanks.

ardnet’s picture

Here I attached some screenshot to show the problem that I meant.
Thanks

rszrama’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I don't see how this has anything to do with PayPal. This module doesn't send out e-mails, unless you're talking about an e-mail sent from PayPal.

I don't know what queue to move it to either, since I'm not even aware of Kickstart attempting to send images in e-mails. You might just look at the HTML of the e-mail and see if it has a broken link for some reason that can be fixed through configuration.

If you can think of the appropriate queue, please move this there and set its status back to "active."

ardnet’s picture

Hi Ryan, thanks for replying.
OK, I think this might be issue with Message module that being used by default in DC Kickstart v2, I'll move this issue to there then, and see how it goes.
Thanks a lot for your time.
Cheers.

rszrama’s picture

Project: Commerce PayPal » Commerce Message
Version: 7.x-1.0 » 7.x-1.x-dev
Component: PayPal WPS » Code
Status: Postponed (maintainer needs more info) » Active

Ok, let's start here then.

ardnet’s picture

Hmmm... OK, I managed to debug it further using watchdog by creating another token in custom module using similar code as the one that used in Message module by implementing hook_entity_property_info_alter(&$info), then I put this token in Mime Mail module so it will send the order summary to my own email address.

The code can be seen below:

function custom_entity_property_info_alter(&$info) {
  $info['commerce_order']['properties']['order_summary'] = array(
    'label' => t('Custom order summary'),
    'description' => t('Custom order summary.'),
    'getter callback' => 'custom_get_order_summary',
  );
}

function custom_get_order_summary($order, array $options, $name) {
  $view = views_get_view('commerce_cart_summary');
  $view->set_arguments(array($order->order_id));
  $view->hide_admin_links = TRUE;
  watchdog('custom', 'Order id: <pre>@result</pre>  <pre>@view</pre>', array('@result' => print_r($order->order_id, TRUE), '@view' => print_r($view->preview(), TRUE)), WATCHDOG_DEBUG);

  return $view->preview();
}

And I checked in watchdog from Commerce PayPal and also from my custom module, I compared all the results between those 2 cases (the one that WITH http authentication, and the one that WITHOUT http authentication), I got something below:

The one that WITH http auth

Results from my costume module

- Location: http://www.something.com/checkout/128/payment
- Referrer: http://www.something.com/checkout/128/review
- Message:

    Order id:
128
<div class="view view-commerce-cart-summary view-id-commerce_cart_summary view-display-id-default view-dom-id-47f330991251dd1811aec4231ea84e36">
        
  
  
      <div class="view-content">
      <table class="views-table cols-5"  class="views-table cols-5">
    <thead>
    <tr>
              <th >
                  </th>
              <th class="views-field views-field-line-item-title" >
          Product        </th>
              <th class="views-field views-field-commerce-unit-price" >
          Price        </th>
              <th class="views-field views-field-quantity" >
          Quantity        </th>
              <th class="views-field views-field-commerce-total views-align-right" >
          Total        </th>
          </tr>
  </thead>
  <tbody>
          <tr class="odd views-row-first views-row-last" >
                  <td >
            
  <div class="field field-name-field-images field-type-image field-label-hidden">
    <img src="http://www.something.com/sites/something/files/styles/thumbnail/public/flowerpetal.jpg" width="100" height="100" alt="" />  </div>
          </td>
                  <td class="views-field views-field-line-item-title" >
            Item Code NVR0005          </td>
                  <td class="views-field views-field-commerce-unit-price price" >
            S$16.90          </td>
                  <td class="views-field views-field-quantity" >
            1          </td>
                  <td class="views-field views-field-commerce-total views-align-right price" >
            S$16.90          </td>
              </tr>
      </tbody>
</table>
    </div>
  
  
  
  
      <div class="view-footer">
      <div class="commerce-order-handler-area-order-total"><div class="field field-name-commerce-order-total field-type-commerce-price field-label-hidden"><div class="field-items"><div class="field-item even"><table class="commerce-price-formatted-components">
<tbody>
 <tr class="component-type-base-price odd"><td class="component-title">Subtotal</td><td class="component-total">S$16.90</td> </tr>
 <tr class="component-type-flat-rate-standard-shipping even"><td class="component-title">Shipping fee for order $80 and below</td><td class="component-total">S$2.00</td> </tr>
 <tr class="component-type-commerce-price-formatted-amount odd"><td class="component-title">Order total</td><td class="component-total">S$18.90</td> </tr>
</tbody>
</table>
</div></div></div></div>    </div>
  
  
</div>
  

Results from Commerce PayPal

*none*

The one that WITHOUT http auth

Results from my costume module

- Location: http://www.something.com/commerce_paypal/ipn/paypal_wps%7Ccommerce_payme...
- Referrer: *none*
- Message:

Order id:
129
<div class="view view-commerce-cart-summary view-id-commerce_cart_summary view-display-id-default view-dom-id-d128f7b7b090d038d55360b61ad7191f">
        
  
  
  
  
  
  
  
  
</div>

Results from Commerce PayPal

- Location: http://www.something.com/commerce_paypal/ipn/paypal_wps%7Ccommerce_payme...
- Referrer: *none*
- Message:

IPN validated for Order 129 with ID 56T74828VF021190X.
Array
(
    [mc_gross] => 51.80
    [invoice] => 129-1358373257
    [protection_eligibility] => Ineligible
    [item_number1] => 
    [payer_id] => MV4AVR8NJGVUC
    [tax] => 0.00
    [payment_date] => 13:47:19 Jan 16, 2013 PST
    [option_selection1_1] => 2
    [payment_status] => Pending
    [charset] => windows-1252
    [mc_shipping] => 0.00
    [mc_handling] => 0.00
    [first_name] => Ardi
    [notify_version] => 3.7
    [custom] => 
    [payer_status] => unverified
    [business] => something_1357926102_biz@gmail.com
    [num_cart_items] => 1
    [mc_handling1] => 0.00
    [verify_sign] => AI7Z66xwiyrzO.qnff89lvSfTrGLAWuUoyth63jNIS.QyMnQxq2A1t8-
    [payer_email] => something@gmail.com
    [mc_shipping1] => 0.00
    [tax1] => 0.00
    [option_name1_1] => Product count
    [txn_id] => 56T74828VF021190X
    [payment_type] => instant
    [last_name] => Test
    [item_name1] => Order 129 at SOMETHING
    [receiver_email] => something_1357926102_biz@gmail.com
    [quantity1] => 1
    [receiver_id] => 76JSF23QCZ9FY
    [pending_reason] => multi_currency
    [txn_type] => cart
    [mc_gross_1] => 51.80
    [mc_currency] => SGD
    [residence_country] => US
    [test_ipn] => 1
    [receipt_id] => 3505-9389-9157-2244
    [transaction_subject] => Shopping CartOrder 129 at SOMETHING
    [payment_gross] => 
    [ipn_track_id] => 6d8985d516749
    [order_id] => 129
)

As you can see from results above, for the one that WITHOUT using http auth, the display of the Views is not rendered/shown all, and there's watchdog shows up from Commerce PayPal. Where as for the other case is shown otherwise.

The one that I'm still not quite understand is the watchdog that comes from Commerce PayPal, it is always goes to: http://www.something.com/commerce_paypal/ipn/paypal_wps%7Ccommerce_payme...

Does this means something to you, Ryan (rszrama)? or anybody can help me with this perhaps?
Some hints or clue would be greatly appreciated.

Many thanks

ardnet’s picture

I'm still stuck with this :-/
Anybody can help me with this please?
Thanks in advance

ardnet’s picture

Nevermind about this, the issue still persist actually.
But I finally not using Views anymore, I just rendered everything what ever comes from the $order object, at least that's the solution for me so far.
Thanks

Anonymous’s picture

any progress on the solution to render !order-summary ?

summit’s picture

Hi, would love to see a solution for this also to be able to render the token !order-summary anywhere using commerce_message.
greetings, Martijn