Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Template merge with Feature sets


knokenet

Recommended Posts

Hello!

 

I've installed this great contribution, and all works perfectly.

However (There's always one...), I use an OS template that presents the products in a different way than in feature sets.

as I'd like to maintain my current look, I'd like to merge the feature set code with my template. I've made some attempts, and succeeded to get the graphics right, but not to get data from database.

 

Can anyone help?

 

Here's my template file:

 

<?php
/*
 $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

$side = '_center';

?>
<!-- new_products //-->
<?php
//  $info_box_contents = array();
//  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

//  new contentBoxHeading($info_box_contents);

 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
   $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
   $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

 $row = 0;
 $col = 0;
 $info_box_contents = array();
 while ($new_products = tep_db_fetch_array($new_products_query)) {
   $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
   $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="50%" valign="top"',
                                          'text' => '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="182" STYLE="background: url(images/design/bg_center_product.gif) repeat-y left top;">
                                                                                  <TR><TD COLSPAN="3" HEIGHT="26" ALIGN="center" VALIGN="middle" STYLE="background: url(images/design/bg_top_product.gif) no-repeat left top; padding-left: 20px; padding-right: 18px;">
                                                                                  <a class="productTitle" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>
                                                                                  </TD></TR>
                                                                                  <TR><TD COLSPAN="3" ALIGN="center" VALIGN="top"><br>
                                                                                  <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><br>
                                                                                  </TD></TR>
                                                                                  <TR>
                                                                                  <TD ALIGN="center" VALIGN="middle" WIDTH="80" HEIGHT="30">
                                                                                  <a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY) . '</a>
                                                                                  </TD>
                                                                                  <TD ALIGN="center" VALIGN="middle" WIDTH="96" HEIGHT="30" STYLE="background: url(images/design/bg_price_product.gif) no-repeat left top; color: #8A3410; font-size: 17px; font-family: Tahoma;">
                                                                                  <b>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</b>
                                                                                  </TD>
                                                                                  <TD WIDTH="6" HEIGHT="30"> </TD>
                                                                                  </TR>
                                                                                  <TR><TD COLSPAN="3"><img src="images/design/bg_bottom_product.gif"></TD></TR>
                                                                                  </TABLE>');

   $col ++;
   if ($col > 1) {
     $col = 0;
     $row ++;
   }
 }

 new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->

 

Test site is here.

You can see the template at the top, and the featured sets at the bottom.

Link to comment
Share on other sites

i am not answering on the post, just a comment on the look. to me, i had a negative feeling while the page was loading, from the logo. just a personal preference.

on another note, why not leave the powered by osCommerce in there?

these guys have done a great job with the application, just because you use osCommerce is no reason to be ashamed of showing that to people.

i leave that on all the sites i develop.

Link to comment
Share on other sites

Yep I agree no powered by oscommerce no help, bit sad really he chose to change this to powered by someone else? weird seeing as they didnt construct the core just bought a template and installed.

Anyways no way any help.

Link to comment
Share on other sites

Yep I agree no powered by oscommerce no help, bit sad really he chose to change this to powered by someone else? weird seeing as they didnt construct the core just bought a template and installed.

Anyways no way any help.

 

 

Hello all,

I didn't expect to be flamed here....

The 'powered by' is my signing on all my websites. I didn't mean to "steal" the credits from oscommerce, ofcourse.

I understand that it may have offended the forum members, and I can understand why, and apologize for that. Really, there was no intention of offence..

 

I have changed back the credits, and they will stay there.

If still you'd rather not give a hand, I'll understand...

 

Lesson learnt :blush:

Link to comment
Share on other sites

Elwyn:  What is all this about "no powered by oscommerce - no help".  The only rule about the "powered by" statement is that one must show it in order to have their site reviewed in the "My Store" Forum.  Have you misunderstood this rule, or is it something that you personally apply in all cases?

Knokenet:  As for the problem, I can't help as I have never used the featured sets contribution.  Having thought about, you could try using "beyondcompare" to diff the two files to see what you need to change in one to match the other?

 

OnionCream:  Are you talking about the STS template contribution.

 

 

Thanks Burt...

This is not the STS contrib, but a special made design, so comparing the files won't help.

What I lack is database data retrieval. For example: my template uses :

<a  href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>

to retrieve product name, whereas featured sets uses:

<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '"></a>

 

I tried to make some changes according to this, but data didn't appear, so there's must be something i'm missing...

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...