Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2012
    Posts
    15
    Plugin Contributions
    0

    Default Different template for restricted products?

    I'm setting up my first Zencart for a catering suppliers. The general product type works fine for everything they sell.
    They sell knives which are for over 18s only. What I want to do is every time the store owner adds a knife to the catalogue it automatically displays with an age restriction warning.

    I figured the best way to do this was with a duplicate product type of Product General - the only change being it uses a different template.

    However, I've tried this and not being a programmer I'm struggling.

    2 questions:
    Is there a simpler solution? I tried just adding an attribute but can't get much control over it's display with CSS.

    I'm, using Zencart 1.5 - if I go back and try again with creating a new product type - are instructions for doing this affected by v1.5 (instructions I've seen posted seem to be older in date).

    any help appreciated greatly!

  2. #2
    Join Date
    Feb 2012
    Posts
    15
    Plugin Contributions
    0

    Default Different template for restricted products?

    I'm setting up my first ZenCart for a catering supplier. General Product type works fine for what they sell. Hoever they sell knives which need a 'restricted age' warning, which I'd like to be added automatically.

    I figured a new product type - identical to product general, except using a different template - would be the best way to achieve this.

    However, not being a programmer I'm struggling with achieving this.

    2 questions:
    1 - Is there a simpler solution? I tried adding an attribute but can't get much control over it's display with CSS.
    2 - If I go back and try again with a new product type are there any differences in doing this in zencart 1.5 - the posts explaining this seem to be older in date?

    Any help greatly appreciated
    Iain

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    1,939
    Plugin Contributions
    20

    Default Re: Different template for restricted products?

    What type of attribute did you add? Where did you want to display it but couldn't with CSS?

    There's a plugin named "Product Extra Fields" that adds an additional text (and other) fields to each product. You could define the first knife product with the extra text-field containing the warning that you need and then create a copy of that knife product for each new knife so that you don't have to type that information in for each new knife. The benefit is that the extra text can contain HTML code, so that you could specify the text as <div id="knives">Your warning here</div> and then style the #knives information within your stylesheet.

  4. #4
    Join Date
    Feb 2012
    Posts
    15
    Plugin Contributions
    0

    Default Re: Different template for restricted products?

    Yes I tried a text field, but it looked like any css I added would affect ALL attributes - what you suggest sounds good, will give that a try - Thank You!

  5. #5
    Join Date
    Feb 2012
    Posts
    15
    Plugin Contributions
    0

    Default Re: Different template for restricted products?

    Before trying the Product Extra Field plugin I just tried writing the html into a text attribute - it allows it, but the html is added after the heading:

    <div class="wrapperAttribsOptions">
    <h4 class="optionName back">Restricted</h4>
    <div class="back">
    <div id="age">You must be over 18 to purchase a knife.</div><br />
    </div>

    So I could style and position the message, but the Attribute heading (in this case 'Restricted') I cannot control -

    Does anyone know if it would be different in the Product Extra Field version?

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    1,939
    Plugin Contributions
    20

    Default Re: Different template for restricted products?

    Quote Originally Posted by iaing View Post
    Yes I tried a text field, but it looked like any css I added would affect ALL attributes - what you suggest sounds good, will give that a try - Thank You!
    If all of the knives are in the same product category, you can use Zen Cart's CSS loading (see /includes/templates/template_default/css/CSS_read_me.txt) to style the attribute information.

    For example, if the knives are all in category 23 (e.g. http://www.yourstore.com/index.php?m...&product_id=77), then you can create the file /includes/templates/YOUR_TEMPLATE/css/c_23.css that contains styling only for products within that category number.

  7. #7
    Join Date
    Feb 2012
    Posts
    15
    Plugin Contributions
    0

    Default Re: Different template for restricted products?

    love it - thanks loads, that should sort it more safely - I discovered that for some reason the other attributes used on the site - size and colour - produce attribute headings that are H3, while my Restricted attribute produced an H4 so I was testing #productAttributes h4 for styling it, but your solution sounds more future proof.

    Thank you so much for keeping trying for me!

 

 

Similar Threads

  1. Template Restricted to 1.3.6
    By DJReda in forum General Questions
    Replies: 6
    Last Post: 28 Jan 2008, 08:13 PM
  2. New Products For <Month> restricted to one category
    By acetate in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 May 2007, 12:24 AM
  3. Creating a different template for different pages?
    By red8ii8 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 13 Mar 2007, 07:11 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
  •