Announcement

Collapse
No announcement yet.

Displaying Custom Product Fields on a sub-sub-category page

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Displaying Custom Product Fields on a sub-sub-category page

    This may get convoluted because the code I need to fix right now uses the Toolkit to create the product listing but I also need this to work without the Toolkit snippets. I've tried adapting the Toolkit "custom" snippet but what I'm doing doesn't seem to work. This is the code that I have on a category page template that pulls in products from the sub-sub-categories (grandchild) of the parent:



    Code:
        <div class="line-item">
          <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />
    <mvt:if expr="ccount GT 0">
            <mvt:foreach iterator="sub_category" array="sub_categories">  
           <h2 style="margin-bottom:4px; padding-left:10px; padding-top:30px; font-family:Arial, Helvetica, sans-serif; font-size:16px; border-bottom: solid #000 2px;">&mvt:sub_category:name;</h2>
            <a name="&mvt:sub_category:code;"></a>
            <!-- Begin Sub Categories -->
    <mvt:item name="toolkit" param="subcat2|ccount2|l.all_settings:sub_category:code" />
    <mvt:if expr="ccount2 GT 0">
    <mvt:foreach iterator="sub_category2" array="sub_categories2">
    
    <!-- Begin Product Display for each subcategory -->
    <mvt:item name="toolkit" param="cxpc|pcount|l.all_settings:sub_category2:code" />
    <mvt:if expr="pcount GT 0">
    <div>
    
    <mvt:item name="toolkit" param="catimage|bigimage|l.all_settings:sub_category2:code" />
    <mvt:if expr="bigimage">
    <div class="col-md-3 col-sm-3">
    
    
        <div>
    
    <img src="&mvte:global:bigimage;" alt="&mvt:sub_category2:name;" title="&mvt:sub_category2:name;">
    
    </div>
    </div>
    
        <div class="col-md-9 col-sm-9">
        <mvt:else>
        <div class="col-md-12 col-sm-12">
        </mvt:if>
            <table class="subcat">
            <tr><td colspan="4">
     <a name="&mvt:sub_category2:code;"></a><h2 style="margin-bottom:4px; font-family:Arial, Helvetica, sans-serif; font-size:16px;"><!-- &mvt:sub_category2:name;-->&mvt:sub_category2:name;&nbsp;&nbsp;<span style="background-color: #FF0000; color:#FFFF00;"><font size="2">
        </font><a href="/&mvt:category:code;.html#top">
        <font size="2" color="#FFFF00">Back to top</font></a>&nbsp;</span></h2>
    </td></tr>
    
            <tr class="red-bg">
            <td></td>
              <td><b>Name</b></td>
                <td><b>Price</b></td>
            <td>&nbsp;</td></tr>
        <mvt:foreach iterator="sub_product" array="sub_products">
    
                <tr valign="top">
                <td><mvt:if expr="NOT ISNULL l.settings:sub_product:thumbnail">
                              <img src="&mvte:sub_product:thumbnail;" alt="SUB &mvt:sub_product:name;" title="&mvt:sub_product:name;">
    <mvt:else>
    &nbsp;
    </mvt:if></td>
                  <td>&mvt:sub_product:name;
    
    <mvt:item name="toolkit" param="custom|studio|l.all_settings:item:sub_product_id|notes" />
    <mvt:if expr="g.studio">
    Notes: &mvte:global:studio;
    </mvt:if>
    </td>
                 <td>&mvt:sub_product:formatted_price;</td>
                    <td class="item-buttons" style="text-align:right;">
                    <mvt:if expr="l.settings:sub_product:inv_level NE 'out'">
    
                    <form method="post" action="&mvt:global:sessionurl;Screen=CTGY">
                    <mvt:item name="product_attributes" param="sub_product:id" />
                    <input type="hidden" name="Action" value="ADPR" />
                    <input type="text" name="Quantity" value="1" />
                    <input type="hidden" name="Attributes" value="" />
                    <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" />
                    <input type="hidden" name="Product_Code" value="&mvte:sub_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="hidden" name="Offset" value="&mvte:global:CatListingOffset;" />
                    <input type="hidden" name="AllOffset" value="&mvte:global:AllOffset;" />
                    <input type="hidden" name="CatListingOffset" value="&mvte:global:CatListingOffset;" />
                    <input type="hidden" name="RelatedOffset" value="&mvte:global:RelatedOffset;" />
                    <input type="hidden" name="SearchOffset" value="&mvte:global:SearchOffset;" />
                    <mvt:item name="buttons" param="AddToBasketL" />
                    </form>
                    <mvt:else>
                    <mvt:if expr="l.settings:sub_product:inv_active">&mvt:sub_product:inv_short;</mvt:if>
                    </mvt:if>
    
    
    
                </td>
              </tr>
    <tr>
      <td colspan="4" style="border-bottom:#000 solid 1px;"></td></tr>
                    </mvt:foreach>
    
    
    
            <tr><td colspan="3"></td></tr>
            </table>
        </div></div>
            <div class="clearfix"></div>
    <div style="padding-bottom:20px; padding-top:20px; width:100%;"><div style="border-bottom:solid #000 1px;"></div></div>
    </mvt:if>
    
    <!-- End Product Display for each subcategory -->
    
    
    <div style="clear:both;"></div>
    </mvt:foreach>
    </mvt:if>
    
    <!-- End Sub Categories -->
    </mvt:foreach>
    </mvt:if>
       </div>
    I have made sure that the Custom Field "notes" is assigned to the template and that there are products with content in the field.

    LOL, maybe some of the other dinosaurs out there can help me (@Jonathan-Driftwood )
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

  • If the Sub Cat Product Name is showing, then its a type

    <mvt:item name="toolkit" param="custom|studio|l.all_settings:item:sub_produ ct_id|notes" /> <mvt:if expr="g.studio"> Notes: &mvte:global:studio; </mvt:if> SB
    <mvt:item name="toolkit" param="custom|studio|l.all_settings:item:sub_produ ct:id|notes" /> <mvt:if expr="g.studio"> Notes: &mvte:global:studio; </mvt:if>
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


    • I have already tried both ways and neither one works...

      Code:
      <mvt:item name="toolkit" param="custom|studio|l.all_settings:item:sub_product_id|notes" /> <mvt:if expr="g.studio"> Notes: &mvte:global:studio; </mvt:if>
      <mvt:item name="toolkit" param="custom|studio|l.all_settings:item:sub_product:id|notes" /> <mvt:if expr="g.studio"> Notes: &mvte:global:studio; </mvt:if>
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


      • IF
        &mvt:sub_product:name; Works, what does &mvt:sub_product:id; evaluate to?
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


        • Originally posted by Bruce - PhosphorMedia View Post
          IF
          &mvt:sub_product:name; Works, what does &mvt:sub_product:id; evaluate to?
          If you review the original Toolkit snippet you will see that it used - product_id. Beyond that, I have no answers...hence the reason I posted here to see if anyone else might have some mad crazy Toolkit skills to figure it out.
          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

          Comment


          • interesting...as you know, never learned toolkit, however, his use of l.all_settings: indicates that he's assuming the normal (albeit internal) l.settings array structures. Item ids are always ":id" for an internal (to that database) reference whereas you'd only see "product_id" for an external one. For example, in the products table its "ID", in the CategoryXProduct table its "Product_ID"
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


            • Having :item: in there looks wrong to me. Try it without that, and with sub_product:id instead of sub_product_id

              Comment


              • Good catch. Yes, that should be just "l. all_settings:{iterator_name}:id.
                Bruce Golub
                Phosphor Media - "Your Success is our Business"

                Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                phosphormedia.com

                Comment


                • Originally posted by Leanne View Post
                  Having :item: in there looks wrong to me. Try it without that, and with sub_product:id instead of sub_product_id
                  Thanks Leanne! That was it. I tried using Item number 19 and only changed product to sub_product. I dub thee Tinyqueenasuarus (ask Jonathan-Driftwood )
                  Leslie Kirk
                  Miva Certified Developer
                  Miva Merchant Specialist since 1997
                  Previously of Webs Your Way
                  (aka Leslie Nord leslienord)

                  Email me: [email protected]
                  www.lesliekirk.com

                  Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                  Comment


                  • Hip hip hurray! I proudly claim the title of Tinyqueenasaurus. I'm about old enough for it, lol!

                    Comment

                    Working...
                    X

                    This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

                    This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

                    Accept