Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Does anyone have experience with this template?


BullionFever

Recommended Posts

Posted

http://www.ns22.sellhost.net/indexthumbs.html

 

I am playing around with the first template in the third row, the one with the cell phones. Since this is a template that has been passed around for free for sometime, I was hoping maybe someone had some experience with it.

 

Anyway, I have been playing around with this template, adding categories and sub-categories. When I added a product, it instantly appeared on the front page. I thought, great, the front page really updates to show the four latest products. Since I'm not selling electronics, I wanted to go ahead and add 4 products so that I can see the page more how it will be. But when I added the second product, it didn't work out as planned.

 

Basically, what I was expecting was that when I added a second product, then one of the old ones would drop off the end, and the two that I had added would be displayed. That's not what happened. Instead, the second product just sort of replaced the first one I added, leaving the same three that were originally there from the old template.

 

Then I thought, maybe if I delete the old categories so that they aren't there, surely it will show the two products I just added. Wrong. Still only showing the most recent that I uploaded. I guess I could manually code the front page to show whatever four products I want, but it would be much better if it automatically showed the four most recent, especially since I'm not sure how to go about coding for the multi-lingual (still new to osc).

 

In looking at the code, the index page references a new products module. Here is the file for that module:

 

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

E-Commerce Solutions

 Copyright (c) 2005 www.flash-template-design.com

 Released under the GNU General Public License
*/
?>
<!-- new_products //-->
<tr>
<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<table width="100%" border="0" cellpadding="0" cellspacing="0" height="24">
	<tr>
		<td><img src="images/left_header.gif" width="4" height="24" alt="" /></td>
		<td width="100%" style="background-image:url(images/header_bg.gif); color:#FFF; font-weight:bold; padding-left:5px;" align="left">'.TABLE_HEADING_NEW_PRODUCTS.'</td>
		<td><img src="images/right_header.gif" width="4" height="24" alt="" /></td>			
	</tr>
</table>');

 new contentBoxHeading($info_box_contents);
?>
<div style="border:1px solid #9FA0A6;margin-top:1px; height:333px;">
<?php 
 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']);

$sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='.$new_products['products_id'].' && language_id='.(int)$languages_id;
$description_query = tep_db_query($sql);
$description = mysql_fetch_array($description_query, MYSQL_ASSOC);		
$description['products_description'] = substr($description['products_description'], 0, 65);
$desc_len = strlen($description['products_description']);
$description['products_description'][$desc_len-1] = '.';
$description['products_description'][$desc_len-2] = '.';
$description['products_description'][$desc_len-3] = '.';

if  ( ($col == 1 && $row == 0) || ($col == 1 && $row == 2) ){
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'width="1" height="100%" valign="middle"',
									   'text' => '<table height="" width="100%" border="0" cellspacing="0" cellpadding="0" >
 <tr>
<td><div style="width:1px"></div></td>
 </tr>
</table>');
}
elseif (($col == 0 && $row == 1) || ($col == 2 && $row == 1)) {
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'height="1"',
									   'text' => '<table width="90%" border="0" cellspacing="0" cellpadding="0" >
 <tr>
<td style="border-top:1px solid #A7A9AC; font-size:1px;"> </td>
 </tr>
</table>');
}
elseif ($col == 1 && $row == 1) {
$info_box_contents[$row][$col] = array('align' => '',
									   'params' => '',
									   'text' => ' ');
}
else {	
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="main" width="235"  valign="top" align="center"',
									   'text' => '<table width="235" cellpadding=0 cellspacing=0 border=0 style="margin:5px 1px 5px 0px;">
									   				<tr>
														<td colspan="2" class="productName">'.$new_products['products_name'].'</td>
													</tr>
													<tr>
														<td colspan="2" height="1" background="images/points.gif"><img src="images/points.gif" width="3" height="1" /></td>
													</tr>
													<tr>
															<td height="98" rowspan="3"><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, 'align="absmiddle"') . '</a></td>
															<td height="65" align="left">'.$description['products_description'].'</td>
													</tr>
													<tr>
														<td height="1" background="images/points.gif"><img src="images/points.gif" width="3" height="1" /></td>
													</tr>
													<tr>
														<td height="32" style="font-size:11px; font-weight:bold;">Price:<span style="color:#C70000; font-size:14px; font-weight:bold;"> ' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</span></td>
													</tr>
													<tr>		
															<td colspan="2" class="main" valign=top align="right" style="padding-right:10px; >'. tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')).'
																<table width="100%"  border="0" cellspacing="0" cellpadding="0">
																  <tr>	
																	<td style="padding-top:10px; padding-right:1px;" ><a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']).'">'.tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS).'</a></td><td style="padding-top:10px;">'.tep_draw_hidden_field('products_id', $new_products['products_id']) . tep_image_submit('button_add_to_cart.gif', IMAGE_BUTTON_BY_NOW).'</td>
																  </tr>
																</table></form>
															</td>
														</tr>
													</table>'); }


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

 }
 new contentBox($info_box_contents, 0);

?>
</div>
</td>
</tr>
<!-- new_products_eof //-->

 

It looks like it's set up to show 2 columns and 2 rows, which would be great. I'm not sure why it isn't updating and replacing the old stuff though. Does anyone see something I do not?

Posted

I recently reworked this template for a client.

 

Here is what happens with your new products of the month.

 

There are to be 4 new products of the month on the index page in two columns and two rows.

 

