[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

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

   1  <!-- body_text //-->
   2      <?php echo tep_draw_form('wishlist_form', tep_href_link(FILENAME_WISHLIST_PUBLIC)); ?>
   3        <table border="0" width="100%" cellspacing="0" cellpadding="0">
   4        <tr>
   5          <td>
   6            <table border="0" width="100%" cellspacing="0" cellpadding="0">
   7            <tr>
   8              <td class="pageHeading"><?php echo $customer['customers_firstname'] .  HEADING_TITLE2; ?></td>
   9              <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_wishlist.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  10            </tr>
  11            </table>
  12          </td>
  13        </tr>
  14        <tr>
  15          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  16        </tr>
  17  
  18  <?php
  19    if ($messageStack->size('wishlist') > 0) {
  20  ?>
  21        <tr>
  22          <td><?php echo $messageStack->output('wishlist'); ?></td>
  23        </tr>
  24        <tr>
  25          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  26        </tr>
  27  <?php
  28    }
  29  
  30  /*******************************************************************

  31  ****** QUERY THE DATABASE FOR THE CUSTOMERS WISHLIST PRODUCTS ******

  32  *******************************************************************/
  33  
  34    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $public_id . "'";
  35    $wishlist_split = new splitPageResults($wishlist_query_raw, MAX_DISPLAY_WISHLIST_PRODUCTS);
  36    $wishlist_query = tep_db_query($wishlist_split->sql_query);
  37  
  38  ?>
  39  <!-- customer_wishlist //-->
  40  <?php
  41  
  42    if (tep_db_num_rows($wishlist_query)) {
  43  
  44      if ($wishlist_split > 0 && (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3')) {
  45  ?>
  46        <tr>
  47          <td>
  48          <table border="0" width="100%" cellspacing="0" cellpadding="2">
  49            <tr>
  50              <td class="smallText"><?php echo $wishlist_split->display_count(TEXT_DISPLAY_NUMBER_OF_WISHLIST); ?></td>
  51              <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $wishlist_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
  52            </tr>
  53          </table>
  54          </td>
  55        </tr>
  56  
  57  <?php
  58    }
  59  ?>
  60        <tr>
  61          <td>
  62                  <table border="0" width="100%" cellspacing="0" cellpadding="3" class="productListing">
  63                    <tr>
  64                          <td class="productListing-heading"><?php echo BOX_TEXT_IMAGE; ?></td>
  65                          <td class="productListing-heading"><?php echo BOX_TEXT_PRODUCT; ?></td>
  66                          <td class="productListing-heading"><?php echo BOX_TEXT_PRICE; ?></td>
  67                          <td class="productListing-heading" align="center"><?php echo BOX_TEXT_SELECT; ?></td>
  68                    </tr>
  69  <?php 
  70  
  71  /*******************************************************************

  72  ***** LOOP THROUGH EACH PRODUCT ID TO DISPLAY IN THE WISHLIST ******

  73  *******************************************************************/
  74      $i = 0;
  75      while ($wishlist = tep_db_fetch_array($wishlist_query)) {
  76      $wishlist_id = tep_get_prid($wishlist['products_id']);
  77  
  78      $products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where pd.products_id = '" . $wishlist_id . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
  79      $products = tep_db_fetch_array($products_query);
  80  
  81        if (($i/2) == floor($i/2)) {
  82          $class = "productListing-even";
  83        } else {
  84          $class = "productListing-odd";
  85        }
  86  
  87  ?>
  88                    <tr class="<?php echo $class; ?>">
  89                      <td valign="top" class="productListing-data" align="left"><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist['products_id'], 'NONSSL'); ?>"><?php echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></a></td>
  90                      <td valign="top" class="productListing-data" align="left" class="main"><b><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist['products_id'], 'NONSSL'); ?>"><?php echo $products['products_name']; ?></a></b>
  91  <?php
  92  
  93  /*******************************************************************

  94  ******** THIS IS THE WISHLIST CODE FOR PRODUCT ATTRIBUTES  *********

  95  *******************************************************************/
  96  
  97                    $attributes_addon_price = 0;
  98  
  99                    // Now get and populate product attributes

 100                      $wishlist_products_attributes_query = tep_db_query("select products_options_id as po, products_options_value_id as pov from " . TABLE_WISHLIST_ATTRIBUTES . " where customers_id='" . $public_id . "' and products_id = '" . $wishlist['products_id'] . "'");
 101                      while ($wishlist_products_attributes = tep_db_fetch_array($wishlist_products_attributes_query)) {
 102                        // We now populate $id[] hidden form field with product attributes

 103                        echo tep_draw_hidden_field('id['.$wishlist['products_id'].']['.$wishlist_products_attributes['po'].']', $wishlist_products_attributes['pov']);
 104                        // And Output the appropriate attribute name

 105                        $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
 106                                        from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
 107                                        where pa.products_id = '" . $wishlist_id . "'
 108                                         and pa.options_id = '" . $wishlist_products_attributes['po'] . "'
 109                                         and pa.options_id = popt.products_options_id
 110                                         and pa.options_values_id = '" . $wishlist_products_attributes['pov'] . "'
 111                                         and pa.options_values_id = poval.products_options_values_id
 112                                         and popt.language_id = '" . $languages_id . "'
 113                                         and poval.language_id = '" . $languages_id . "'");
 114                         $attributes_values = tep_db_fetch_array($attributes);
 115                         if ($attributes_values['price_prefix'] == '+')
 116                           { $attributes_addon_price += $attributes_values['options_values_price']; }
 117                         else if ($attributes_values['price_prefix'] == '-')
 118                           { $attributes_addon_price -= $attributes_values['options_values_price']; }
 119                         echo '<br /><small><i> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</i></small>';
 120                      } // end while attributes for product

 121  
 122                      if (tep_not_null($products['specials_new_products_price'])) {
 123                         $products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';
 124                      } else {
 125                         $products_price = $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id']));
 126                      }
 127  
 128  /*******************************************************************

 129  ******* CHECK TO SEE IF PRODUCT HAS BEEN ADDED TO THEIR CART *******

 130  *******************************************************************/
 131  
 132          if($cart->in_cart($wishlist[products_id])) {
 133              echo '<br /><font color="#FF0000"><b>>' . TEXT_ITEM_IN_CART . '</b></font>';
 134          }
 135  
 136  /*******************************************************************

 137  ********** CHECK TO SEE IF PRODUCT IS NO LONGER AVAILABLE **********

 138  *******************************************************************/
 139  
 140           if($products['products_status'] == 0) {
 141                 echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_NOT_AVAILABLE . '</b></font>';
 142            }
 143  
 144          $i++;
 145  ?>
 146                      </td>
 147                      <td valign="top" class="productListing-data"><?php echo $products_price; ?></td>
 148                      <td valign="top" class="productListing-data" align="center">
 149  <?php 
 150  
 151  /*******************************************************************

 152  * PREVENT THE ITEM FROM BEING ADDED TO CART IF NO LONGER AVAILABLE *

 153  *******************************************************************/
 154  
 155              if($products['products_status'] != 0) {
 156                  echo tep_draw_checkbox_field('add_wishprod[]',$wishlist[products_id]);
 157              }
 158  ?>                    </td>
 159                    </tr>
 160  
 161  <?php
 162      }
 163  ?>
 164                  </table>
 165          </td>
 166        </tr>
 167        <tr>
 168          <td align="right"><br /><?php echo tep_image_submit('button_in_cart.gif', 'Add to Cart', 'name="add_prod" value="add_prod"'); ?></td>
 169         </tr>
 170  
 171  
 172  
 173  
 174  <?php
 175    if ($wishlist_split > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) {
 176  ?>
 177        <tr>
 178          <td>
 179          <table border="0" width="100%" cellspacing="0" cellpadding="2">
 180            <tr>
 181              <td class="smallText"><?php echo $wishlist_split->display_count(TEXT_DISPLAY_NUMBER_OF_WISHLIST); ?></td>
 182              <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $wishlist_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 183            </tr>
 184          </table>
 185          </td>
 186        </tr>
 187  
 188  <?php
 189      }
 190  ?>
 191  </table></form>
 192  
 193  <?php
 194  } else { // Nothing in the customers wishlist
 195  
 196  ?>
 197    <tr>
 198      <td>
 199      <table border="0" width="100%" cellspacing="0" cellpadding="2">
 200        <tr>
 201          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 202            <tr>
 203              <td class="main"><?php echo BOX_TEXT_NO_ITEMS;?></td>
 204            </tr>
 205          </table>
 206          </td>
 207        </tr>
 208      </table>
 209      </td>
 210    </tr>
 211  </table>
 212  </form>
 213  <?php
 214      }
 215  ?>
 216  <!-- customer_wishlist_eof //-->
 217  <!-- body_text_eof //-->


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