Reply to topic
Putting products in Columns
mATOK


Joined: 16 Aug 2005
Posts: 1
Reply with quote
Hey there... I'd like so that when a user clicks a category they are presented with my merchandise but in two or three columns... right now everything is in one.

How do I do this? Do I need to add modules???
Re: Putting products in Columns
jmh


Joined: 18 Jun 2005
Posts: 50
Location: Dallas, TX
Reply with quote
mATOK wrote:
Hey there... I'd like so that when a user clicks a category they are presented with my merchandise but in two or three columns... right now everything is in one.

How do I do this? Do I need to add modules???


Yes. I would suggest OpenUI Look and Feel Basic and Category Page Templates from Viking Coders. Both will do what you want and much more. If you want to customize other screens as well, be sure to checkout Viking's other template modules.

Jason
JMH
Re: Putting products in Columns
tbrightbill


Joined: 01 Oct 2005
Posts: 1
Reply with quote
mATOK wrote:
Hey there... I'd like so that when a user clicks a category they are presented with my merchandise but in two or three columns... right now everything is in one.?


If you're using Miva 5, you can do that by customizing Miva's template code.

Go to Stores -> Your Store -> Pages -> Items -> product_display -> Edit

You can modify the code to something like this:

Code:

<table border=0 cellpadding=2 cellspacing=0>
<tr>
  <mvt:foreach iterator="product" array="products">
  <td width="45%" align="center" 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: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;">&mvt:product:name;</a><br>
      Code: <b>&mvt:product:code;</b><br>
      Price: <b>&mvt:product:formatted_price;</b><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>
      <br>
      <mvt:if expr="l.settings:product:inv_level NE 'out'">
      <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="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" />
        </mvt:item>
      <mvt:else>
        &nbsp;
      </mvt:if>
      </form>
      <br>
      <form method="post" action="&mvt:global:secure_sessionurl;">
        <mvt:item name="fonts" param="body_font">
        <input type="hidden" name="Action" value="ADPR">
        <input type="hidden" name="Product_Code" value="&mvte:product:code;">
        <input type="hidden" name="Quantity" value=1>
        <input type="hidden" name="Screen" value="OINF">
        <input type="hidden" name="Attributes" value="Yes">
        <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;">
        <mvt:item name="buttons" param="Buy1Now" />
        </mvt:item>
      </form>
  </td>

  <mvt:if expr = "(pos1 MOD 2 ) EQ 0">
    </tr>
    <tr>
      <td><br><br><br></td>
    </tr>
  <mvt: else>
    <td width="10%">&nbsp;</td>
  </mvt:if>

</mvt:foreach>
</table>

<mvt:if expr="g.Offset OR g.NextOffset">
  <br>
  <table border="2" width="90%" align="center">
  <tr>
  <mvt:if expr="g.Offset EQ 0">
    <td>&nbsp;</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>&nbsp;</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>



If you want more columns, edit the line

Code:

<mvt:if expr = "(pos1 MOD 2 ) EQ 0">
mbistro


Joined: 20 Sep 2006
Posts: 1
Reply with quote
Thank you tbrightbill, your code works great! However, in MIVA 5, here is the path I had to follow:

Stores > [Your Store Name] > Pages > CTGY [EDIT] > Category Product List Layout > Advanced Mode

Then I just replaced that code with yours. Also, changing the number of columns works too, by altering what comes after "MOD" in:

Code:
<mvt:if expr = "(pos1 MOD 2 ) EQ 0">


One minor issue I had was when I set it to 3 columns, the 3rd column didn't align properly, it was slightly skewed. However, at 4 columns, all are perfectly straight.
zimboden


Joined: 22 Sep 2006
Posts: 2
Location: Portland, OR
Reply with quote
THanks for that codefor multiple columns. I'm new to MIVA and it solved an immediate problem for me and also gave me a conceptual leap forward in MIVA script. Of the resources that are out there for MIVA script, is there one you recommend over the others?
Putting products in Columns
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic