If this is your first visit, check our documentation. To post, register or login.

Text Attribute comments

Started by tsrplatelayer on 19 May 2011, 11:10 AM · Views: 2,225

Results 1 to 8 of 8
19 May 2011, 11:10 AM
#1
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Text Attribute comments

I am feeling particularly dense:(
I want the text attribute comment to be after the attribute not before. I can see a variable $options_comment_position used in tpl_modules_attributes.php that can take the value 0 or 1 as a flag to indicate this.

I cannot see in Admin where to set this flag.

Please can someone put an old dog out of his misery.:dontgetit

19 May 2011, 12:55 PM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,189
Plugin Contributions:
0

Re: Text Attribute comments

Edit your stylesheet.css Find it there or add this declaration..

.attributesComments {
float: right;
}

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

19 May 2011, 1:05 PM
#3
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Re: Text Attribute comments

really - I got the impression from the code that an entry in the database is used.

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

<div class="attribsOptions">
<h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
<div class="back"><?php echo "\n" . $options_menu[$i]; ?></div>
<br class="clearBoth" />
</div>

<?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
    <div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
<?php } ?>
19 May 2011, 1:12 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Text Attribute comments

tsrplatelayer:

really - I got the impression from the code that an entry in the database is used.
While the code might imply that there's a database entry ... there isn't!

19 May 2011, 1:44 PM
#5
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Re: Text Attribute comments

ah - yes - I see in attributes.php it has

$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');

which always sets to 0

Perhaps somthing is planned - or was and didnt materialise.

Ah well - I feel a little override code coming on.

At least I wasnt just loosing my marbles:D

19 May 2011, 2:20 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Text Attribute comments

That apparently was something left unfinished long ago. The db table field is there, ready to use.
If you want all the comments below the inputs, you can switch the 1 and 0 in these statements

if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') {

if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') {

19 May 2011, 2:35 PM
#7
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Re: Text Attribute comments

Exactly what I had in mind

Thanks all:clap:**

7 Jun 2022, 4:26 PM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Text Attribute comments

Eleven years later, fixed by this PR:
https://github.com/zencart/zencart/pull/4855

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.