Jump to content

upgrade.tpl questions - alternated color rows


minadreapta

Recommended Posts

i have a hosting package and i allow 6 upgrades for that package.

 

on the upgrade.php page i get the list of these 6 packages in td rows, colored like this:

 

row1: bgcolor2

row2:bgcolor2

row3:bgcolor2

row4:bgcolor1

row5:bgcolor2

row6:bgcolor1

 

if i only allow 5 upgrades, i will have like this:

row1:bgcolor2

row2:bgcolor2

row3:bgcolor2

row4:bgcolor1

row5:bgcolor2

 

row2 doesn't get the alternate color...

is there any fix to have alternate colored rows working properly?

 

i think the problem is on this string:

<tr class="orderrow{if $num % 2}2{else}1{/if}">

 

can anyone help me?

Link to comment
Share on other sites

not working, no matter what i do i, get the first 3 rows with orderrow2 class, then it starts alternating.

 

it is not alternating for rows 1, 2, 3 then for 4,5,6 it is.

 

i tried moving the class from tr to td it's not working.

 

anyway, in style.css orderrow1 and 2 are defined for tr, not td

i tried to define it like td.orderrow1 and 2, but it was not working.

 

in this moment, it looks like this:

 

 

1618371496_0a3499b5ea.jpg

Link to comment
Share on other sites

Instead, remove the tr/td from the class in the css. That way it's JUST .orderrow. That way it can get applied anyway, without any issues (eg: having to be only TD or TR).

 

.orderrow1 {
background-color: #E8F0F9;
color: #000000;
}

.orderrow2 {
background-color: #D6E4F6;
color: #000000;
}

 

It sounds like you might have an issue with your upgrade.tpl page, because I just set it up with my template, and it works with no issues at all.

 

Here's what I have (albeit, you'll have to change a few things around...):

<table id="clientpkgupgrade" summary="Client Package Upgrade/Downgrade" cellspacing="0" cellpadding="0">
<tr>
	<th>{$LANG.clientareahostingpackage}</th>
	<th>{$LANG.orderprice}</th>
</tr>
{foreach key=num item=upgradepackage from=$upgradepackages}
<tr>
	<td class="orderrow{if $num % 2}2{else}1{/if}">	
		[b]{$upgradepackage.groupname} - {$upgradepackage.name}[/b]
{$upgradepackage.description}

	</td>
	<td>
<form method="post" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="step" value="2">
<input type="hidden" name="type" value="{$type}">
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="pid" value="{$upgradepackage.pid}">
{if $upgradepackage.pricing.type eq "free"}
{$LANG.orderfree}

<input type="hidden" name="billingcycle" value="free">
{elseif $upgradepackage.pricing.type eq "onetime"}
{$product.pricing.onetime} {$LANG.orderpaymenttermonetime}
<input type="hidden" name="billingcycle" value="onetime">
{elseif $upgradepackage.pricing.type eq "recurring"}
<select name="billingcycle">
{if $upgradepackage.pricing.monthly}<option value="monthly">{$upgradepackage.pricing.monthly}</option>{/if}
{if $upgradepackage.pricing.quarterly}<option value="quarterly">{$upgradepackage.pricing.quarterly}</option>{/if}
{if $upgradepackage.pricing.semiannually}<option value="semiannually">{$upgradepackage.pricing.semiannually}</option>{/if}
{if $upgradepackage.pricing.annually}<option value="annually">{$upgradepackage.pricing.annually}</option>{/if}
{if $upgradepackage.pricing.biennially}<option value="biennially">{$upgradepackage.pricing.biennially}</option>{/if}
	</select>
{/if}

<div class="buttons">
		<button type="submit" value="{$LANG.ordercontinuebutton}" class="positive">
	      [img=templates/{$template}/images/clientarea/tick.png] 
     			  {$LANG.ordercontinuebutton}
		   </button>
</div>	</form>
	</td>
</tr>
{/foreach}
</table>

 

If you copy that word for word, you'll have issues with it's styling, since I a few customized elements in there... But that works fine and alternates each TD without fail.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated