Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Jan 2005
    Location
    NY
    Posts
    149
    Plugin Contributions
    0

    Default Display Read Only attribute in cart

    I have a site where certain items need to have a note saying "Final Sale. This item cannot be returned."

    This text needs to be visible not only on the product info page, but in the shopping cart and on the invoice. I thought the easiest way to handle this would be to create a "final sale" attribute.

    Using the read only attribute, the text appears in the product info, but not in the attributes list when the item is added to the cart.

    Does anyone know if it's possible to display it here?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Display Read Only attribute in cart

    Make it normal - required - selected
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2005
    Location
    NY
    Posts
    149
    Plugin Contributions
    0

    Default Re: Display Read Only attribute in cart

    Quote Originally Posted by kobra View Post
    Make it normal - required - selected
    I tried that and it displays on the product info page, but I am still not seeing this attribute in the shopping cart.

    I think it has something to do with the commented out code on the attributes module. Line 495 of attributes.php.
    PHP Code:
    // Read Only - just for display purposes
                          
    if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                            
    //            $tmp_html .= '<input type="hidden" name ="id[' . $products_options_names->fields['products_options_id'] . ']"' . '" value="' . stripslashes($products_options->fields['products_options_values_name']) . ' SELECTED' . '" />  ' . $products_options->fields['products_options_values_name'];
                            
    $tmp_html .= $products_options_details '<br />';
                          } else {
                            
    $zv_display_select_option ++;
                          } 
    I tried playing around with this a little, but didn't get anywhere. Anything I touch on this line seems to cause problems with the display of the remaining attributes in the shopping cart, and causes the product image to disappear.

    Do you have any other suggestions?

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Display Read Only attribute in cart

    I think it has something to do with the commented out code on the attributes module.
    File path & file name?
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jan 2005
    Location
    NY
    Posts
    149
    Plugin Contributions
    0

    Default Re: Display Read Only attribute in cart

    Quote Originally Posted by kobra View Post
    File path & file name?
    includes/modules/attributes.php

    It's actually line 486 in the default file. My attributes module did have other modifications, but reverting back to the default did not solve my problem.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Display Read Only attribute in cart

    If you make it a radiobutton type, default selected, it can't be unselected and will display in the cart. It would be possible to hide the select circle with CSS so that it would appear as straight text in the info page.

  7. #7
    Join Date
    Apr 2011
    Posts
    38
    Plugin Contributions
    0

    Default Re: Display Read Only attribute in cart

    I'm re-opening this thread because I'm still curious about this issue...so do the read-only attributes not show up in the cart?

    Quote Originally Posted by kobra View Post
    Make it normal - required - selected
    ^What does this mean? Make normal - required- is that still valid?

    TH

  8. #8
    Join Date
    Apr 2011
    Posts
    38
    Plugin Contributions
    0

    Default Re: Display Read Only attribute in cart

    NVM I figured out the required setting (I think) this however does not affect "read-only" attributes.

    Quote Originally Posted by gjh42 View Post
    If you make it a radiobutton type, default selected, it can't be unselected and will display in the cart. It would be possible to hide the select circle with CSS so that it would appear as straight text in the info page.
    ^
    There has to be a better work around out there then to set an attribute to radio button and hide the button? Your product info page would still prompt the user to "please select" (or whatever your TEXT_PRODUCT_OPTIONS is defined as) and this could potentially confuse the user if there really is no selection option (as in a display only)

    Here's my situation, maybe someone would be able to shine some light on it?
    So I want to use the attributes as a tracking system (skew number). Yeah I could use the Model: as an SKU system but when I have more than one option for a product (ex. quantity) I have different SKUs for the different product options. I want to "pass" the SKUs on to my fulfillment company so I need the attribute to show up in the order (and in the order email). So as of what I know so far the "Read-Only" name option is out. The radio button-> default set is a decent work-around for single products, but I would imagine someone would be able to figure out a more optimal way? I have started looking at the tpl_modules_attributes.php file but I need to dig a little deeper it seems...looks like I should be going after the $zv_display_select_option variable or $options variable...does anyone know where to find these?

    Any suggestions Anyone?

  9. #9
    Join Date
    Apr 2011
    Posts
    38
    Plugin Contributions
    0

    Default Re: Display Read Only attribute in cart

    Quote Originally Posted by tthenne View Post
    looks like I should be going after the $zv_display_select_option variable or $options variable...does anyone know where to find these?
    I found them...attributes.php in module directory

    At least that's not a big file....

  10. #10
    Join Date
    Apr 2011
    Posts
    38
    Plugin Contributions
    0

    Default Re: Display Read Only attribute in cart

    So I'm in my tpl_shopping_cart_default.php and I want to display the "read-only" attributes which up until now I have not got them to display.

    Okay some of you big php gurus out there...walk me through this chunk of code so I can take a look at the attributes.php next

    tpl_shopping_cart_default.php line: 89
    Code:
    <?php
      echo $product['attributeHiddenField'];
      if (isset($product['attributes']) && is_array($product['attributes'])) {
      echo '<div class="cartAttribsList">';
      echo '<ul>';
        reset($product['attributes']);
        foreach ($product['attributes'] as $option => $value) {
    ?>
    
    <li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>
    
    <?php
        }
      echo '</ul>';
      echo '</div>';
      }
    ?>
    So I am understanding...the $product valuable is a big array, and the $product['attributeHiddenField'] looks like it is our product id (going to be sent on in the form), and then we have our conditional...if the attributes field is set and $products['attributes'] is an array echo our divs. Then we reset the $products['attributes'] so we're going to the first value of the $products['attributes'] array and we are setting our keys to $value array. Then we are echoing out the product_options_name (ex. quantity) and then we have our divider and then and then a br / and our products_options_values_name (ex. 100 count)

    So the question arises...why wouldn't it echo out a "read-only" product attribute???
    Last edited by tthenne; 20 Apr 2011 at 05:18 AM.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v151 Something like the read only attribute that will display in the cart
    By DannyVarley in forum General Questions
    Replies: 0
    Last Post: 31 May 2013, 04:19 PM
  2. Hiding READ ONLY attribute
    By Endre in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 26 Oct 2009, 11:17 PM
  3. read only attribute
    By bmpt in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 19 Apr 2009, 10:52 PM
  4. Read Only Attribute
    By beowulf1066 in forum General Questions
    Replies: 3
    Last Post: 1 Mar 2007, 01:52 AM
  5. read only attribute value size too small/ import html in read only attribute value
    By nazzaw in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 22 Jan 2007, 03:49 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR