I'm having trouble using this module with tokens. I tried using this code

$item->price = $item->price;
$item->price = [cost] * 1.1;

But i get the follwing error.

Parse error: syntax error, unexpected '[' in /home/jadamsfx/public_html/nueera.com/sites/all/modules/uc_custom_price/uc_custom_price.module(87) : eval()'d code on line 1

Any ideas?

Comments

tr’s picture

Category: bug » support
Status: Active » Fixed

Token is part of core Drupal in Drupal 7, and the syntax for tokens has changed. The proper token for product cost is [node:cost] in Drupal 7.

jadamsfx’s picture

Hmm I'm still getting the same error when I change the custom price field to...

$item->price = $item->price;
$item->price = [product:cost] * 3;

I applied this patch here http://drupal.org/node/1165618

jadamsfx’s picture

Any Ideas?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jawi’s picture

Assigned: Unassigned » jawi
Status: Closed (fixed) » Active

Custom prices don't show up.

When used
$item->price = [cost] * 1.1;
This error shows up:

Parse error: syntax error, unexpected '[' in /home/idc/domains/~~~~/modules/uc_custom_price/uc_custom_price.module(87) : eval()'d code on line 3

HELP

tr’s picture

Assigned: jawi » Unassigned
Status: Active » Closed (fixed)

Already answered in #1