I am using Drupal 6, Ubercart 2.7, and Views 2.16 for an e-commerce site.

Using Views with the Bonus: Views Export module, I am producing an atom feed for Google Shopping. This works perfectly.

I am trying to produce a second feed for a different currency, and for my purposes, it is OK to simply multiply the sell price by 1.1 and add the currency code onto the end of the value. However, I've hit a brick wall. I've tried the following options:


I tried creating a template file for that specific field (views-view-field--google-shopping-export--page-2--sell-price.tpl.php - lol). To get this working I had to change Field Output type to "Raw" for the feed, which caused all sorts of other problems. If Field Output was set to "Normal", the template was ignored.

Dynamic Fields

I tried using the Dynamic Field and Computed Field modules, but I couldn't get either of these working - both fields were empty within the feed when I tried to pull $node->field_sell_price in any way. This makes me think that I wasn't referring to the value properly, but I tried many, many combinations - $node->field_sell_price, $node->field_sell_price[0]['value'], $node->sell_price, $node->sell_price[0]['value'] etc. I was able to pull in $node->nid and $node->type, but nothing else worked.

Are there any other options to do this? Or have I missed something obvious in the solutions above? I feel like I'm making this much more complicated than it needs to be!

Thanks for any help.


Resolved this by writing my own module implementing hook_views_pre_render and manually changing $view->result.

|improve this answer|||||

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.