Hi,
I've created a store from a no demo commerce kickstart profile with a commerce_kickstart_theme sub-theme.
The first problem I've met was when I wanted to change the name of taxonomy term "Collection".
I used the helpful sja1 post to resolve it ! Creating a new module.
In this taxonomy term, which is renamed "kategoria" and which plays the same role of "Collection" taxonomy term, I've added the field_image.
This image is correctly displayed in the Taxonomy term page.
But no image in the Collection Products view although the views-view--collection-products--page.tpl.php exists in my sub-theme templates folder, with these lines :
<?php if ($header): ?>
<div class="view-header" <?php if (isset($kategoria_image_url) && !empty($kategoria_image_url)): print 'style="background-image: url(' . $kategoria_image_url . ');"'; endif; ?>>
<?php print $header; ?>
<div class="taxonomy-title" >
<?php print $kategoria_title; ?>
</div>
</div>
<?php endif; ?>I've replaced $collection_title with $kategoria_title because I've modified commerce_kickstart_taxonomy.module directly, for testing :
/**
* Implements hook_preprocess_views_view().
*
* Add collection term as view header.
*/
function commerce_kickstart_taxonomy_preprocess_views_view(&$vars) {
$view = $vars['view'];
if ($view->name == 'collection_products') {
if ($view->current_display == 'page') {
// Keep the previous theming.
$vars['classes_array'][] = 'view-collection-taxonomy-term';
$tid = $view->args['0'];
$term = taxonomy_term_load($tid);
$vars['kategoria_title'] = $term->name;
$vars['kategoria_image_url'] = NULL;
if (!empty($term->field_image) && !empty($term->field_image[LANGUAGE_NONE][0]['uri'])) {
$vars['kategoria_image_url'] = file_create_url($term->field_image[LANGUAGE_NONE][0]['uri']);
}
}
}
}
So... I don't understand... what's the good method ?
Thank you.
FO
Comments
Comment #1
rszrama commentedCommerce Kickstart 2.x is in minimal maintenance mode. Closing out all outdated tickets now to maintain focus on Commerce Kickstart 3.x.