[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

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

   1      <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
   2  <?php
   3    if ($product_check['total'] < 1) {
   4     // BOF Separate Price per Customer
   5       if(!tep_session_is_registered('sppc_customer_group_id')) { 
   6       $customer_group_id = '0';
   7       } else {
   8        $customer_group_id = $sppc_customer_group_id;
   9       }
  10     // EOF Separate Price per Customer
  11  ?>
  12        <tr>
  13          <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
  14        </tr>
  15        <tr>
  16          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  17        </tr>
  18        <tr>
  19          <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  20            <tr class="infoBoxContents">
  21              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  22                <tr>
  23                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  24                  <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
  25                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  26                </tr>
  27              </table></td>
  28            </tr>
  29          </table></td>
  30        </tr>
  31  <?php
  32    } else {
  33      $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
  34      $product_info = tep_db_fetch_array($product_info_query);
  35  
  36      tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
  37  
  38      if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  39  // BOF Separate Price per Customer
  40  
  41          $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
  42          if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
  43          $product_info['products_price']= $scustomer_group_price['customers_group_price'];
  44      }
  45  // EOF Separate Price per Customer
  46        $products_price = '<span style="text-decoration:line-through">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
  47      } else {
  48  // BOF Separate Price per Customer
  49          $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
  50          if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
  51          $product_info['products_price']= $scustomer_group_price['customers_group_price'];
  52      }
  53  // EOF Separate Price per Customer
  54        $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
  55      }
  56  
  57      if (tep_not_null($product_info['products_model'])) {
  58        $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
  59      } else {
  60        $products_name = $product_info['products_name'];
  61      }
  62  
  63  // BOF: Mod - Wishlist
  64  //DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED
  65      if(tep_session_is_registered('wishlist_id')) {
  66  ?>  
  67        <tr>
  68          <td class="messageStackSuccess"><?php echo PRODUCT_ADDED_TO_WISHLIST; ?></td>
  69        </tr> 
  70  <?php
  71        tep_session_unregister('wishlist_id');
  72      }
  73  // EOF: Mod - Wishlist
  74  ?>
  75        <tr>
  76          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  77            <tr>
  78              <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
  79              <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
  80            </tr>
  81          </table></td>
  82        </tr>
  83        <tr>
  84          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  85        </tr>
  86        <tr>
  87          <td class="main">
  88  <?php
  89          //// BEGIN:  Added for Dynamic MoPics v3.000
  90      if (tep_not_null($product_info['products_image'])) {
  91  ?>
  92            <table border="0" cellspacing="0" cellpadding="2" align="right">
  93              <tr>
  94                <td align="center" class="smallText">
  95  <?php
  96              $image_lg = mopics_get_imagebase($product_info['products_image'], DIR_WS_IMAGES . DYNAMIC_MOPICS_BIGIMAGES_DIR);
  97              if ($lg_image_ext = mopics_file_exists(DIR_FS_CATALOG . $image_lg, DYNAMIC_MOPICS_BIG_IMAGE_TYPES)) {
  98                  $image_size = @getimagesize(DIR_FS_CATALOG . $image_lg . '.' . $lg_image_ext);
  99  ?>
 100  
 101  <script language="javascript" type="text/javascript"><!--
 102  document.write('<a href="javascript:popupImage(\'<?php echo tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&type=' . $lg_image_ext); ?>\',\'<?php echo ((int)$image_size[1] + 30); ?>\',\'<?php echo ((int)$image_size[0] + 5); ?>\');"><?php echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE; ?></span></a>');
 103  //--></script>
 104  <noscript>
 105  <a href="<?php echo tep_href_link($image_lg . '.' . $lg_image_ext); ?>" target="_blank"><?php echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?><br /><span class="smallText"><?php echo TEXT_CLICK_TO_ENLARGE; ?></span></a>
 106  </noscript>
 107  <?php
 108              } else {
 109            echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $product_info['products_image'], stripslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
 110              }
 111  ?>
 112                </td>
 113              </tr>
 114            </table>
 115  <?php
 116      }
 117          //// END:  Added for Dynamic MoPics v3.000
 118  ?>
 119            <p><?php echo stripslashes($product_info['products_description']); ?></p>
 120  <?php
 121      $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
 122      $products_attributes = tep_db_fetch_array($products_attributes_query);
 123      if ($products_attributes['total'] > 0) {
 124  //++++ QT Pro: Begin Changed code
 125        $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']); 
 126        require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
 127        $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
 128        $pad = new $class($products_id);
 129        echo $pad->draw();
 130  //++++ QT Pro: End Changed Code
 131      }
 132  ?>
 133          </td>
 134        </tr>
 135  <?php
 136          //// BEGIN:  Added for Dynamic MoPics v3.000
 137  ?>
 138        <tr>
 139            <td>
 140                  <div class="screenshotsHeader">
 141                      <div class="screenshotsHeaderText"><?php echo TEXT_OTHER_PRODUCT_IMAGES; ?></div>
 142                  </div>
 143                  <div class="screenshotsBlock">
 144                      <?php include (DIR_WS_MODULES . 'dynamic_mopics.php'); ?>
 145                         </div>
 146      </td>
 147        </tr>
 148  <?php
 149          //// END:  Added for Dynamic MoPics v3.000
 150  ?>
 151        <tr>
 152          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 153        </tr>
 154  <?php
 155      $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
 156      $reviews = tep_db_fetch_array($reviews_query);
 157      if ($reviews['count'] > 0) {
 158  ?>
 159        <tr>
 160          <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
 161        </tr>
 162        <tr>
 163          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 164        </tr>
 165  <?php
 166      }
 167  
 168      if (tep_not_null($product_info['products_url'])) {
 169  ?>
 170        <tr>
 171          <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
 172        </tr>
 173        <tr>
 174          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 175        </tr>
 176  <?php
 177      }
 178  
 179      if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
 180  ?>
 181        <tr>
 182          <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
 183        </tr>
 184  <?php
 185      } else {
 186  ?>
 187        <tr>
 188          <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
 189        </tr>
 190  <?php
 191      }
 192  ?>
 193        <tr>
 194          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 195        </tr>
 196        <tr>
 197          <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
 198            <tr class="infoBoxContents">
 199              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 200                <tr>
 201                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 202                  <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
 203                  <!-- Wish List 3.5 Start -->
 204                  <td align="center"><?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></td>
 205                  <!-- Wish List 3.5 End   -->
 206                  <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
 207                  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 208                </tr>
 209              </table></td>
 210            </tr>
 211          </table></td>
 212        </tr>
 213        <tr>
 214          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 215        </tr>
 216        <tr>
 217          <td>
 218  <?php
 219  
 220  //added for cross -sell
 221     if ( (USE_CACHE == 'true') && !SID) {
 222      echo tep_cache_also_purchased(3600);
 223       include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
 224     } else {
 225       include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
 226        include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
 227      }
 228    }
 229  ?>
 230          </td>
 231        </tr>
 232      </table></form>


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