X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Problem using "Display 2 prod per row" and "A (https://forum.x-cart.com/showthread.php?t=1389)

Blackhawk 02-04-2003 04:36 PM

Problem using "Display 2 prod per row" and "A
 
I put in to separate pieces of code I found on the site to fix two issues I had..

1) I put in the code in Product.tpl to display 2 products per row, and it works.. when I browse down through my categories I've got two per row with no issues.

2) I put in the code to fix the mySQL errors when you use the Advanced Search feature. Which finds the proper products with no errors now..

Now here is the problem.. with both scripts running, If I do a search that would yield 2 products.. it displays 4.. The first 2 displayed (on one row) are the two it should find.. the second 2 are both place fillers.. no product title, no price, no description.. nothing.

If I search and get 3.. It shows 6.. 3 real, 3 blank.

Anyone else have these two fixes in and had this problem??

Let me know, thanks!

ATKOgirl 02-04-2003 10:19 PM

Hi Blackhawk,

This is a little beyond my scope, but it sounds like a problem with the loop pulling the products. Can you paster your code here so we can see?

;->

ATKOgirl

deb 02-05-2003 06:27 AM

Which way are you doing your 2 products per row?

1. Smarty's 'div by 2' feature

2. The check in Smarty for an "even" number that I saw posted in just the last week or 10 days

Blackhawk 02-05-2003 06:37 AM

Div by 2
 
Smarty Div by 2... got any ideas Deb?

Blackhawk 02-05-2003 08:16 AM

This code?
 
I assumed you meant products.tpl.. I'm thinking that the way the info passes to the search engine.. that maybe the div by 2 command should be in a different place.. I mean.. browsing thru categories works fine.. its only on searches do I get the phantom doubling.

Code:

{* $Id: products.tpl,v 1.16 2002/09/25 10:12:05 zorg Exp $ *}

<table border=0 width=100%><tr><td>

<table border=0 width=100%>

{section name=product loop=$products}
{if $smarty.section.product.index is div by 2}
</tr><tr valign="top">
{/if}

<td valign="top">

<table border=0 width=100%>
<tr><td width=90 align=center valign=top>
<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=70 product=$products[product].product}
{ $lng.lbl_see_details }</a>
</td>
<td valign=top>
{$products[product].productcode | escape} - {$products[product].product|escape}</font> <font class=TableCenterProductTitleOrange></font>
<font size=1>

 

 
{$products[product].descr|truncate:300:"...":true}

 
</font>
<hr size=1 noshade width=230 align=left>
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].price ne 0}
{if $products[product].discount ne 0}
<font class=MarketPrice>{$lng.lbl_market_price}: <s>{math equation="(price/(100-discount))*100" price=$products[product].price discount=$products[product].discount format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted}</s></font>
 
{/if}
<font class=TableCenterProductTitleOrange>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].discount ne 0}, save {$products[product].discount}%{/if}
{else}
<font class=TableCenterProductTitleOrange>{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
</td>
<tr><td>
<form name=orderform_{%product.index%} method=post action="cart.php?mode=add">
<td align=left> <a href="javascript: document.orderform_{%product.index%}.submit()">
{include file="buttons/add_to_cart.tpl"}</a>
<input type=hidden name=amount value=1>
<input type=hidden name=mode value=add>
<input type=hidden name=productid value="{$products[product].productid}">
<input type=hidden name=cat value="{$smarty.get.cat}">
<input type=hidden name=page value="{$smarty.get.page}">
<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>
{* {include
file="buttons/moreinfo.tpl"}
 *}</a>
</td>
</form>
</td>
</tr>

</tr>
</table>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
</tr>
</table>

 

 

 
</td>

{/section}
</td></tr></table>
</td></tr></table>


Blackhawk 02-05-2003 08:40 PM

Help ppl!!
 
BUMP AND HELP!!

B00MER 02-06-2003 09:11 AM

Code:

{if $smarty.section.product.index is div by 2}

should be:

Code:

{if $smarty.section.products.index is div by 2}

note s in products. ;)