When you add a new product that new product is added in the first position and the oldest of the 4 is removed.

Posted

Sorry for the double post, but my edit button wasn't there any longer.

 

Ok, I went ahead and deleted 100% of all inventory that was included with the template. This left me showing only 1 product on the front page, which was still product #2.

 

I added another product, and suddenly I was showing 2 items: Prod 3 - Prod 1

 

I thought maybe it was fixed, so I added another product to see what happens. Then I had: Prod 4 - Prod 2

 

Then I thought maybe if I add more products, it would open up the second row, but all I got was: Prod 5 - Prod 3

 

It seems to only be showing 1 row across (2 colums - instead of 2 rows, 2 columns), and updating in some kind of alternating order. I'm not sure what that's all about. I've stared at this code until I feel like I'm blind and I still don't see it.

Posted
I recently reworked this template for a client.

 

Here is what happens with your new products of the month.

 

There are to be 4 new products of the month on the index page in two columns and two rows.

 

When you add a new product that new product is added in the first position and the oldest of the 4 is removed.

 

Thanks usernamenone. That was the way I understood it too, but it's not working that way for some reason. Is there a code change that needs to be done, or is my copy just behaving wrong? Maybe I should just try a fresh install, but I don't know how that could possibly help since most of what I had changed was just graphics.

Posted

Have you thought of actually contacting the person that sold you the template? You paid them, so you should expect support.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Posted
Have you thought of actually contacting the person that sold you the template? You paid them, so you should expect support.

 

If only I could. :)

 

Actually, this is a free template, so I doubt it has any support. It's probably something simple, but I'm just not seeing it.

Posted

Yeah, sorry Jerry, I just noticed that and went to edit my post.

Many apologies.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Posted
Yeah, sorry Jerry, I just noticed that and went to edit my post.

Many apologies.

 

No worries. I think I can figure this out, perhaps, maybe. If not, it's no big deal. Took a couple of hours of time and I'll move on. Not much lost, but I would like to see if I can get this one working properly.

 

No wonder they put on a tag prompting you to pay $10 if you're ready to give up and use their service. lol

Posted

Lola, thanks again for taking a look at this. I've noticed a couple of more things about this template, but I think I've got this problem narrowed down.

 

What was baffling me was that I thought the template was suppose to display the four most recent items on the front page, and that was causing me to have problems. After I broke down the php, what I've found is that this is not what the template does. What it does is to display four of the most recent (not the same as 'the four most recent'), and the way it staggers the ones selected, you don't really get all of the slots filled out until you have added 9 products.

 

It would probably be better to just display random selections, but at least this is working now, as you can see from the link I sent you. I did notice a couple of more problems. The products featured on the front page do not seem to have an 'add to cart' button that works. The button works on the product's individual page, but not on the site index. I'm not sure why that is, but it's probably not too hard to sort it out. I also noticed that the shopping cart button at the top does not seem to track the number of items - it always says 0.

 

So, I've still got a couple of things to sort out, but I at least feel like I'm moving in the right direction.

Posted

I am at a loss for why the add to cart button doesn't work on the front page. I know it is called by this snippet:

 

													
<tr>	
<td style="padding-top:10px; padding-right:1px;" ><a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']).'">'.tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS).'</a></td>
												<td style="padding-top:10px;">'.tep_draw_hidden_field('products_id', $new_products['products_id']) . tep_image_submit('button_add_to_cart.gif', Add_To_Cart).'</td>

</tr>

 

But no matter how I try to modify that, it results in getting a parse error/syntax error on the page. I even tried putting in the code from the product_info.php, which is nearly identical, and even that generated an error.

Posted

Sorry for making so many posts back-to-back. I normally like to use the edit button, but it doesn't seem to stay long on this forum so I have no choice but to make a new reply.

 

Anyway, I got the shopping cart count solved, as well as the add to cart button, so I just wanted to post the solution in case anyone hits this thread while doing a search.

 

To solve the problem with the Add To Cart buttong, locate this line in the new_products.php file:

 

<td style="padding-top:10px;">'.tep_draw_hidden_field('products_id', $new_products['products_id']) . tep_image_submit('button_add_to_cart.gif', IMAGE_BUTTON_BY_NOW).'</td>

 

Replace the code with this:

 

<td style="padding-top:10px;"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id']) . '">' . tep_image_button('button_add_to_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td>

 

Thanks to PD_Steve for that solution.

 

To solve the problem with the shopping cart count not updating, open header.php and look for:

 

<b>Shopping cart</b><br/>now in your cart <br/> 0 items<br/></td>

 

Replace with:

 

<b>Shopping cart</b><br/>now in your cart <br/> <?php echo $cart-> count_contents() ?> items<br/></td>

 

Thanks to CCTVcams for that one.

 

I still feel like the front page should be showing the four most recent instead of staggering them the way it is, but at least the page "looks" ok now. I can get enough sleep to maybe work on something more important tomorrow. Thanks to everyone for your help.

Posted

i'v seen them and was hoping it would be a easy to install but its the complete OScommerce.

 

if some one can do a how-to on how to install one of these templates to existing shop would be great.

  • 5 months later...
Posted

Hi Sorry to bump up this old post but I have the same issue, with my site template. And was wondering if you could let me know what sorted it out. At the moment I have edited in the Admin section to 10 max products, but it just shows 5 on the page. Any more and it breaks. PM me for the code if you like. Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...