Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Display attribute under product name

Display attribute under product name

Views: 661

Results 1 to 1 of 1
22 Jul 2014, 11:17 AM
#1
dannyvarley avatar

dannyvarley

Zen Follower

Join Date:
Dec 2011
Posts:
287
Plugin Contributions:
0

Display attribute under product name

Hi There,
I have a box that shows products in the basket on all the pages. The thing I want to include is so it will show the attribute selected too as you see from this picture.

Attachment 14324

I believe the code is this:

<li class="cartContainer">                              
                  <div>
                    <?php                    
                      if ($_SESSION['cart']->count_contents() != 0) { ?>
                        <div class="items"><strong>Cart:</strong> <?php echo $_SESSION['cart']->count_contents(); ?> <?php echo HEADER_CART_ITEMS; ?></div>
                        <div class="productWrapper">
                          <div class="productWrapperInner">
                            <div class="products">
                              <?php
                                $productsArray = $_SESSION['cart']->get_products();
                                $products = "";
                                foreach ($productsArray as $product) {

                                  $productImage = (IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $product['image'], $product['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) : '');
                                  $linkProductName = zen_href_link(zen_get_info_page($product['id']), 'products_id=' . $product['id']);  
                                  $linkProductDelete = zen_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&product_id=' . $product['id']);

                                  $products.= '
                                    <ul class="product">
                                      <li class="img"><a href="'.$linkProductName.'">'. $productImage .'</a></li>
                                      <li class="name"><strong>'. $product['quantity'] .''. BOX_SHOPPING_CART_DIVIDER .'</strong> <a href="'.$linkProductName.'">'. $product['name'] . [B]THINK THE CODE SHOULD GO HERE'[/B]</a></li>
                                      <li class="amount">'. $currencies->format($product['final_price']) .'</li>                                  
                                      <li class="delete"><a href="'.$linkProductDelete.'">delete</a></li>
                                    </ul>    
                                  ';
                                } 

                                echo $products; 
                              ?>
                            </div>
                            <p><strong> <?php echo HEADER_CART_SUBTOTAL .''. $currencies->format($_SESSION['cart']->show_total()); ?></strong></p>
                            <ul class="optionsWrapper group">
                              <li><a class="btn btn_2" href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
                              <li><a class="btn" href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
                            </ul>
                          </div>                      
                        </div>
                    <?php }else{ ?>
                        <div class="items empty"><strong>Cart:</strong> <?php echo $_SESSION['cart']->count_contents(); ?> <?php echo HEADER_CART_ITEMS; ?></div>                      
                    <?php } ?>
                  </div>


               </li>

I have marked where i think the code should go, but I don't know what the code would be!?

Help would be awesome,

Thanks,
Daniel