I think

Code:

{section name=product loop=$products}

name=product should be products as well, but give those two methods a try.

Blackhawk 02-07-2003 07:58 AM

Thanks
 
I've made the changes, but my site is so slow I can't load the front page.. I only have 2400 products, so I'm not sure why..

I've got a call in to my webhosting, but I don't think it's them.. It got slow right as I uploaded my inventory.

so.. I'll test the changes when I can get my site sped up.

Thanks!!

B00MER 02-07-2003 03:30 PM

Run a traceroute or a ping to your host and see if your getting any timeouts or high ping times, if so its your host, if not its the x-cart or mysql that is creeping along.

Blackhawk 02-07-2003 04:14 PM

Traceroute
 
I tried that.. I did get one time out..
I have called my ISP..

also, what do you consider "high"?
Most were <10ms.. some up to 15-18.. and then a few hit 88ms and one 102ms.

Blackhawk 02-07-2003 05:07 PM

Bummer
 
Quote:

should be:

Code:

{if $smarty.section.products.index is div by 2}

note s in products. ;)


This cancelled the two lines per row and still had the blanks.

Quote:

I think

Code:

{section name=product loop=$products}

name=product should be products as well, but give those two methods a try.

This cancelled all the searches and filled it with all blanks...

:cry:
Thx for trying... any other ideas?

TelaFirma 02-08-2003 03:36 AM

The proper code is
Code:

{section name=product loop=$products}
{if $smarty.section.product.index is div by 2}


The problem is going to be in your search code and template, not your products.tpl file

Blackhawk 02-08-2003 05:51 AM

Guessing..
 
I guess it would be in search results since it happens on both Search and Advanced Search and they both call search results..

{* $Id: search_result.tpl,v 1.10 2002/10/11 12:43:43 ambal Exp $ *}
{ include file="location.tpl" last_location=$lng.lbl_search_results}
{include file="customer/main/navigation.tpl"}
{capture name=dialog}
{include file="customer/main/products.tpl"}
{/capture}
{if $smarty.capture.dialog ne ""}
{include file="dialog.tpl" title=$lng.lbl_search_results content=$smarty.capture.dialog extra="width=100%"}
{else}
{include file="dialog.tpl" title=$lng.lbl_search_results content="No matching products found" extra="width=100%"}
{/if}
{include file="customer/main/navigation.tpl"}

Blackhawk 02-09-2003 08:07 PM

HELP!
 
I've tried everything I can think of including adding all those "S"s Boomer suggested and no luck..

Any seen this one before?

TelaFirma 02-10-2003 03:31 AM

Post the fis that you make to your search that you talked about in your first post.

Blackhawk 02-10-2003 05:57 AM

FIS?
 
What is FIS?

TelaFirma 02-10-2003 11:12 AM

Sorry.... I ment to type "Post the FIX that you made to the search". My dog jumped on my mouse while i was posting.

Blackhawk 02-10-2003 11:57 AM

Fixes
 
I put in this fix from the Bugs/Fixes that fixes the sql errors on the advanced search due to sort by price..

{* $Id: advanced_search.tpl,v 1.3 2002/10/08 12:01:17 alfiya Exp $ *}
{include file="location.tpl" last_location=$lng.lbl_advanced_search}
{capture name=adv_search}
<table border=0>
<form action="search.php" name="productsearchbyprice_form">
<tr>
<td>{$lng.lbl_product_title}</td>
<td>
<input type="text" name="substring" size="30" value="{$smarty.get.substring}">
</td>
</tr>
<tr><td>{$lng.lbl_price}, {$config.General.currency_symbol}</td>
<td><input type="text" name="price_search_1" size="6" value="{$smarty.get.price_search_1|escape}"> - <input type="text" name="price_search_2" size="6" value="{$smarty.get.price_search_2|escape}"></td></tr>
<tr><td>{$lng.lbl_category}</td>
<td>
<select name="in_category">
<option value="">All</option>
{section name=cat_num loop=$categories}
<option value="{ $categories[cat_num].categoryid}" {if $smarty.get.in_category eq $categories[cat_num].categoryid or $cat eq $categories[cat_num].categoryid}selected{/if}>{$categories[cat_num].category|escape}</option>
{/section}
</select>
</td>
</tr>
<tr><td></td></tr>
<tr><th>{include file="buttons/search.tpl"}</th></tr>
</form>
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_advanced_search content=$smarty.capture.adv_search extra="width=100%"}


