[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/templates/fallback/content/ -> shopping_cart.tpl.php (source)

   1      <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
   2        <tr>
   3          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
   4            <tr>
   5              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
   6              <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_cart.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
   7            </tr>
   8          </table></td>
   9        </tr>
  10        <tr>
  11          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  12        </tr>
  13  <?php
  14    if ($cart->count_contents() > 0) {
  15  ?>
  16        <tr>
  17          <td class="infoBoxHeading">
  18  <?php
  19      $info_box_contents = array();
  20      $info_box_contents[0][] = array('align' => 'center',
  21                                      'params' => 'class="productListing-heading"',
  22                                      'text' => TABLE_HEADING_REMOVE);
  23  
  24      $info_box_contents[0][] = array('params' => 'class="productListing-heading"',
  25                                      'text' => TABLE_HEADING_PRODUCTS);
  26  
  27      $info_box_contents[0][] = array('align' => 'center',
  28                                      'params' => 'class="productListing-heading"',
  29                                      'text' => TABLE_HEADING_QUANTITY);
  30  
  31      $info_box_contents[0][] = array('align' => 'right',
  32                                      'params' => 'class="productListing-heading"',
  33                                      'text' => TABLE_HEADING_TOTAL);
  34  
  35      $any_out_of_stock = 0;
  36      $products = $cart->get_products();
  37      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  38  // Push all attributes information in an array
  39        if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
  40          while (list($option, $value) = each($products[$i]['attributes'])) {
  41            echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
  42  //++++ QT Pro: Begin Changed code
  43            $attributes = tep_db_query("select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix                               
  44                                        from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
  45                                        where pa.products_id = '" . (int)$products[$i]['id'] . "'
  46                                         and pa.options_id = '" . (int)$option . "'
  47                                         and pa.options_id = popt.products_options_id
  48                                         and pa.options_values_id = '" . (int)$value . "'
  49                                         and pa.options_values_id = poval.products_options_values_id
  50                                         and popt.language_id = '" . (int)$languages_id . "'
  51                                         and poval.language_id = '" . (int)$languages_id . "'");
  52            $attributes_values = tep_db_fetch_array($attributes);
  53  
  54            $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
  55            $products[$i][$option]['options_values_id'] = $value;
  56            $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
  57            $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
  58            $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
  59  //++++ QT Pro: Begin Changed code
  60            $products[$i][$option]['track_stock'] = $attributes_values['products_options_track_stock'];
  61  //++++ QT Pro: End Changed Code
  62          }
  63        }
  64      }
  65  
  66      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  67        if (($i/2) == floor($i/2)) {
  68          $info_box_contents[] = array('params' => 'class="productListing-even"');
  69        } else {
  70          $info_box_contents[] = array('params' => 'class="productListing-odd"');
  71        }
  72  
  73        $cur_row = sizeof($info_box_contents) - 1;
  74  
  75        $info_box_contents[$cur_row][] = array('align' => 'center',
  76                                               'params' => 'class="productListing-data" valign="top"',
  77                                               'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));
  78  
  79        $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
  80                         '  <tr>' .
  81                         '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
  82                         '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
  83  
  84        if (STOCK_CHECK == 'true') {
  85  //++++ QT Pro: Begin Changed code
  86          if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
  87            $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity'], $products[$i]['attributes']); 
  88          } else {
  89            $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
  90          }
  91  //++++ QT Pro: End Changed Code
  92          if (tep_not_null($stock_check)) {
  93            $any_out_of_stock = 1;
  94  
  95            $products_name .= $stock_check;
  96          }
  97        }
  98  
  99        if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
 100          reset($products[$i]['attributes']);
 101          while (list($option, $value) = each($products[$i]['attributes'])) {
 102            $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
 103          }
 104        }
 105  
 106        $products_name .= '    </td>' .
 107                          '  </tr>' .
 108                          '</table>';
 109  
 110        $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
 111                                               'text' => $products_name);
 112  
 113        $info_box_contents[$cur_row][] = array('align' => 'center',
 114                                               'params' => 'class="productListing-data" valign="top"',
 115                                               'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));
 116  
 117        $info_box_contents[$cur_row][] = array('align' => 'right',
 118                                               'params' => 'class="productListing-data" valign="top"',
 119                                               'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
 120      }
 121  
 122      new productListingBox($info_box_contents);
 123  ?>
 124          </td>
 125        </tr>
 126        <tr>
 127          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 128        </tr>
 129        <tr>
 130          <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td>
 131        </tr>
 132  <?php
 133      if ($any_out_of_stock == 1) {
 134        if (STOCK_ALLOW_CHECKOUT == 'true') {
 135  ?>
 136        <tr>
 137          <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
 138        </tr>
 139  <?php
 140        } else {
 141  ?>
 142        <tr>
 143          <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
 144        </tr>
 145  <?php
 146        }
 147      }
 148  ?>
 149        <tr>
 150          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 151        </tr>
 152        <tr>
 153          <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
 154            <tr class="infoBoxContents">
 155              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 156                <tr>
 157                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 158                  <td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
 159  <?php
 160      $back = sizeof($navigation->path)-2;
 161      if (isset($navigation->path[$back])) {
 162  ?>
 163                  <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
 164  <?php
 165      }
 166  ?>
 167                  <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
 168                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 169                </tr>
 170              </table></td>
 171            </tr>
 172          </table></td>
 173        </tr>
 174  <?php
 175      $initialize_checkout_methods = $payment_modules->checkout_initialization_method();
 176  
 177      if (!empty($initialize_checkout_methods)) {
 178  ?>
 179        <tr>
 180          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 181        </tr>
 182        <tr>
 183          <td align="right" class="main" style="padding-right: 50px;"><?php echo TEXT_ALTERNATIVE_CHECKOUT_METHODS; ?></td>
 184        </tr>
 185  <?php
 186        reset($initialize_checkout_methods);
 187        while (list(, $value) = each($initialize_checkout_methods)) {
 188  ?>
 189        <tr>
 190          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 191        </tr>
 192        <tr>
 193          <td align="right" class="main"><?php echo $value; ?></td>
 194        </tr>
 195  <?php
 196        }
 197      }
 198    } else {
 199  ?>
 200        <tr>
 201          <td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>
 202        </tr>
 203        <tr>
 204          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 205        </tr>
 206        <tr>
 207          <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
 208            <tr class="infoBoxContents">
 209              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 210                <tr>
 211                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 212                  <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
 213                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 214                </tr>
 215              </table></td>
 216            </tr>
 217          </table></td>
 218        </tr>
 219  <?php
 220    }
 221  ?>
 222      </table></form>
 223  


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7