Announcement

Collapse
No announcement yet.

Related Items on custom page

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

  • Related Items on custom page

    Hi Everyone,

    I want to create a page that will show related items of a specific category.
    I want it to show up like how it shows up on listing_0.html but on a custom page.

    I tried copying and pasting the code to the page but it didn't work.

    I guess what i need to understand is, how can the code below get the category id to show the related items for that category? Or where does it get it?

    I'd like to have 1 page for each category and have related items show about that category.


    Code:
     <!--START: related_0-->
       <table width="100%"  cellpadding="0" cellspacing="0">
      <tr>
    		<td class="checkout-headers" style="text-transform:uppercase">&nbsp;[product_Header-relateditems]</td>
        </tr>
    	<tr><td><table width="99%"  cellpadding="0" cellspacing="0">
    	
    	<!--START: related_items0-->
                  <table border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tr>
                      <td valign="middle" style="height:150px" align="center"><a href="product.asp?itemid=[catalogid]"><img src="[THUMBNAIL]" alt="[name]" border="0"></a></td>
                    </tr>
    
                    <tr valign="middle">
                      <td  class="item" align="center">[name]</td>
                    </tr>
    
                    <tr>
                      <td class="price" valign="middle" align="center">
    		   <!--START: ITEMPRICE-->
    			[ITEMPRICE] 
    		   <!--END: ITEMPRICE-->
    		   <!--START: SALEPRICE-->
    			<s>[ITEMPRICE]</s>&nbsp;&nbsp;<span class="salePrice">[ITEMSALEPRICE]</span>
    		   <!--END: SALEPRICE-->&nbsp;&nbsp;&nbsp;&nbsp;<a href="product.asp?itemid=[catalogid]"><span class="elementhide">[category_buyitlink]</span>view</a> &raquo;</td>
                    </tr>
                  </table>
    							 <!--END: related_items0-->
    
    							<!--START: related_items1-->
                  <table border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tr>
                      <td colspan="2" align="center" valign="middle"><a href="product.asp?itemid=[catalogid]"><img src="[THUMBNAIL]" alt="" border="0"></a>		  </td>
                    </tr>
    
                    <tr valign="middle">
                      <td colspan="2" class="item" align="center">[name]</td>
                    </tr>
    
                    <tr>
                      <td class="price" align="center" valign="middle" colspan="2">
    		   <!--START: ITEMPRICE-->
    			[ITEMPRICE]
    		   <!--END: ITEMPRICE-->
    		   <!--START: SALEPRICE-->
    			<s>[ITEMPRICE]</s><br>[ITEMSALEPRICE]
    		   <!--END: SALEPRICE-->		</td>
                    </tr>
                      <td class="item" colspan="2" align="center" valign="middle"><input type=checkbox name="item_id" value="[catalogid]"><input type="hidden" name="qty-[counter]" value=1></td>
                    </tr>
                  </table>
    							 <!--END: related_items1-->
    
    							<!--START: related_items2-->
                  <table border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tr>
    
                      <td class="item" align="left" width="50%"><a href="product.asp?itemid=[catalogid]">[name]</a></td>
    
    
    
                      <td class="price" align="center" valign="middle" width="20%">
    		   <!--START: ITEMPRICE-->
    			[ITEMPRICE]
    		   <!--END: ITEMPRICE-->
    		   <!--START: SALEPRICE-->
    			<s>[ITEMPRICE]</s><br>[ITEMSALEPRICE]
    		   <!--END: SALEPRICE-->		</td>
    
                      <td class="item"  align="center" valign="middle" width="30%">&nbsp;&nbsp;<input type=hidden name="item_id" value="[catalogid]"><input type="text" size="2" name="qty-[counter]" value=0></td>
                    </tr>
    </table>
    							 <!--END: related_items2-->
    							 </table></td></tr>
    			  </table>
    							 <!--END: related_0-->

    Thanks!!

  • #2
    The 3dcart code is very specific to certain pages. You cannot just copy it from one page and put it on another. Usually it will not work, especially on an Extra-Page.
    You can see which code will work on which page here:
    3dCart Template Reference Guide

    Comment


    • #3
      Originally posted by elightbox View Post
      The 3dcart code is very specific to certain pages. You cannot just copy it from one page and put it on another. Usually it will not work, especially on an Extra-Page.
      You can see which code will work on which page here:
      3dCart Template Reference Guide
      Thanks, elightbox!

      I saw this part that pretty much says it: (TIP: Code blocks and variables are designed to be used specifically within their intended templates and will not be processed otherwise.)

      But I also saw that Global variable are able to be used on different templates.

      Back to my original question. Any way for me to get around it?

      Have Explanation_Category_A page = Show Related_Items_Category_A
      Explanation_Category_B page = Show Related_Items_Category_B
      Explanation_Category_C page = Show Related_Items_Category_C

      Comment


      • #4
        There is not going to be a code block that does this for you. I am not sure how one would make a product be "related" to an entire category.

        I think you would need to work around this by putting those related items in their own subcategory, and display the page of items in that subcategory.

        Comment


        • #5
          Originally posted by cbsteven View Post
          There is not going to be a code block that does this for you. I am not sure how one would make a product be "related" to an entire category.

          I think you would need to work around this by putting those related items in their own subcategory, and display the page of items in that subcategory.
          Thanks for the suggestion, cbsteven.

          I created a subcategory for each category and placed 4 items in it.
          I then hid the subcategory so it does not show up on the Main Category's page.

          Comment

          Working...
          X