Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30
  1. #11
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Wrap DIV around attributes

    I haven't viewed the source code for the page, but I do notice that the above code doesn't have: MYHIDDENATTRIBUTESDIV defined/replaced.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #12
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,229
    Plugin Contributions
    6

    Default Re: Wrap DIV around attributes

    Quote Originally Posted by mc12345678 View Post
    Yeah, on retrospect that won't do anything, the variable $attributes_values doesn't exist in this scope. Need to change $attributes_values to $products_options_names

    :)
    That kind of works BUT it puts it in the wrong place.

    See this line <h4 class="optionName back"><div id="MYHIDDENATTRIBUTESDIV" style="background-color:#ffffcc;">Finishing Options</h4>

    I need it outside <h4 class="optionName back">

    So like this

    <div id="MYHIDDENATTRIBUTESDIV" style="background-color:#ffffcc;"><h4 class="optionName back">Finishing Options</h4>

    and for the end

    currently it is like this <h4 class="optionName back"><label class="attribsUploads" for="attrib-46-0">Upload your artwork</label></div></h4>

    and should be

    </div><h4 class="optionName back"><label class="attribsUploads" for="attrib-46-0">Upload your artwork</label></h4>
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  3. #13
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Wrap DIV around attributes

    So, then back to having to put that code (probably as originally written in the file that calls attributes.php, which I seem to think is a template file. Possibly the easier way to identify that is to use the variable I said to replace in a search through tools->developer's toolkit. And see which file(s) that appears in. Then in the loop that displays al of the applicable attributes, add that code.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #14
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,229
    Plugin Contributions
    6

    Default Re: Wrap DIV around attributes

    Quote Originally Posted by mc12345678 View Post
    So, then back to having to put that code (probably as originally written in the file that calls attributes.php, which I seem to think is a template file. Possibly the easier way to identify that is to use the variable I said to replace in a search through tools->developer's toolkit. And see which file(s) that appears in. Then in the loop that displays al of the applicable attributes, add that code.
    Well that would be tpl_modules_attributes.php wouldn't it?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  5. #15
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,229
    Plugin Contributions
    6

    Default Re: Wrap DIV around attributes

    Quote Originally Posted by Nick1973 View Post
    Well that would be tpl_modules_attributes.php wouldn't it?
    Well I tried this and nothing happened

    <?php if (stristr($products_options_name->fields['products_options_name'],'Finishing Options')) { ?><div id="MYHIDDENATTRIBUTESDIV"><?php } ?>
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: Wrap DIV around attributes

    Quote Originally Posted by Nick1973 View Post
    Well I tried this and nothing happened

    <?php if (stristr($products_options_name->fields['products_options_name'],'Finishing Options')) { ?><div id="MYHIDDENATTRIBUTESDIV"><?php } ?>
    My guess and sorry I don't have a copy of tpl_modules_attributes.php redily available, is that the variable ($products_options_name) would be something different in that file, ie back to what was in your earlier post.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #17
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,229
    Plugin Contributions
    6

    Default Re: Wrap DIV around attributes

    Quote Originally Posted by mc12345678 View Post
    My guess and sorry I don't have a copy of tpl_modules_attributes.php redily available, is that the variable ($products_options_name) would be something different in that file, ie back to what was in your earlier post.
    This is the full code for tpl_modules_attributes.php. Note I have added coded and used $options_name

    <?php
    /**
    * Module Template
    *
    * Template used to render attribute display/input fields
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $
    */
    ?>
    <div id="productAttributes">
    <?php if ($zv_display_select_option > 0) { ?>
    <h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3>
    <?php } // show please select unless all are readonly ?>

    <?php
    for($i=0;$i<sizeof($options_name);$i++) {
    ?><div id="<?php echo $options_wrapper_id[$i];//gjh42 ?>" class="wrapperAttribsOptions">
    <?php
    if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') {
    ?>
    <h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3>
    <?php
    }
    ?>




    <?php /* MY CODE STARTS HERE */ ?>
    <?php if (stristr($options_name->fields['products_options_name'],'Finishing Options')) { ?><div id="MYHIDDENATTRIBUTESDIV"><?php } ?>
    <?php /* MY CODE ENDS HERE */ ?>





    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4><div style="clear:both;" /></div><div class="back"><div id="productattributesheaderbg"></div><div id="productattributesmidbg"><?php echo "\n" . $options_menu[$i]; ?><br style="clear:both;" /></div><div id="productattributesfooterbg"></div></div>

    <?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
    <div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
    <?php } ?>


    <?php
    if ($options_attributes_image[$i] != '') {
    ?>
    <?php echo $options_attributes_image[$i]; ?>
    <?php
    }
    ?>
    <br class="clearBoth" />
    <?php
    }
    ?>


    <?php
    if ($show_onetime_charges_description == 'true') {
    ?>
    <div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
    <?php } ?>


    <?php
    if ($show_attributes_qty_prices_description == 'true') {
    ?>
    <div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . '&nbsp;' . '<a href="javascriptopupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
    <?php } ?>
    </div><br class="clearBoth" />
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  8. #18
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Wrap DIV around attributes

    Quote Originally Posted by Nick1973 View Post
    This is the full code for tpl_modules_attributes.php. Note I have added coded and used $options_name

    <?php
    /**
    * Module Template
    *
    * Template used to render attribute display/input fields
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $
    */
    ?>
    <div id="productAttributes">
    <?php if ($zv_display_select_option > 0) { ?>
    <h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3>
    <?php } // show please select unless all are readonly ?>

    <?php
    for($i=0;$i<sizeof($options_name);$i++) {
    ?><div id="<?php echo $options_wrapper_id[$i];//gjh42 ?>" class="wrapperAttribsOptions">
    <?php
    if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') {
    ?>
    <h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3>
    <?php
    }
    ?>




    <?php /* MY CODE STARTS HERE */ ?>
    <?php if (stristr($options_name->fields['products_options_name'],'Finishing Options')) { ?><div id="MYHIDDENATTRIBUTESDIV"><?php } ?>
    <?php /* MY CODE ENDS HERE */ ?>





    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4><div style="clear:both;" /></div><div class="back"><div id="productattributesheaderbg"></div><div id="productattributesmidbg"><?php echo "\n" . $options_menu[$i]; ?><br style="clear:both;" /></div><div id="productattributesfooterbg"></div></div>

    <?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
    <div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
    <?php } ?>


    <?php
    if ($options_attributes_image[$i] != '') {
    ?>
    <?php echo $options_attributes_image[$i]; ?>
    <?php
    }
    ?>
    <br class="clearBoth" />
    <?php
    }
    ?>


    <?php
    if ($show_onetime_charges_description == 'true') {
    ?>
    <div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
    <?php } ?>


    <?php
    if ($show_attributes_qty_prices_description == 'true') {
    ?>
    <div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . '&nbsp;' . '<a href="javascriptopupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
    <?php } ?>
    </div><br class="clearBoth" />
    Good choice, but not quite. At this point $options_name is referenced as an array through [$i] so would need to use $options_name[$i] instead. That and placed where desired should work though I. Also don't remember how stristr works. I assume it means if the text on the right is in the string to the left, then return true.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #19
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Wrap DIV around attributes

    Haven't heard back, assume this resolved the issue?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #20
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,229
    Plugin Contributions
    6

    red flag Re: Wrap DIV around attributes

    Quote Originally Posted by mc12345678 View Post
    Haven't heard back, assume this resolved the issue?
    No, I'd just finished for the day.

    Come back to it this morning and have tried a few options but none seemed to work.

    Then tried this which although doesn't what I want does display the DIV outside the h4 tag, it just displays on every attribute.

    <?php
    if ($options_name[$i] != 'Finishing Options') { echo '<div id="MYHIDDENATTRIBUTESDIV" style="background-color:#ffffcc;">';
    ?><?php
    }
    ?>

    Also tried this:

    <?php
    if ($options_name[$i] != fields['products_options_name'],'Finishing Options') { echo '<div id="MYHIDDENATTRIBUTESDIV" style="background-color:#ffffcc;">';
    ?><?php
    }

    And this:

    <?php
    if ($options_name[$i] != fields['options_name'],'Finishing Options') { echo '<div id="MYHIDDENATTRIBUTESDIV" style="background-color:#ffffcc;">';
    ?><?php
    }
    ?>
    ?>
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Making text wrap around all images
    By robbin21973 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 8 Feb 2011, 10:55 PM
  2. wrap text around categories image
    By Edm in forum General Questions
    Replies: 0
    Last Post: 3 Jun 2008, 01:07 PM
  3. Wrap price in DIV
    By Nimbuz in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Nov 2007, 07:20 PM
  4. Column Layout Grid, need to wrap <div> around <img>
    By duntuk in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 11 Apr 2007, 06:10 PM

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