I'm using the latest ubercart version, with the aquia prosper theme. I noticed there is an extra tpl file for the products (node-product.tpl). Now my problem is i want to put additional fields in the general product information, instead of the additional product information. And also let some of those fields show in the teaser. Is this possible?

 <div id="product-details" class="clear">
          <div id="field-group">
            <?php print $fusion_uc_weight; ?>
            <?php print $fusion_uc_dimensions; ?>
            <?php print $fusion_uc_model; ?>
            <?php print $fusion_uc_list_price; ?>
            <?php print $fusion_uc_sell_price; ?>
            <?php print $fusion_uc_cost; ?>
          </div>

          <div id="price-group">
            <?php print $fusion_uc_display_price; ?>
            <?php print $fusion_uc_add_to_cart; ?>
          </div>
        </div><!-- /product-details -->

        <?php if ($fusion_uc_additional && !$teaser): ?>
        <div id="product-additional" class="product-additional">
          <?php print $fusion_uc_additional; ?>
        </div>
        <?php endif; ?>

Thx in advance Michael.

CommentFileSizeAuthor
#10 frontpage.png3.47 KBJSCSJSCS
#10 product.png33.8 KBJSCSJSCS
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jeremycaldwell’s picture

Yes you can do that. Just as working with a normal custom node.tpl.php for your content type, in this case it's the node-product.tpl.php. So this node loads for all product content types. You can add CCK fields to your product content type and then load them here in the TPL by printing the field. You can also edit your node-product.tpl.php to show certain fields for teasers and others for full product nodes.

<?php if ($teaser): ?>
DO THIS
<?php else: ?>
DO THAT
<?php endif; ?>

That bit of code says, if teaser DO THIS, if not a teaser DO THAT. So you can load your PHP code in either one of those and have it do what you ask it to there with loading certain fields in teasers and others in full product nodes or both.

stephthegeek’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

fehin’s picture

Even though uc_model is listed under product-details in the tpl file, SKU shows under product-additional. Is there a way to move this under product-details? Thanks.

fehin’s picture

Status: Closed (fixed) » Active
stephthegeek’s picture

Assigned: Unassigned » jeremycaldwell
jeremycaldwell’s picture

Assigned: jeremycaldwell » sociotech

Seems this variable is missing from Fusion Core.

$vars['fusion_uc_model'] = drupal_render($node->content['model']);

Once I added that to the Fusion Core template.php it worked as it should. Will need to review this to make sure this is the correct method.

CCSJ’s picture

Issue tags: +Ubercart, +cck fields, +Fusion, +templating

Hiya, had to bump this because I had a minor headache trying to figure out why $fusion_uc_model was not rendering in a custom .tpl.php.

I then discovered that fusion core -> template.php -> fusion_core_preprocess_node() was missing:

$vars['fusion_uc_model'] = drupal_render($node->content['model']);

(as the poster above also mentions)

So, this is still a problem and should be resolved?

(I've since been using '$node->model')

^_^

CCSJ’s picture

Hiya, had to bump this because I had a minor headache trying to figure out why $fusion_uc_model was not rendering in a custom .tpl.php.

I then discovered that fusion core -> template.php -> fusion_core_preprocess_node() was missing:

$vars['fusion_uc_model'] = drupal_render($node->content['model']);

(as the poster above also mentions)

So, this is still a problem and should be resolved?

(I've since been using '$node->model')

^_^

JSCSJSCS’s picture

FileSize
33.8 KB
3.47 KB

I added your line the the template.php page of fusion core and got the SKU:skunumber to show in the product view, but it does not show when the product (Ubercart Event) is promoted to the front page and I can't figure out why. The label "Price:" before the list price is also missing.

I was watching this tutorial: http://usecod.com/news/2011/cod-presentation-video-drupalcon-chicago
and it had the same display. You could see "Price:" when the presenter viewed the product page, but it was missing when he viewed the front page. (Notice the SKU:skunumber was also missing fron product page)

flashfasbo’s picture

Issue tags: +template.php, +model, +fusion_core_preprocess_node

Looks like Fusion 1.1 is still missing the line to properly render the sku:

$vars['fusion_uc_model'] = drupal_render($node->content['model']);

(within function fusion_core_preprocess_node() in fusion_core template.php file.

I'm using a customized version of the acquia prosper theme.

In what I hoped was a flash of genius, I tried overriding the fusion_core function in my custom theme's template.php file so I could use the 1.1 update, but I couldn't get it to work right. What I found was that I ended-up getting the sku output twice -- once where I wanted it, and again dumped at the bottom of the node. I assume from this line:

$vars['fusion_uc_additional'] = drupal_render($node->content); // Render remaining fields

But, this was my 1st attempt to override a theme function so maybe i'm doing something wrong.

In the end, I continue to use Fusion 1.0 with a hacked template.php file in fusion_core to add the above line. It works.

Stomper’s picture

Is there any way where I can use the Acquia Prosper theme only for the product content types, like say an Acquia Prosper lite version?

esmerel’s picture

Stomper, I think that needs to be in a separate issue; it's kind of related to the original question, but it's not (ultimately) the same problem/issue.

Stomper’s picture

@ #12/13

Okay, new issue created here http://drupal.org/node/1322530

apaderno’s picture

Assigned: sociotech » Unassigned
Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -template.php, -Ubercart, -cck fields, -Fusion, -templating, -model, -fusion_core_preprocess_node

I am closing this issue, since it is for a Drupal version that now is not supported.
Please re-open it if the issue is also relevant for other project branches that require a supported Drupal version