Jump to content



Latest News: (loading..)

- - - - -

Messagestack table


This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1   poNgz0r

poNgz0r
  • Members
  • 14 posts

Posted 05 May 2011 - 08:44 PM

Is there a way i can add a class to the messagestack table?


when i successfully remove an item i get this table

<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="messageStackSuccess">
	<td class="messageStackSuccess"><img src="images/icons/success.gif" border="0" alt="Uitgevoerd" title=" Uitgevoerd " />&nbsp;Success: The discount code has been removed.</td>
  </tr>
</table>

I want to add a class to this table in the function messagestack i see this:

	function output() {
	  $this->table_data_parameters = 'class="messageBox"';
	  return $this->tableBlock($this->errors);
	}

but there is no class messageBox added....


This is the function the create the box... so i am kinda lost why there is no extra table class
  class tableBlock {
	var $table_border = '0';
	var $table_width = '100%';
	var $table_cellspacing = '0';
	var $table_cellpadding = '2';
	var $table_parameters = '';
	var $table_row_parameters = '';
	var $table_data_parameters = '';

	function tableBlock($contents) {
	  $tableBox_string = '';

	  $form_set = false;
	  if (isset($contents['form'])) {
		$tableBox_string .= $contents['form'] . "\n";
		$form_set = true;
		array_shift($contents);
	  }

	  $tableBox_string .= '<table border="' . $this->table_border . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"';
	  if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
	  $tableBox_string .= '>' . "\n";

Edited by poNgz0r, 05 May 2011 - 08:57 PM.


#2   poNgz0r

poNgz0r
  • Members
  • 14 posts

Posted 05 May 2011 - 09:29 PM

Seems like this if

	  if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;

stays empty but why?

#3   dennish

dennish
  • Members
  • 19 posts

Posted 11 April 2012 - 11:28 AM

I was bothered by the same issue.

The solution I found (on osC 2.3.1.):

Just replace the following code in catalog/includes/classes/messagestack.php

	function output($class) {
	  $this->table_parameters = 'class="messageBox"';
	  $output = array();
	  for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
		if ($this->messages[$i]['class'] == $class) {
		  $output[] = $this->messages[$i];
		}
	  }

by

	function output($class) {
//	$this->table_data_parameters = 'class="messageBox"';
	  $this->table_parameters = 'class="messageBox"';
	  $output = array();
	  for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
		if ($this->messages[$i]['class'] == $class) {
		  $output[] = $this->messages[$i];
		}
	  }

Done!

Edited by dennish, 11 April 2012 - 11:30 AM.


#4   mattjt83

mattjt83
  • Partner
  • 263 posts

Posted 11 April 2012 - 01:10 PM

On my site I just changed the messageStackSuccess class in my stylesheet to change the look of it.  It worked well.

#5   LaliaTK

LaliaTK
  • Members
  • 6 posts

Posted 16 June 2012 - 05:27 PM

View Postmattjt83, on 11 April 2012 - 01:10 PM, said:

On my site I just changed the messageStackSuccess class in my stylesheet to change the look of it.  It worked well.

That worked for me everywhere in the store except in the "Tell A Friend" and "Write Review" areas.

When I submit a review, the "Thank you for your review" text appears in the right place, but the little lightbulb icon is too far down.

When I use the "Tell A Friend" functionality, the "success" text is placed waaaaaaaaaay at the top of the screen.

In both instances, the code itself does not even seem to appear in the source code of the page when I'm looking at it, so how can I style it?  I can't even tell if it has the proper CSS class attached.  Auugh.

I also tried dennish's fix and absolutely nothing changed.  :-/