Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2011
    Location
    Washington, D.C.
    Posts
    80
    Plugin Contributions
    0

    Default Remove attribute text and only show images

    Hello;

    While I'm trying to upgrade my current cart from zc1.5 to 1.5.3, I'm also working a little on the design before the upgrade. I'm a little stuck as to how to get rid of the attribute text. I have set up several attributes that are features and those features have images. While the image displays just fine (a little CSS did the trick), the text value for feature shows under the image and looks fine. However, before the images, there is a list of features that also show up and I want to remove it. I'm attaching an image with the hopes that some can help me. I tried to hide the optionName in CSS but the values were still showing. Plus, I don't want to hide the option name because there are products with attributes that are not features. Is there a work around to this?

    Image attached. Click image for larger version. 

Name:	attributes.PNG 
Views:	154 
Size:	4.7 KB 
ID:	14404

    Link to the development site : http:// www. just-vibrators. com /zencart/ kinkykupid/ public_html/ index.php?main_page=product_info&cPath=160_298&products_id=18743

    Please note that this is a site that is created to sell adult novelty products. Please do not click it if you are easily offended.
    http://www.kinkykupid.com. WARNING: Please note that this site is intended to sell Adult Toys, Novelties and Costumes. Please do not click the link if you may find it offensive.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Remove attribute text and only show images

    If ALL READONLY Attributes should show the images but not the names below, you could customize the code with your templates and overrides for:
    /includes/modules/attributes.php

    and around line 482 change the code from:
    Code:
                            $tmp_attributes_image .= '<div  class="attribImg">' . zen_image(DIR_WS_IMAGES .  $products_options->fields['attributes_image']) .  (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' .  $products_options->fields['products_options_values_name'] : '') .  '</div>' . "\n";
    to have the code in RED:
    Code:
                          if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                            $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . '</div>' . "\n";
                          } else {
                            $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . '</div>' . "\n";
                          }
    
    and this will make ALL of the READONLY Attributes now show the Option Value Name below the images ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Feb 2011
    Location
    Washington, D.C.
    Posts
    80
    Plugin Contributions
    0

    Default Re: Remove attribute text and only show images

    Quote Originally Posted by Ajeh View Post
    If ALL READONLY Attributes should show the images but not the names below, you could customize the code with your templates and overrides for:
    /includes/modules/attributes.php

    and around line 482 change the code from:
    Code:
                            $tmp_attributes_image .= '<div  class="attribImg">' . zen_image(DIR_WS_IMAGES .  $products_options->fields['attributes_image']) .  (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' .  $products_options->fields['products_options_values_name'] : '') .  '</div>' . "\n";
    to have the code in RED:
    Code:
                          if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                            $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . '</div>' . "\n";
                          } else {
                            $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . '</div>' . "\n";
                          }
    
    and this will make ALL of the READONLY Attributes now show the Option Value Name below the images ...
    Thank you Ajeh. I tried that and the products page is now not parsing at all. I have this error in the error log:

    [22-Aug-2014 14:02:16 America/Chicago] PHP Parse error: syntax error, unexpected $end in /home/xxxx/xxxxxx/xxxxxx/xxxxxx/public_html/includes/modules/custom_template/attributes.php on line 614

    This is the change in the attributes.php file near line 482:
    Code:
     if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                            $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . '</div>' . "\n";
                          } else {
                          $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . '</div>' . "\n";
                        }
    Can you please advise as to what I should do?
    http://www.kinkykupid.com. WARNING: Please note that this site is intended to sell Adult Toys, Novelties and Costumes. Please do not click the link if you may find it offensive.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Remove attribute text and only show images

    Quote Originally Posted by kman55 View Post
    Thank you Ajeh. I tried that and the products page is now not parsing at all. I have this error in the error log:

    [22-Aug-2014 14:02:16 America/Chicago] PHP Parse error: syntax error, unexpected $end in /home/xxxx/xxxxxx/xxxxxx/xxxxxx/public_html/includes/modules/custom_template/attributes.php on line 614

    This is the change in the attributes.php file near line 482:
    Code:
     if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                            $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . '</div>' . "\n";
                          } else {
                          $tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . '</div>' . "\n";
                        }
    Can you please advise as to what I should do?
    The code in that section looks correctly started and finished, but basically what has happened at least based on coming across a similar issue in the past is that there is a mismatch in the number of opening and closing curly parenthese{}. Might suggest restoring the previous copy and making that edit again. May also be that the file(s) did not fully upload.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2011
    Location
    Washington, D.C.
    Posts
    80
    Plugin Contributions
    0

    Default Re: Remove attribute text and only show images

    Thank you for your reply. I reviewed the file and did file 2 instances where the curly brackets were not closed. Upon closing them, the page is parsing however, the images and description of the readonly attribute is now showing up in incremental rows. I'm attaching an image to show what is going on...

    Click image for larger version. 

Name:	Capture.PNG 
Views:	55 
Size:	9.3 KB 
ID:	14458

  6. #6
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Remove attribute text and only show images

    Quote Originally Posted by kman55 View Post
    Thank you for your reply. I reviewed the file and did file 2 instances where the curly brackets were not closed. Upon closing them, the page is parsing however, the images and description of the readonly attribute is now showing up in incremental rows. I'm attaching an image to show what is going on...

    Click image for larger version. 

Name:	Capture.PNG 
Views:	55 
Size:	9.3 KB 
ID:	14458
    I'm wondering if the missing curl brackets were replaced in the incorrect location, as it appears that the result is incorrect for two things: 1) I thought the changes was supposed to put the names below the image, not beside it, and 2) that the images appear to be looped to build the total number and displayed at each loop. If the brackets are in the correct location, I might say to only assign the final value once the loop has reached the total number of attributes, but that is a separate discussion to some extent. Ajeh, is usually pretty good about identifying whether code is untested or not/if caution should be used when applying it. As that type information is not included and that the code of your site required some sort of correction (adding brackets) that leads me to think that there is still something wrong with the code not added above.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Remove attribute text and only show images

    Crudely and simply, you could remove the option name with CSS, but not do it globally, do it independently on the pages you want it removed, e.g, just add this to the item description.

    <style type="text/css">

    .h4.optionName, #h4.optionName {display:none;}

    </style>

    I love using inline CSS like this, can turn off side-menus, boxes, headers, any element at will on any specific product page. Great and easy for custom pages.
    Last edited by dgent; 27 Aug 2014 at 09:42 AM.

 

 

Similar Threads

  1. how to remove visa mc verified images and enrollement text?
    By gsdcypher in forum PayPal Website Payments Pro support
    Replies: 14
    Last Post: 19 Dec 2011, 11:30 PM
  2. Replies: 8
    Last Post: 7 Jun 2011, 07:57 PM
  3. Remove Underline under images and text
    By bromleysid in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 May 2010, 01:01 PM
  4. can I Remove the HTML & TEXT-Only options and Radio Buttons ?
    By jdunique in forum General Questions
    Replies: 6
    Last Post: 29 Apr 2008, 02:26 PM
  5. category page- make images bigger and show less text
    By thepixellator in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 6 Dec 2007, 05:54 AM

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