Hi,
I posted a topic a few minutes ago, but have just removed it, as it was inaccurate.
In case anyone has read the topic, this is the actual situation and what I want to achieve.
I have found the solution to what I need to do, but when trying to implement it, it isn't working out. I've been going at this problem for over 12 hours straight.
I have created 2 CCK fields with wholesale prices. I wish to hide these prices when users are not logged in by using a custom module. I also wish to display a helper text with the prices, when users are logged in.
Here is the code I have tried:
<?php
function uc_product_nodeapi(&$node, $op, $arg3, $arg4){
global $user;
switch ($op){
case 'view':
$node->field_wholesale_price_single[0]['view'] = $node->field_wholesale_price_single[0]['view'] && $user->uid;
$node->content['field_wholesale_price_multiple']['#weight'] = $node->content['field_wholesale_price_multiple']['#weight'] && $user->uid;
break;
}
}
?>I can enable this module, but it is not having any effect.
I have also customised my product display page with the file: node-product-tpl.php, with the code:
<div id="product_title"><h2><?php print $title ?></h2></div>
<div id="product_image"><?php print $node->picture ?> <?php print $node->content['image']['#value'] ?></div>
<div id="product_code">Code: <?php print $node->field_code[0]['view']; ?></div>
<div id="product_brand"><p>Brand: <?php print $node->taxonomy[16]->name; ?></p></div>
<div id="product_manufacturer"><p>Manufactured In: <?php print $node->field_manufactured_in[0]['view']; ?></p></div>
<div id="product_description"><?php print $node->content['body']['#value']; ?></div>
<div id="product_image_info">Click Image to Enlarge</div>
<div id="product_pdf"><?php print $node->content['files']['#value']; ?></div>
<div id="product_price">(Effective 01/08/2008. May be subject to change without notice. Price shown excludes GST)<?php print $node->content['field_wholesale_price_single']['#value']; ?> <?php print $node->content['field_wholesale_price_multiple']['#value']; ?></div>Can anyone help?
Thanks.




Joined: 05/03/2008