Then I put in the modification to products.tpl to display 2 items per row.. that is in the fixes section also..

{* $Id: products.tpl,v 1.16 2002/09/25 10:12:05 zorg Exp $ *}

<table border=0 width=100%><tr><td>

<table border=0 width=100%>

{section name=product loop=$products}
{if $smarty.section.product.index is div by 2}
</tr><tr valign="top">
{/if}

<td valign="top">

<table border=0 width=100%>
<tr><td width=90 align=center valign=top>
<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{in clude file="product_thumbnail.tpl" productid=$products[product].productid image_x=70 product=$products[product].product}
{ $lng.lbl_see_details }</a>
</td>
<td valign=top>
{$products[product].productcode | escape} - {$products[product].product|escape}</font> <font class=TableCenterProductTitleOrange></font>
<font size=1>




{$products[product].descr|truncate:300:"...":true}


</font>
<hr size=1 noshade width=230 align=left>
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].price ne 0}
{if $products[product].discount ne 0}
<font class=MarketPrice>{$lng.lbl_market_price}: <s>{math equation="(price/(100-discount))*100" price=$products[product].price discount=$products[product].discount format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted}</s></font>

{/if}
<font class=TableCenterProductTitleOrange>{$lng.lbl_our_ price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].discount ne 0}, save {$products[product].discount}%{/if}
{else}
<font class=TableCenterProductTitleOrange>{$lng.lbl_ente r_your_price}</font>
{/if}
{/if}
</td>
<tr><td>
<form name=orderform_{%product.index%} method=post action="cart.php?mode=add">
<td align=left> <a href="javascript: document.orderform_{%product.index%}.submit()">
{include file="buttons/add_to_cart.tpl"}</a>
<input type=hidden name=amount value=1>
<input type=hidden name=mode value=add>
<input type=hidden name=productid value="{$products[product].productid}">
<input type=hidden name=cat value="{$smarty.get.cat}">
<input type=hidden name=page value="{$smarty.get.page}">
<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>
{* {include
file="buttons/moreinfo.tpl"}
*}</a>
</td>
</form>
</td>
</tr>

</tr>
</table>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
</tr>
</table>






</td>

{/section}
</td></tr></table>
</td></tr></table>

Let me know if you have any ideas... I'm stuck and no one else seems to want to help me besides you.

Blackhawk 02-13-2003 09:07 AM

HELP`
 
Desperate bump.

Blackhawk 02-18-2003 06:28 AM

Help
 
Anyone still there?

TelaFirma 02-24-2003 09:32 AM

My suggestion would be to upgrade to 3.3.3 . The Advanced search works for me in that version with no problem. Then all you need is to use the two column product display mod.

Blackhawk 02-24-2003 09:48 AM

Upgrading
 
I heard upgrading is very hard and time consuming and I haven't even gotten my site running yet..

I'm on 3.3.1 isn't it hard to upgrade?

B00MER 02-24-2003 04:21 PM

3.3.1 fix for the advanced search price range and sku search mod:

:arrow: http://forum.x-cart.com/viewtopic.php?t=1595

Blackhawk 02-24-2003 04:31 PM

Hehe
 
We had this discussion Boomer, remember..

I have the 3.3.1 Fix in already, and combined with the 2 prod/row fix gives me the blanks.

B00MER 02-24-2003 04:55 PM

More than likely the problem lies within your .tpl's have you tried restoring the original tpl just to see if the data displays?

Blackhawk 02-24-2003 07:32 PM

Gonna do that now.
 
Gonna do that now.


All times are GMT -8. The time now is 02:25 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.