View Full Version : Need help in customized display of categories
Hi,
I had a query regarding MIVA display of categories
MIVA by default shows category / Product list one below the other LIKE:-
Shoes
Shirts
T-Shirts
Caps
..........
But i want to display it as:-
Shoes Shirts
T-Shirts Caps
...................
Is it possible for me to change this interface thru admin.
or i have to use any Modules provided by MIVA/ other company.
Can i change the code by myself.
Regards,
Mandar
Bruce - PhosphorMedia
07-15-06, 08:49 AM
No modules needed. In the Category Product List Layout section of the Category page (CTGY), switch to Advanced Mode and just use the following code:
<mvt:if expr="l.settings:product_count EQ 0">
<mvt:exit />
</mvt:if>
<table border=0 cellpadding=2 cellspacing=0 width=500>
<tr><td colspan="3" align="center">
<br>
</td></tr>
<tr>
<mvt:foreach iterator="product" array="products">
<td align="center" valign="bottom">
<mvt:if expr="NOT ISNULL l.settings:product:thumbnail">
<a href="&mvt:global:sessionurl;Screen=PROD&Store_Code=&mvta:store:code;&Product_Code=&mvta:product:code;&Category_Code=&mvta:category:code;"><img src="&mvte:product:thumbnail;" border=0></a>
<mvt:else>
</mvt:if>
<br>
<mvt:item name="fonts" param="body_font">
<a href="&mvt:global:sessionurl;Screen=PROD&Store_Code=&mvta:store:code;&Product_Code=&mvta:product:code;&Category_Code=&mvta:category:code;"><u>&mvt:product:name;</u></a><br>
&mvt:product:formatted_price;
</mvt:item>
</td>
<mvt:if expr = "(pos1 MOD 2 ) EQ 0">
</tr><tr><td colspan=3><HR width="100%" color=#cccccc SIZE=1></td></tr>
<tr>
</mvt:if>
</mvt:foreach>
</tr>
</table>
<mvt:if expr="g.Offset OR g.NextOffset">
<br>
<table border=0 width="90%" align="center">
<tr>
<mvt:if expr="g.Offset EQ 0">
<td> </td>
<mvt:else>
<td align="left">
<mvt:item name="fonts" param="body_font">
<form method="post" action="&mvt:global:sessionurl;">
<input type="hidden" name="Screen" value="&mvte:global:Screen;">
<input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;">
<input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
<input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;">
<input type="hidden" name="Search" value="&mvte:global:Search;">
<input type="hidden" name="Offset" value="&mvte:global:PrevOffset;">
<mvt:item name="buttons" param="Previous" />
</form>
</mvt:item>
</td>
</mvt:if>
<mvt:if expr="g.NextOffset EQ 0">
<td> </td>
<mvt:else>
<td align="right">
<mvt:item name="fonts" param="body_font">
<form method="post" action="&mvt:global:sessionurl;">
<input type="hidden" name="Screen" value="&mvte:global:Screen;">
<input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;">
<input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
<input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;">
<input type="hidden" name="Search" value="&mvte:global:Search;">
<input type="hidden" name="Offset" value="&mvte:global:NextOffset;">
<mvt:item name="buttons" param="Next" />
</form>
</mvt:item>
</td>
</mvt:if>
</tr>
</table>
</mvt:if>
Thnx Bruce - PhosphorMedia (http://extranet.miva.com/forums/member.php?u=35)
Just trying Code... :)
aarcmedia
07-20-06, 08:42 PM
Bruce,
I've been trying to get that 2 per row layout to work, but show the "Add To Cart" button as well as the quantity text field so they can specify how many they want to add to the cart right from the cats page.
Is there an easy way to do this that i'm missing. I tried adding those parts in based of the more basic code you've provided here, but keep getting an error.
Bruce - PhosphorMedia
07-20-06, 09:11 PM
Add the following where you want the form to show up:
<form method="post" action="&mvt:global:sessionurl;">
<mvt:item name="fonts" param="body_font">
<input type="hidden" name="Action" value="ADPR">
<input type="hidden" name="Screen" value="&mvte:global:Screen;">
<input type="hidden" name="Attributes" value="Yes">
<input type="hidden" name="Store_Code" value="&mvte:store:code;">
<input type="hidden" name="Offset" value="&mvte:global:Offset;">
<input type="hidden" name="Product_Code" value="&mvte:product:code;">
<input type="hidden" name="Current_Product_Code" value="&mvte:global:Product_Code;">
<input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
<input type="text" name="Quantity" value="">
<mvt:item name="buttons" param="AddToBasket" />
</form>
For example, after &mvt:product:formatted_price;
(HINT: set the opening table border to 1 to see the actual layout created)
aarcmedia
07-21-06, 07:37 PM
Thanks, that worked. Last question (i swear). Can't seem to find a thread in the forum that includes code (like in this post) about setting up the categories to go 3 across.
Vic - WolfPaw Computers
07-21-06, 07:44 PM
I just posted links to the MIVA Demo store earlier today that has that code in the CTGY template in admin.
aarcmedia
07-21-06, 07:51 PM
And I just found it. Thanks guys.
Bruce - PhosphorMedia
07-22-06, 12:09 AM
Either that, or just change:
<mvt:if expr = "(pos1 MOD 2 ) EQ 0">
to
<mvt:if expr = "(pos1 MOD 3 ) EQ 0">
from the above code<G>
username
07-31-06, 11:00 PM
How about this one. Instead of the normal layout below:
Image Prodname
Code
Price
Qty in Basket
Buttons
How can we have it like this:
Image Prodname Price Qty in Basket
Code Add 1 to Cart
Been playing with the code but the mvt tags (if, else, etc) are just scattered too much.
Thanks
username
07-31-06, 11:37 PM
Or is there a list that shows this is the code for let say "product price" or the code for "quantity in basket", etc.
Pete McNamara
08-01-06, 12:50 AM
How can we have it like this:
Change the product display table from 2 columns to 4 columns then just cut and paste the items in the product display template into whatever column you want.
username
08-01-06, 12:54 AM
Hey Pete.
I tried out something. You can see it here:
http://evergreensalesusa.com/mm5/merchant.mvc?Screen=CTGY&Store_Code=01&Category_Code=Comedy
Can you please check quickly if I pasted the items completely/properly/etc.
I actually already had the idea of just making my own 4 column layout and just pasting the miva items but some of them are in between other html stuff.
One thing I am worried about is I now have 2 </mvt:foreach> tags. Miva was forcing me to have another one. It is located below
<tr><td colspan=5 height="1"> <hr width="100%" size="1" noshade="noshade" /></td></tr>
Pete McNamara
08-01-06, 01:06 AM
Of course I can't see your template code but everything looks OK in the browser source code. I tested it by adding items to the basket and they added OK so everything seems to be working fine.
username
08-01-06, 01:15 AM
<table border=0 cellpadding=2 cellspacing=0 width="600">
<mvt:foreach iterator="product" array="products">
<tr><td colspan=5>
<br>
</td></tr>
<tr><td width="8" align="left" valign="top"></td>
<td align="left" valign="top">
<mvt:if expr="NOT ISNULL l.settings:product:thumbnail">
<a href="&mvt:global:sessionurl;Screen=PROD&Store_Code=&mvta:store:code;&Product_Code=&mvta:product:code;&Category_Code=&mvta:category:code;"><img src="&mvte:product:thumbnail;" border=0></a>
<mvt:else>
</mvt:if>
</td><td align="left" valign="top">
<mvt:item name="fonts" param="body_font">
<a href="&mvt:global:sessionurl;Screen=PROD&Store_Code=&mvta:store:code;&Product_Code=&mvta:product:code;&Category_Code=&mvta:category:code;" class="prodname">&mvt:product:name;</a><br>
<mvt:if expr="l.settings:product:inv_active">
&mvt:product:inv_long;<br>
</mvt:if>
Quantity in Basket:
<mvt:if expr="l.settings:product:quantity EQ 0">
<i>none</i>
<mvt:else>
<b>&mvt:product:quantity;</b></mvt:if>
<br>
</mvt:item>
</td><td align="left" valign="top"><b><font color="red">&mvt:product:formatted_price;</font></b></td>
<td align="left" valign="top"><form method="post" action="&mvt:global:sessionurl;">
<input type="hidden" name="Action" value="ADPR">
<input type="hidden" name="Screen" value="&mvte:global:Screen;">
<input type="hidden" name="Quantity" value=1>
<input type="hidden" name="Attributes" value="Yes">
<input type="hidden" name="Store_Code" value="&mvte:store:code;">
<input type="hidden" name="Offset" value="&mvte:global:Offset;">
<input type="hidden" name="Product_Code" value="&mvte:product:code;">
<input type="hidden" name="Current_Product_Code" value="&mvte:global:Product_Code;">
<input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
<mvt:item name="buttons" param="Add1ToBasket" />
</form></td>
</tr>
<mvt:if expr="l.settings:product:inv_level NE 'out'">
<tr><td colspan=5 height="1"> <hr width="100%" size="1" noshade="noshade" /></td></tr>
</mvt:foreach>
</mvt:foreach>
</table>
<mvt:if expr="g.Offset OR g.NextOffset">
<br>
<table border="0" width="90%" align="center">
<tr>
<mvt:if expr="g.Offset EQ 0">
<td> </td>
<mvt:else>
<td align="left">
<mvt:item name="fonts" param="body_font">
<form method="post" action="&mvt:global:sessionurl;">
<input type="hidden" name="Screen" value="&mvte:global:Screen;">
<input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;">
<input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
<input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;">
<input type="hidden" name="Search" value="&mvte:global:Search;">
<input type="hidden" name="Offset" value="&mvte:global:PrevOffset;">
<mvt:item name="buttons" param="Previous" />
</form>
</mvt:item>
</td>
</mvt:if>
<mvt:if expr="g.NextOffset EQ 0">
<td> </td>
<mvt:else>
<td align="right">
<mvt:item name="fonts" param="body_font">
<form method="post" action="&mvt:global:sessionurl;">
<input type="hidden" name="Screen" value="&mvte:global:Screen;">
<input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;">
<input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
<input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;">
<input type="hidden" name="Search" value="&mvte:global:Search;">
<input type="hidden" name="Offset" value="&mvte:global:NextOffset;">
<mvt:item name="buttons" param="Next" />
</form>
</mvt:item>
</td>
</mvt:if>
</tr>
</table>
</mvt:if>
There is are two </mvt:foreach> in my code. Miva was saying this error when there was just only one of them:
Error Line 2: mvt:foreach iterator has no close mvt.foreach.
Pete McNamara
08-01-06, 01:35 AM
I only had time for a quick look. I think the second is required because of this row:
<tr><td colspan=5>
<br>
</td></tr>
username
08-01-06, 01:40 AM
Ok. Thanks for checking it up.
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.