alternative product page (PROD2)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neuroticartist
    Mini Mivite

    • Nov 2013
    • 42

    #1

    alternative product page (PROD2)

    Ive searched the forums and I have found several posts about custom product pages, extensive variations, different product pages for different product styles, things with a dozen variables in them. I am looking to do something MUCH simpler, yet MIVA support keeps trying to get me to spend the money paying their "professional services". It cant be that difficult, I feel like I am just looking over something.

    For the most part, all the products on my dev site use the same PROD page. Ive added some HTML to the header/footer area but have left the rest pretty much as is.

    I have 1 category (used stuff for sale) that I duplicated the category page and made some changes, then assigned that new page to be the new category display page for that single category. ok so far, simple. next I duplicated the PROD template page and called it PROD-USED. I want to tell this one category page to open up the PROD-USED template instead of the regular PROD page. but I am unable to find the code in that page to change.

    The only difference between PROD and PROD-USED is some different HTML in the header/footer of that page. custom stuff. Nothing in the actual page or how it displays products has changed at all.

    Am I missing something? Is there a way to tell a cloned Category page to use a cloned product page instead of PROD?

    Last edited by neuroticartist; 12-12-13, 01:35 PM.
  • Bruce - PhosphorMedia
    Developer Partner











    • Mar 2006
    • 11256

    #2
    Re: alternative product page (PROD2)

    Well...what you say you want to do is easy enough.

    If your site uses SEO links, then in the Category product list, look for something like this:

    Code:
    <div class="product-thumbnail">
    	<mvt:if expr="NOT ISNULL l.settings:product:thumbnail"><a href="&mvte:product:link;"><img src="&mvte:product:thumbnail;" alt="&mvte:product:name;" /><mvt:else><a class="thumbnail-not-available" href="&mvte:product:link;" title="&mvte:product:name;"></mvt:if></a>
    </div>
    <div class="product-name"><a href="&mvte:product:link;">&mvt:product:name;</a></div>
    and replace it with

    Code:
    <mvt:if expr="l.settings:category:code NE 'UsedProducts'">
    
    	<div class="product-thumbnail">
    		<mvt:if expr="NOT ISNULL l.settings:product:thumbnail"><a href="&mvte:product:link;"><img src="&mvte:product:thumbnail;" alt="&mvte:product:name;" /><mvt:else><a class="thumbnail-not-available" href="&mvte:product:link;" title="&mvte:product:name;"></mvt:if></a>
    	</div>
    	<div class="product-name"><a href="&mvte:product:link;">&mvt:product:name;</a></div>
    
    <mvt:else>
    
    	<mvt:assign name="g.UsedProdLink" value="glosub(l.settings:product:link, 'product', 'newproduct')">
    	<div class="product-thumbnail">
    		<mvt:if expr="NOT ISNULL l.settings:product:thumbnail"><a href="&mvte:global:UsedProdLink;"><img src="&mvte:product:thumbnail;" alt="&mvte:product:name;" /><mvt:else><a class="thumbnail-not-available" href="&mvte:product:link;" title="&mvte:product:name;"></mvt:if></a>
    	</div>
    	<div class="product-name"><a href="&mvte:global:UsedProdLink;">&mvt:product:name;</a></div>
    	
    </mvt:if>
    Then, in your .htaccess file, where it has this:

    Code:
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^/product/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Product_code=$1 [QSA,L]
    add this

    Code:
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^/product/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD-USED&Product_code=$1 [QSA,L]
    If your not using short links, you'd do the same, just swaping our the SCREEEN= values

    HOWEVER, this won't work for SEARCH. There, you'd have to rely on some other method of detecting the Used Part. (Usually a custom field is used for this although there are tools to look up a category code for product.)
    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

    • KNewbrough
      Mivite

      • May 2013
      • 200

      #3
      Re: alternative product page (PROD2)

      If your product links on CTGY-USED Category Display Layout are default, they probably look like this:

      Code:
      <a href="&mvte:product:link;">
      Just replace all instances of that link with this:

      Code:
      <a href="/mm5/merchant.mvc?Store_Code=LP&Screen=PROD-USED&Product_Code=&mvt:product:code;">
      Edit: Looks like Bruce got here at the same time I did. His response is more thorough. Short links would complicate things and you'll indeed need to consider how to flag the products for links from the search page. You may ultimately find it easier to use a flat file import to flag the individual products to use the alternate display product page so that the store's dynamic links can adapt everything for you.
      Last edited by KNewbrough; 12-12-13, 05:52 PM.
      Kyle Newbrough
      Technical Support / Web Developer
      Miva Merchant

      Comment

      • nottheusual1
        Mega Mivite


        • Jul 2008
        • 1124

        #4
        Re: alternative product page (PROD2)

        If your changes really are just some HTML otherwise the pages are the same, test for the category and write appropriate header/footer:

        Code:
        <mvt:if expr="g.category_code NE 'YOURCATCODE'">
        the HTML for the standard product header or footer
        <mvt:else>
        the HTML for the special category code product header or footer
        </mvt:if>
        No new page required. Again, if all you're doing is substituting some header/footer HTML.
        Last edited by nottheusual1; 12-13-13, 12:16 AM. Reason: Clarity

        Comment

        • neuroticartist
          Mini Mivite

          • Nov 2013
          • 42

          #5
          Re: alternative product page (PROD2)

          all good info, although Im a little surprised with the ease of other things, that this would be more complicated. @nottheusual1, correct, the only difference is some html additions in the header and the footer so that may be the best approach. Thanks for thinking outside of the box on that one! I will try all of these and post here on what worked the best. thanks again everyone for your assistance!


          Roz


          Comment

          • Bruce - PhosphorMedia
            Developer Partner











            • Mar 2006
            • 11256

            #6
            Re: alternative product page (PROD2)

            Its not that complicated at all...but if you mean you just don't have a "point and click" option for this, then yes, its more complicated than that, but systems can't really be made to offer an unlimited number of point and click options, without being VASTLY complicated underneath...and even then, there are severe limitations to what one can offer in choices. Merchant tries to strike a balance between simple choices with good, common options and unlimited expansion with a little 'under-the-hood' effort.

            As you can see, you can get good ideas from this forum on how to do under the hood stuff (you can't expect full copy/paste solutions most of the times...but usually a good start). And there are always independent third party integrators who can do these changes for you (see the For Hire forum) so you can focus on other parts of your site/business.

            P.S., I'd use nottheusual's approach if the changes are that minimal...much easier to maintain.
            Last edited by Bruce - PhosphorMedia; 12-13-13, 11:04 AM.
            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

            • neuroticartist
              Mini Mivite

              • Nov 2013
              • 42

              #7
              Re: alternative product page (PROD2)

              thanks, I dont expect simple point and click solutions any more but there seems to be a lot possible with the <mvt:X statements, so I thought it would be a change in 1 call to the product display page, which in this case, nottheusual1 had a clever solution. Either way, Im learning as I go and I appreciate all the feedback!
              Last edited by neuroticartist; 12-13-13, 11:51 AM.

              Comment

              • neuroticartist
                Mini Mivite

                • Nov 2013
                • 42

                #8
                Re: alternative product page (PROD2)

                using this bit of code"


                Code:
                <mvt:if expr="g.category_code NE 'YOURCATCODE'"> the HTML for the standard product header or footer <mvt:else> the HTML for the special category code product header or footer </mvt:if>
                And adding my 2 different header or footer html worked like a charm, thank you very much for this outside the box answer! Its exactly what I hoped for :)

                Comment

                • nottheusual1
                  Mega Mivite


                  • Jul 2008
                  • 1124

                  #9
                  Re: alternative product page (PROD2)

                  You are welcome. Always glad to help out.

                  Comment

                  • neuroticartist
                    Mini Mivite

                    • Nov 2013
                    • 42

                    #10
                    Re: alternative product page (PROD2)

                    so, if you dont mind, Id like to see if I can stretch this some. Theoretically, what if I wanted to show a different HTML section in the header of each category? would this work?

                    Code:
                    <mvt:if expr="CATCODE1>
                    HTML For Category 1 header section
                    <mvt:if expr="CATCODE2>
                    HTML For Category 2 header section
                    <mvt:if expr="CATCODE3>
                    HTML For Category 3 header section
                    <mvt:if expr="CATCODE4>
                    HTML For Category 4 header section
                    <mvt:else> the HTML for the special category code product header or footer </mvt:if>
                    Last edited by neuroticartist; 12-16-13, 10:31 AM.

                    Comment

                    • nottheusual1
                      Mega Mivite


                      • Jul 2008
                      • 1124

                      #11
                      Re: alternative product page (PROD2)

                      This should work:
                      Code:
                      <mvt:if expr="g.category_code EQ 'CATCODE1'">
                      HTML For Category 1 header section
                      <mvt:elseif expr="g.category_code EQ 'CATCODE2'">
                      HTML For Category 2 header section
                      <mvt:elseif expr="g.category_code EQ 'CATCODE3'">
                      HTML For Category 3 header section
                      <mvt:elseif expr="g.category_code EQ 'CATCODE4'">
                      HTML For Category 4 header section
                      <mvt:else>
                      the HTML for the GENERIC category code product header or footer 
                      </mvt:if>
                      The else:if is appropriate for multiple conditionals, plus you'd want your final "else" to show the generic/standard product header/footer - anything that wasn't in your 4 category codes. Plus, it's important to pay really close attention to the structure of SMT or you will be perpetually frustrated when you forget a -- " -- or a -- ' --. That's all it takes to break stuff.

                      Comment

                      • neuroticartist
                        Mini Mivite

                        • Nov 2013
                        • 42

                        #12
                        Re: alternative product page (PROD2)

                        Really good info. Thanks!!

                        Comment

                        • neuroticartist
                          Mini Mivite

                          • Nov 2013
                          • 42

                          #13
                          Re: alternative product page (PROD2)

                          dude you have been a great asset to me in these forums and I really appreciate it. Ive managed to use this and another one of your helpful tips together to do several customizations depending on whether its the used gear category or not. this but of code has worked for me in multiple tabs of the cat page. it has been really good information :)

                          Roz

                          Comment

                          • nottheusual1
                            Mega Mivite


                            • Jul 2008
                            • 1124

                            #14
                            Re: alternative product page (PROD2)

                            Glad to help.

                            Comment

                            Working...
                            X