Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2012
    Location
    South West UK
    Posts
    17
    Plugin Contributions
    0

    help question Adding view-only flags to frontend (fair trade / recycled / etc)

    Hi guys

    I need to assign graphical flags for each product to show info. This needs to be added in the product's admin and viewed as an image on the front end.

    For example when a product is Fair Trade, a small logo will be shown on the item telling the user so. This should not be a front end selectable option - just an image for information purposes only. Ideally 'Fair Trade' would be selected as a checkbox or similar from the admin.

    I'm sure this is possible without a hack using custom attributes but I can't work it out!

    Any ideas you lovely people?

    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    I suppose this is possible using attributes - making them "display only" and adding a "swatch" to the relevant attribute, where that "swatch" is the kitemark.

    However... as attributes are considered to be "selectable" components in a given product, the overall functionality of the attributes module will also be present in the display. You could probably "disable" the display of these characteristics (such as the associated radio-button selectors) using css declarations such as {display:none}.

    Glenn Herbert is the one to ask for help in this regard...
    19 years a Zencart User

  3. #3
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    Perhaps I misunderstand the issue, but ... You could add (in Photoshop or whatever you use) your small graphical flag to the main product image, so it's always there. Or you can add the small graphical flag as an additional image for each product that needs it. Is that too simple? Or does it not satisfy the need?

    Rob

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

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    A "read-only" attribute might be the simplest way to get what you want here. How well it will work for you depends on whether you use attributes for their usual function; if not, you can move the attribute display code block so that the flags appear near the top or wherever you want them.

    If you want the flags to appear in the product listing as well as the product info page, you will most likely need a new database field and custom coding to store and then retrieve and display the info in appropriate places.

    ...Or an addition to the main product image as Rob suggests.

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    On THIS SITE, we actually embed the additional graphics in the product description HTML.

    We built a simple "HTML page compiler" for the client that is external to zencart and the client just builds each product info page, making appriopriate selections for the relevant graphics. The source code (html) is then copied into the product description field in the ADD/EDIT product screen (or onto a spreadsheet if there are lots of new products, that are then imported via Apsona ShopAdmin).

    This was easier (and cheaper) than building the functionality into zencart's collect_info systems.
    19 years a Zencart User

  6. #6
    Join Date
    Jan 2012
    Location
    South West UK
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    Absolutely awesome stuff guys, all very relevant, clear and concise. I love this place!

    I really like the last one @schoolboy - its exactly what I was after looks wise - lovely - but I'm unsure as to how she will work with that. Bloody good idea though I'm going to bear that in mind!

    @rstevenson: Addition to product image kinda got ruled out a while back as my client isn't really Photoshop-savvy, meaning she would have to come back to me every time.

    @gjh42: As for read-only attributes thats more what I was getting at.

    Also @gjh42: I have been toying with adding extra fields as I need to get a few in from my client's old [and poor] system (via the excellent Apsona of course) which only allows Google Base export, no db access unless she forks out £175!!

    I found a good tut here, I suppose once I've achieved this I can work out just how hard it would be to tweak this to suit.

    The thing is, being my first Zen Cart project (definitely not my last!), I am yet to try the custom attributes at all, so didn't know my options too well. I'm only so-so with PHP but do have a grasp of it...so its time to get my hands dirty!

    You guys have been awesome, I cannot thank you enough - long live Zen Cart and its amazing community!
    Last edited by johnlewisdesign; 3 Apr 2012 at 09:35 PM.

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    Glad to be of assistance... we wish you all the best in your zencart venture(s)...

    If your client needs these kitemarks quickly, then Rob Stevenson's suggestion is perhaps the quickest fix (add them to the products' main images).

    Keep copies of the ORIGINAL images, so that when you are in a postion to provide an easy-to-use coded system, you can simply overwrite the kite-mark-embedded images, with their originals.
    19 years a Zencart User

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    Quote Originally Posted by johnlewisdesign View Post
    Also @gjh42: I have been toying with adding extra fields as I need to get a few in from my client's old [and poor] system (via the excellent Apsona of course) which only allows Google Base export, no db access unless she forks out £175!!
    You could try the Product Extra Fields add-on. Your customer could use the "Extra Text Field" to enter HTML that can be styled to display the various "flags".

  9. #9
    Join Date
    Jan 2012
    Location
    South West UK
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding view-only flags to frontend (fair trade / recycled / etc)

    Quote Originally Posted by schoolboy View Post
    Glad to be of assistance... we wish you all the best in your zencart venture(s)...
    Almost done! Thanks also lat9 but I went for the intense option as found here at the cornerpiece blog and here courtesy of crazy_chris - it works great!

    One thing I can't sort out though - I have text fields atm saying Organic: and Fair Trade: where you add a 1 or 0 in the admin field to trigger each icon.

    I need these to be radio buttons not text fields. How do I grab the values of these? My current code [in admin/includes/modules/product/collect_info.php]:

    PHP Code:
      'products_fairtrade' => '',
    'products_organic' => ''

    and

    PHP Code:
    <tr>
    <td class="main"><?php echo 'Fairtrade '?></td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif''24''13') . '&nbsp;' 
    zen_draw_input_field('products_fairtrade'$pInfo->products_fairtradezen_set_field_length(TABLE_PRODUCTS_EXTRA_STUFF'products_fairtrade')); ?></td>
    </tr>

    <tr>
    <td class="main"><?php echo 'Organic '?></td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif''24''13') . '&nbsp;' 
    zen_draw_input_field('products_organic'$pInfo->products_organiczen_set_field_length(TABLE_PRODUCTS_EXTRA_STUFF'products_organic')); ?></td>
    </tr>
    Here's what I'm thinking:

    PHP Code:
      'products_fairtrade' '0'
    PHP Code:
     ##'products_organic' > '0', 
    and

    PHP Code:
    <tr>
    <td colspan="2"><?php echo zen_draw_checkbox_field('products_fairtrade'' id="products_fairtrade"') . "Fair Trade"?><br /></td>
    <td colspan="2"><?php echo zen_draw_checkbox_field('products_organic'' id="products_organic"') . "Organic"?><br /></td>
    </tr>

    But how do I save these values to my custom tables located at pdex.products_fairtrade and pdex.products_organic? I'm sure I'm missing something quite important!

    Thanks,

    John
    Last edited by johnlewisdesign; 17 Apr 2012 at 03:07 PM. Reason: idiot check

 

 

Similar Threads

  1. Adding a link on my shop to advertise a craft fair
    By Soul39 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 31 Oct 2011, 03:00 PM
  2. Using special characters with encoding like &trade; etc
    By jettrue in forum General Questions
    Replies: 14
    Last Post: 9 Aug 2011, 07:24 PM
  3. only trade customers see/select trade prices
    By newbie_veesmith in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 19 Apr 2010, 11:23 AM
  4. Display only a dropdown list in frontend
    By hugoxbz in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 Jan 2008, 06:58 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