Does anyone know of a way to write custom price calculations with attributes in Drupal 7? In drupal 6 there was the attribute token module, but there seems to be no token generation for uc_attributes in the D7 token list. In D6 i was able to use code like this to calculate a percentage of the base value when an option was selected:

$item->price = $item->price;
if('[Charger]' == 'Missing') {
$item->price *=.85;
}

I have a migration that is depending on something similar.

Any guidance would be appreciated.

Comments

smd_ksu’s picture

Similar issue here: http://drupal.org/node/1834178. No answer there as well.

donbon’s picture

Issue summary: View changes

Here is a howmuhammad.tanweer solved this over on the issue post that smd_ksu referenced:

https://www.drupal.org/node/1834178#comment-8398949