Attributes - Assistance Please - ISSUE SOLVED

Posts: 17
Joined: 01/13/2008

HI,

Presently, I am using the following code to only display the uc_lead_pane if "GROUP" is found in the title. I have customized this pane for the ability to include a team roster. However I have recently modified how my products are listed and now I want this code to look in the model field (which is customized based on the selected attributes). How I could I have it look at the model rather than the title? I tried $item->model, but that doesn't do anything. Thanks.

$showRoster = false;
$items = uc_cart_get_contents();
foreach ($items as $item) {
if( strpos(strtoupper($item->title), 'GROUP') !== false ){
$showRoster = true;
}
}

if( $showRoster ){
return $panes;

}
}

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

$item->model really ought to work. Try drupal_set_message($item->model) to see what you're really getting. It sounds like it's not what you expect.

Posts: 17
Joined: 01/13/2008

I tried the drupal_set_message and I realized that the model it was reference, due to custom attributes wasn't what I thought it was, therefore the filter words I had setup in the code weren't being found due to them not being there. Anyways I resolved this issue. Here is a sample of how I modified the code in uc_leads to display a specific pane based on words in the title and model.

if( strpos(strtoupper($item->model), 'GROUP') !== false ){
$showRoster = false;
$showRoster3 = true;
}
if( strpos(strtoupper($item->title), 'SHOOT OUT') !== false ){
$showRoster = true;
$showRoster3 = false;
}
}

if( $showRoster ){
--- Action Here ---
}

if( $showRoster3 ){
--- Action Here ---
}