Jump to content

Latest products display fix


goober999

Recommended Posts

Guest Terry Rogers

No worrys now, I found the problem.

Needed to remove <!-- BEGIN: repeat_prods --> from in between these two lines ...

<div>

<!-- BEGIN: repeat_prods -->

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

And also remove <!-- END: repeat_prods --> from between these two lines ...

</tr></table>

<!-- END: repeat_prods -->

<br clear="all" />

Link to comment
Share on other sites

  • 2 weeks later...

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

Guest muratuk

Hi,

Here's a fix for the latest products display problem. The problem is that the display is not setup to show a specific number of products across. And the <div> tags kind of go crazy and mess up the display.

Here's a fix that will enable you to specify number of products to display across and will fix the line up issue.

In the includes/content/index.inc.php find this line:

for($i=0;$i<count($latestProducts);$i++){


Replace with this code


	$across=4;

	$index->assign("TW",100/$across);

	for($i=0;$i<count($latestProducts);$i++){

	if (!(($i+1) % $across)) {

    $index->assign("TXT_TR","</tr><tr>");

	} else {

    $index->assign("TXT_TR","");

	}


in skins/{insert skin name}/styleTemplates/content/index.tpl replace all code

between 
<!-- BEGIN: repeat_prods -->
 and 
<!-- END: repeat_prods -->
 including those two lines above with this code


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

  <!-- BEGIN: repeat_prods -->

  <td width="{TW}%">

    <div style="float: center; text-align: center;">

    	<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

    	<br />

    	<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

    	<br /> 

    	{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

    </div>

  	</td>

  	{TXT_TR}

  <!-- END: repeat_prods -->

  </tr></table>

The $across variable is used to specify number products across.

That's it. Good Luck

with this code everything is ok but only you have change <tr> code to </td> then works super. original should be that. if you use <tr> your latest products displays will be mess but if you change to </td> work super.

<table width="100%" border="0"></td>

Link to comment
Share on other sites

Guest muratuk

Hi all,

Not sure if any one can help. Ive applied this fix to sort out my latest products display, but after applying it my latest products disapear...

The code for index.tpl is ...

<!-- BEGIN: index -->

<div class="boxContent">

<span class="txtContentTitle">{HOME_TITLE}</span>

<br />

{HOME_CONTENT}

</div>

<!-- BEGIN: latest_prods -->

	<div class="boxContent">

	<span class="txtContentTitle">{LANG_LATEST_PRODUCTS}</span>

		<div>

		<!-- BEGIN: repeat_prods -->

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

<!-- BEGIN: repeat_prods -->

<td width="{TW}%">

<div style="float: center; text-align: center;">

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

<br />

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

<br />

{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

</div>

</td>

{TXT_TR}

<!-- END: repeat_prods -->

</tr></table>

		<!-- END: repeat_prods -->

		<br clear="all" />

		</div>

		<br clear="all" />

		

		

	</div>

<!-- END: latest_prods -->

<!-- END: index -->

Have I done something wrong?

Website for the cart is http://www.tiffanychrister.me.uk/shop

as i said i code should be <table width="100%" border="0"></td>

not <table width="100%" border="0"><tr>

if you put <tr> your images will be all around the page or only one line but if you replace <tr> to </td> works well.

Link to comment
Share on other sites

Guest shannonlp

Goober thanks for this fix it works well. I have been keeping my site W3C valid. With the orginal code it will fail validation.

<!-- BEGIN: repeat_prods -->

<td width="{TW}%">

<div style="float: center; text-align: center;">

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

<br />

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

<br />

{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

</div>

</td>

{TXT_TR}

<!-- END: repeat_prods -->

<td></td></tr></table>

You must add the <td></td>. A <tr></tr> will fail validation without having the <td></td> inside of them. So basically it should look like. <tr><td></td></tr>

Hope this helps anyone that is needing to figure this out.

Link to comment
Share on other sites

  • 3 months later...
Guest purpledragon

My latest products box disappears.

I am a total newbie to all this so will probably have done something wrong and I know I still have lots of other issues to fix on the page so maybe they are causing the problem B) , I dont know ? Please can someone help me.

I did what muratuk said about changing the <tr> to </td> after trying what goober999 said to do but it didn't help or seem to change it at all.

Thanks everyone for you patience :)

the link is here

killer skin, IE6 (doesnt work on firefox yet)

Link to comment
Share on other sites

  • 3 weeks later...
Guest Mikes Web Dot Org

Hi,

Here's a fix for the latest products display problem. The problem is that the display is not setup to show a specific number of products across. And the <div> tags kind of go crazy and mess up the display.

Here's a fix that will enable you to specify number of products to display across and will fix the line up issue.

In the includes/content/index.inc.php find this line:

for($i=0;$i<count($latestProducts);$i++){


Replace with this code


	$across=4;

	$index->assign("TW",100/$across);

	for($i=0;$i<count($latestProducts);$i++){

	if (!(($i+1) % $across)) {

    $index->assign("TXT_TR","</tr><tr>");

	} else {

    $index->assign("TXT_TR","");

	}


in skins/{insert skin name}/styleTemplates/content/index.tpl replace all code

between 
<!-- BEGIN: repeat_prods -->
 and 
<!-- END: repeat_prods -->
 including those two lines above with this code


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

  <!-- BEGIN: repeat_prods -->

  <td width="{TW}%">

    <div style="float: center; text-align: center;">

    	<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

    	<br />

    	<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

    	<br /> 

    	{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

    </div>

  	</td>

  	{TXT_TR}

  <!-- END: repeat_prods -->

  </tr></table>

The $across variable is used to specify number products across.

That's it. Good Luck

Thanks so much. it worked.

My store is coming along nicely. :)

GOD Bless!

MWDO

Link to comment
Share on other sites

  • 3 weeks later...
Guest lauriex

Hi,

Here's a fix for the latest products display problem. The problem is that the display is not setup to show a specific number of products across. And the <div> tags kind of go crazy and mess up the display.

Here's a fix that will enable you to specify number of products to display across and will fix the line up issue.

In the includes/content/index.inc.php find this line:

for($i=0;$i<count($latestProducts);$i++){


Replace with this code


	$across=4;

	$index->assign("TW",100/$across);

	for($i=0;$i<count($latestProducts);$i++){

	if (!(($i+1) % $across)) {

    $index->assign("TXT_TR","</tr><tr>");

	} else {

    $index->assign("TXT_TR","");

	}


in skins/{insert skin name}/styleTemplates/content/index.tpl replace all code

between 
<!-- BEGIN: repeat_prods -->
 and 
<!-- END: repeat_prods -->
 including those two lines above with this code


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

  <!-- BEGIN: repeat_prods -->

  <td width="{TW}%">

    <div style="float: center; text-align: center;">

    	<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" /></a>

    	<br />

    	<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

    	<br /> 

    	{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

    </div>

  	</td>

  	{TXT_TR}

  <!-- END: repeat_prods -->

  </tr></table>

The $across variable is used to specify number products across.

That's it. Good Luck

Thanks so much. it worked.

My store is coming along nicely. :blink:

GOD Bless!

MWDO

P L E A S E H E L P !!!

I have a similar problem on my Sales Items pages - all other pages are fine. On the Sales Items, text disappears, products bump to next row, etc. and the display oddities vary from pg 1 to 5. I am using CC v3.0.15 and viewing in IE6 and IE7.

Link to comment
Share on other sites

  • 4 months later...
Guest wirebuy

I have applied the latest products display fix and it has worked perfect with one exception. All of my in the latest_products box seem to have the vertical-align option set to "center", therefore, my products look kinda messed up when the page is loaded as the products description can vary in length substancially. I have been working for hours trying to find a way in the CSS, templates, and even the PHP code where I can change the vertical-align to "top", but this option does not seem to exist anywhere, and even when I add it in what I believe would be the proper location in the CSS or template, it still does not work. Someone please help me, it is driving me nuts :unsure: .

Thank You

-Sean

Link to comment
Share on other sites

Guest eric47905

Thanks Goober for listing that quick fix out.

I know it's an oldie, but I just came to the point where I needed it, did a search and BAM there it was. Worked like a charm on the first try!

:errm:

Link to comment
Share on other sites

  • 2 weeks later...
Guest cdtronix

Hi can anyone tell me how to sort the products out by price, being ascending order.

Eg

£1

£5

£10

etc

At the moment im not sure how they are sorted, they are all over the place. see what i mean here

My Webpage

Link to comment
Share on other sites

  • 5 weeks later...
  • 1 month later...
Guest aliceaod

Thanks to all who contributed to the latest products row display fix. Problem now sorted. Good work.

OK kids, here it goes, probably beating a dead horse here but I gotta ask...I got the latest version of CubeCart, everything displays in the Latest Products just fine out of the box EXCEPT for the vertical alignment, unless a person wants the items aligned to the top, then it's perfect out of the box, no tweaking necessary.

I, however, would like my "Latest Products" items to align to the bottom of the row they appear in. I have it set for 12 items which returns 4 colums and 3 rows and they appear just fine across and down. No problems with that. The rows and columns are good out of the box. I just want each item to align to the bottom of their respective places.

How do I accomplish this with the latest version of CubeCart with the "KILLER" skin applied? Which of the instructions, posted since 2005, do I use? Can someone "re-cap" this post ('cos I'm totally lost now) or submit instructions for the newest stuff? Any help MUCH appreciated! :(

UPDATE: I figured out a way to get everything to align nicely and neatly. In the content/index.tpl, where the image gets displayed for the "latest products" , I put in the attribute of height="75" in the img tag and voila, fixed.

Link to comment
Share on other sites

  • 1 year later...

Hi

I have been trying to aglin my products in "the latest products" but I cannot find the line to change

(i.e <div style="float: left; text-align: center; width: {VAL_WIDTH}px; height: 150px;">)

this is the code I have on skins/killer/styleTemplates/content/index.tpl

<!-- BEGIN: index -->

<div class="boxContent">

<span class="txtContentTitle">{HOME_TITLE}</span>

<br />

{HOME_CONTENT}

</div>

<!-- BEGIN: latest_prods -->

<div class="boxContent">

<div class="txtContentTitle">{LANG_LATEST_PRODUCTS}</div>

<div style="margin-top: 10px;">

<!-- BEGIN: repeat_prods -->

<div class="latestProds">

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}"><img src="{VAL_IMG_SRC}" alt="{VAL_PRODUCT_NAME}" border="0" title="{VAL_PRODUCT_NAME}" /></a>

<br />

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}" class="txtDefault">{VAL_PRODUCT_NAME}</a>

<br />

{TXT_PRICE} <span class="txtSale">{TXT_SALE_PRICE}</span>

</div>

<!-- END: repeat_prods -->

<br clear="all" />

</div>

<br clear="all" />

</div>

<!-- END: latest_prods -->

<!-- END: index -->

-----------------------------------------------------------------------------------

Can anyone help me, I have searched and searched

Kind Regards,

proweb :(

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

In my experience, those symbols represent Firefox's inability to show the character from some unknown font or character set. I'm just guessing here, but the file may be in a UTF-8 or UTF-16 configuration and the extended character code may be beyond Firefox's ability to figure out what to draw (or 'do' if control codes) for those characters.

Your editor may be having the same problem, but indicates it differently.

Can your editor show you the binary/hex variant of that file?

Link to comment
Share on other sites

  • 3 months later...

Great fix, it has resolved the issue, even though it has changed the latest products from horizontal to vertical. How can I apply this fix so that it changes it back to horizontal, but still resolving the issue where it chops off the bottom of the pitcure within Firefox only

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
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...