Drupal / Ubercart ... node style?

I am trying to create a product presentation on a Drupal website, but I am having problems. I can not find where the node (product) view is integrated in ubercart!

I am using UC 5.x-1.7 and I need to create a node (product) view page. At the moment, in my node.tpl.php file, I have

print $ body;
that spits out all SKUs, attributes, price, image, etc.

The problem is that I need to have this in a different style - I have to work on the design made by the designer. I started repeating my own version using type variables

$ node-> content ['body'] ['# value']
etc.

I am having trouble trying to work with various attributes for a product. I cannot find out how to get them on my page, or any documentation on how to work with them from the point of view of the encoder.

Is there an easier way? Where would I look for the style of an existing display (i.e. the $ body variable)?

Edit: my theme is based on the Zen theme

+3
source share
4 answers

You need to look at the templates that will be under such a path as:

./sites/all/modules/ubercart/uc_product/views

This will be the beginning. That node is probably built.

+2
source

If the problem is purely stylish, you can write your own CSS for that.

theamer module, , , , , ubercart, .

, hook_nodeapi op = view , $body.

+4

Devel, , $ node. node -product.tpl.php $content . .

, , , , div. id = "attributes" (, , ) div , class= ". template.php.

CSS, , div.

.

CSS, , , CSS .

Hope this is helpful. I'm not sure that all this will work in Drupal 5, since I did all this with 6 ... so I hope.

+1
source

Here is an example using hook_nodeapi mentioned by Jeremy Franz:

/**
 * Implements hook_nodeapi().
 */
function YOUR_MODULE_nodeapi(&$node, $op, $arg3 = NULL, $arg4 = NULL) {
  switch ($op) {
    case 'view':
    // Don't show list price unless set.
    if (isset($node->content['list_price']) && $node->list_price == 0) {
      unset($node->content['list_price']);
    }
    break;
  }
}

Look at uc_product_view () in the / ubercart / uc _product / uc_product.module modules to see the various content fields.

+1
source

Source: https://habr.com/ru/post/1709375/


All Articles