Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Reversible Option

    Greetings;

    I have made a new field on the site that is called "reversible" what i would like it to do is that when this field has "Yes" in it, it will show an image on the product page.

    The field works very well, it works in the admin section and alike, however i am just trying to get it to show up on the product page, can someone tell me what i have done wrong on this.

    tpl_product_info_display.php

    <?php if($product_info->fields['products_reversible'] ='Yes') { ?> <div id="reversibleIcon"></div> <?php } ?>
    Thanks

  2. #2
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Reversible Option

    okey, i have it so the image is showing, but there is something wrong with my if statement....


    <?php if($product_info->fields['products_reversible'] != "Yes") { ?> <div id="freeShippingIcon"><?php echo TEXT_PRODUCTS_REVERSIBLE_ICON; ?></div> <?php } ?>

  3. #3
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Reversible Option

    Is $product_info->fields['products_reversible'] actually set?

    You can check by echoing its value to the page. I suspect that it is not. It's value is added from an sql query that is run in modules/pages/product_info/main_template_vars.php.

    Basically, this part of this file selects the products are needed for that page and downloads the information for them into $product_info.

    So, in order to use $product_info->fields['products_reversible'] you need to add your new field to the sql query. Have you done this?

  4. #4
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Reversible Option

    Quote Originally Posted by niccol View Post
    Is $product_info->fields['products_reversible'] actually set?

    You can check by echoing its value to the page. I suspect that it is not. It's value is added from an sql query that is run in modules/pages/product_info/main_template_vars.php.

    Basically, this part of this file selects the products are needed for that page and downloads the information for them into $product_info.

    So, in order to use $product_info->fields['products_reversible'] you need to add your new field to the sql query. Have you done this?
    nope, i dont think i have.....


    I just added the following

    p.products_reversible, p.products_plussize, p.products_packingtype,
    to the line in the file main_template_vars.php

    p.products_weight, p.products_height, p.products_width, p.products_length, p.products_itemlength, p.products_itemilength, p.products_itemcir, p.products_itemdia, p.products_rated, p.products_category, p.products_reversible, p.products_plussize, p.products_packingtype,

  5. #5
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Reversible Option

    Sweet, that worked. Thanks for your help....

    here is the complete line for the files incase anyone else wants it.

    tpl_product_info_display.php
    <?php if ($product_info->fields['products_reversible'] == "Yes" ) { ?> <div id="freeShippingIcon"><?php echo TEXT_PRODUCTS_REVERSIBLE_ICON; ?></div> <?php } ?>
    product_info.php
    define('TEXT_PRODUCTS_REVERSIBLE_ICON', zen_image(DIR_WS_TEMPLATE_IMAGES . 'reversible.jpg', 'Reversible: All styles denoted by the Reversible icon signifies that the costumes are completely reversible.'));
    main_template_vars.php
    p.products_reversible, p.products_plussize, p.products_packingtype,
    (added to this line;)

    p.products_weight, p.products_height, p.products_width, p.products_length, p.products_itemlength, p.products_itemilength, p.products_itemcir, p.products_itemdia, p.products_rated, p.products_category,

  6. #6
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Reversible Option

    I have now extended the option to include a few more options, however i was wondering how to make them appear on the same line, atm they are

    (reversible)
    (plussize)
    (packing)

    i would like it like this;

    (reversible) (plussize) (packing)

  7. #7
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Reversible Option

    Well done - nice one!

    As far as the layout goes - it really is going to help to have a URL to see what you are talking about!

    In general, however, you want to apply a fixed width to those elements and then apply a float:left (or a class .back which is the zen cart way of doing it ) to those elements.

    Try and get a clear:both in after the the elements to clear the floats.

    More specific advice depends on a url!

  8. #8
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Reversible Option

    I forgot to include an example of the coding;

    <?php if ($product_info->fields['products_reversible'] == "Yes" ) { ?> <div id="reversibleIcon"><?php echo TEXT_PRODUCTS_REVERSIBLE_ICON; ?></div> <?php } ?>
    <?php if ($product_info->fields['products_plussize'] == "Yes" ) { ?> <div id="plussizeIcon"><?php echo TEXT_PRODUCTS_PLUSSIZE_ICON; ?></div> <?php } ?>

  9. #9
    Join Date
    May 2006
    Location
    Queensland, Australia
    Posts
    248
    Plugin Contributions
    0

    Default Re: Reversible Option

    Quote Originally Posted by niccol View Post
    Well done - nice one!

    As far as the layout goes - it really is going to help to have a URL to see what you are talking about!

    In general, however, you want to apply a fixed width to those elements and then apply a float:left (or a class .back which is the zen cart way of doing it ) to those elements.

    Try and get a clear:both in after the the elements to clear the floats.

    More specific advice depends on a url!
    http://www.delightsoftheflesh.com/st...oducts_id=8067

  10. #10
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Reversible Option

    You need a rule in stylesheet.css that looks like:

    Code:
    #plussizeIcon,#boxIcon{
    width:60px;
    float:left;
    }
    You need to add whatever other divs you are using into that rule.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. My Option names do not line up HORIZONTALLY with option value boxes...
    By youshine in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 4 Aug 2009, 03:08 AM
  2. Plus Size and Reversible
    By Delights in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 31 May 2009, 03:29 AM
  3. Adding copied option names and option valuesto product pricing
    By Derek Bryant in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 29 Apr 2009, 06:31 PM
  4. enlarge the option name and option value boxes in Attributes
    By stevenlee in forum Customization from the Admin
    Replies: 10
    Last Post: 16 Aug 2008, 02:16 AM

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