Zen Cart Logo
Forums / Bug Reports / [Done]Alternating rowClass not set in tpl_checkout_confirmation_default.php

[Done]Alternating rowClass not set in tpl_checkout_confirmation_default.php

Locked

Views: 1,444

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
11 Aug 2006, 7:01 PM
#1
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

[Done]Alternating rowClass not set in tpl_checkout_confirmation_default.php

The order listing on the checkout confirmation page has code intended to create a class that shows whether it is an odd or an even row thus allowing styling to be applied.

Unfortunately the php snippet (below from line 121) has been copied from tpl_shopping_cart_default.php and the relevant variable is not set in this context> <tr class="<?php echo $product['rowClass']; ?>">I recommend replacing the line with the following> <tr class="<?php echo ($i%2 == 0) ? 'rowEven' : 'rowOdd'; ?>">

11 Aug 2006, 7:16 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: [Done]Alternating rowClass not set in tpl_checkout_confirmation_default.php

Oh what the hell. In for a penny in for a pound.

The next line (122)> <td class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>should really read> <td class="cartQuantity"><?php echo $order->products[$i]['qty'] . BOX_SHOPPING_CART_DIVIDER; ?></td>

11 Aug 2006, 7:31 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done]Alternating rowClass not set in tpl_checkout_confirmation_default.php

Change line 121 in the tpl_checkout_confirmation_default.php from:

        <tr class="<?php echo $product['rowClass']; ?>">

to now read:

        <tr class="<?php echo $order->products[$i]['rowClass']; ?>">

Add the lines around 421 - 434 in /includes/classes/orders.php to read:

      if (($i/2) == floor($i/2)) {
        $rowClass="rowEven";
      } else {
        $rowClass="rowOdd";
      }

      $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                      'name' => $products[$i]['name'],
                                      'model' => $products[$i]['model'],
                                      'tax' => zen_get_tax_rate($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']),
                                      'tax_description' => zen_get_tax_description($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']),
                                      'price' => $products[$i]['price'],
                                      'final_price' => $products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']),
                                      'onetime_charges' => $_SESSION['cart']->attributes_price_onetime_charges($products[$i]['id'], $products[$i]['quantity']),
                                      'weight' => $products[$i]['weight'],
                                      'products_priced_by_attribute' => $products[$i]['products_priced_by_attribute'],
                                      'product_is_free' => $products[$i]['product_is_free'],
                                      'products_discount_type' => $products[$i]['products_discount_type'],
                                      'products_discount_type_from' => $products[$i]['products_discount_type_from'],
                                      'id' => $products[$i]['id'],
                                      'rowClass' => $rowClass);
11 Aug 2006, 9:54 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done]Alternating rowClass not set in tpl_checkout_confirmation_default.php

kuroi:

Oh what the hell. In for a penny in for a pound.

The next line (122)should really read

The BOX_SHOPPING_CART_DIVIDER is not the X it is the ea. for the shopping_cart sidebox ...

The X you found should be translated at some point ... thanks!