Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2011
    Posts
    287
    Plugin Contributions
    0

    Default Adding product attribute

    Hi There,

    I am currently setting up a new site with a new template, at the top of the template is a pop out cart, The only pproblem with this is that it currently does not show to attributes,

    I am hoping there is a simply bit of code that I can drop in the will show the product attribute in the basket.

    Is there such a code of something like

    $product['OptionValue']


    Many thanks,
    Daniel

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,971
    Plugin Contributions
    96

    Default Re: Adding product attribute

    Where did you get the template? I'd suggest that you pose your question in the support-thread for the template (if it's available as a Zen Cart download) or contact the template author if the template is a commercial one.

  3. #3
    Join Date
    Dec 2011
    Posts
    287
    Plugin Contributions
    0

    Default Re: Adding product attribute

    The more I think about this, I doubt there would be such an easy piece of code as a product may have more than one attribute so it makes it a little more Tailored.

    I suppose what I need to ty and do is take the code from the shopping card and adapt it?

    Daniel

  4. #4
    Join Date
    Dec 2011
    Posts
    287
    Plugin Contributions
    0

    Default Re: Adding product attribute

    Yup, Gunna post on the template authors page, I just thought there may be a really easy snippet of code I can add

    Many thanks,
    Daniel

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,971
    Plugin Contributions
    96

    Default Re: Adding product attribute

    Quote Originally Posted by DannyVarley View Post
    The more I think about this, I doubt there would be such an easy piece of code as a product may have more than one attribute so it makes it a little more Tailored.

    I suppose what I need to ty and do is take the code from the shopping card and adapt it?

    Daniel
    Actually looking at the built-in shopping-cart handling, the shopping_cart sidebox (which I'm "assuming" your cart-in-header is based on) displays only the product names (not the attributes list).

  6. #6
    Join Date
    Dec 2011
    Posts
    287
    Plugin Contributions
    0

    Default Re: Adding product attribute

    Its the following:

    PHP Code:
     <div class="products">
                                  <?php
                                    $productsArray 
    $_SESSION['cart']->get_products();
                                    
    $products "";
                                    foreach (
    $productsArray as $product) {

                                      
    $productImage = (IMAGE_SHOPPING_CART_STATUS == zen_image(DIR_WS_IMAGES $product['image'], $product['name'], SMALL_IMAGE_WIDTHSMALL_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'] .'</a></li>
                                          <li class="amount">'
    $currencies->format($product['final_price']) .'</li>
                                          <li class="delete"><a href="'
    .$linkProductDelete.'">delete</a></li>
                                        </ul>    
                                      '
    ;
                                    } 

                                    echo 
    $products
                                  
    ?>
                                </div>
    I was hoping to have a look at the actual shopping cart as this displays the attributes for each added product

 

 

Similar Threads

  1. Attribute Discount for adding on product?
    By paperthreads in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 13 Feb 2008, 10:13 PM
  2. adding new product attribute field to admin
    By poosk in forum Customization from the Admin
    Replies: 0
    Last Post: 2 Jan 2008, 09:06 PM
  3. Adding Attribute to product Problem after upgrade
    By Darkmuncan in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 19 Nov 2007, 05:30 PM
  4. Adding a promo product/attribute discounts
    By Kamino84 in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 3 Dec 2006, 04:24 PM
  5. Error Adding ReadOnly Attribute to Product
    By MaryK in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 19 Jun 2006, 05:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg