Announcement

Collapse
No announcement yet.

Display Product Attribute Prompts, not Codes (Email Templates and Order Screen)

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

    Display Product Attribute Prompts, not Codes (Email Templates and Order Screen)

    The attributes for products are showing fine in the storefront but on Orders and Email Templates, the code is being pulled, not the prompt. How can I resolve this?

    #2
    It's in the data- you can use the tokenize utility to help figure that out in the future.

    In this case, use &mvt:option:attr_prompt; anywhere you see the &mvt:option:attr_code; entity if you want to display the prompt instead of the code.
    M.A.D.* since 1997

    http://www.scotsscripts.com

    *miva application developers

    Comment


      #3
      (or l.settings:option:attr_prompt if you want to mvt:eval it)
      M.A.D.* since 1997

      http://www.scotsscripts.com

      *miva application developers

      Comment


        #4
        Thank you! I tried that before and it didn't work but maybe I didn't replace all the attribute code where I wanted to display the prompt. Thanks again!
        Last edited by kajolitz; 02-07-23, 09:53 AM.

        Comment


          #5
          It can depend on where you are trying to use it. Post the code if you want more help.
          M.A.D.* since 1997

          http://www.scotsscripts.com

          *miva application developers

          Comment


            #6
            Would you know what page template to edit for the Orders Screen? (Order Processing)

            I think it's the ORDS Page?

            Here's the Order Contents code for Product Attributes:

            <mvt:foreach iterator="option" array="group:options">
            <mvt:assign name="l.settings:group:option_counter" value="l.settings:group:option_counter + 1" />
            <mvt:if expr="l.settings:option:attr_code EQ 'giftcert'">
            <mvt:assign name="l.settings:option:attr_prompt" value="'Certificate Code'" />
            <mvt:else>
            <mvt:assign name="l.settings:option:attr_prompt" value="l.settings:option:attr_prompt" />
            </mvt:if>
            <span class="u-block u-font-tiny">
            <mvt:if expr="l.settings:option:option_id">
            <mvt:assign name="l.settings:group:restore:link" value="l.settings:group:restore:link $ '&Product_Attributes[' $ l.settings:group:option_counter $ ']:code=' $ l.settings:option:attr_prompt $ '&Product_Attributes[' $ l.settings:group:option_counter $ ']:value=' $ l.settings:option:opt_code" />
            &mvt:option:attr_prompt;: &mvt:option:opt_prompt;
            <mvt:elseif expr="NOT ISNULL l.settings:option:data">
            <mvt:assign name="l.settings:group:restore:link" value="l.settings:group:restore:link $ '&Product_Attributes[' $ l.settings:group:option_counter $ ']:code=' $ l.settings:option:attr_prompt $ '&Product_Attributes[' $ l.settings:group:option_counter $ ']:value=' $ l.settings:option:data" />
            <mvt:if expr="( l.settings:option:attr_code EQ 'digitaldownload' ) AND ( NOT ISNULL l.settings:option:digital_download_url )">
            <a class="o-layout--grow" href="&mvte:option:digital_download_url;" target="_blank">Digital Download</a><br>
            <mvt:else>
            &mvt:option:attr_prompt;: &mvt:option:data;
            </mvt:if>
            <mvt:elseif expr="NOT ISNULL l.settings:option:data_long">
            <mvt:assign name="l.settings:group:restore:link" value="l.settings:group:restore:link $ '&Product_Attributes[' $ l.settings:group:option_counter $ ']:code=' $ l.settings:option:attr_prompt $ '&Product_Attributes[' $ l.settings:group:option_counter $ ']:value=' $ l.settings:option:data_long" />
            &mvt:option:attr_prompt;: &mvt:option:data_long;
            <mvt:else>
            &mvt:option:attr_prompt;
            </mvt:if>
            Last edited by kajolitz; 02-07-23, 10:24 AM.

            Comment


              #7
              Not sure what you mean by the Orders screen. Do you mean order history? Order status? On ORDS the variable in a stock shadows order contents template is l.settings:option:attr_prompt

              If you click the three dots (upper right) do you see Tokenize? If not, click the items tab and assign it to the page, then check the three dots. You can see all the variables available in the page that way.
              M.A.D.* since 1997

              http://www.scotsscripts.com

              *miva application developers

              Comment


                #8
                By Order Screen I mean, when you select Order Processing, then select the Order #, the Order displays.

                This is the form name I get in the browser HTML Elements when I am on the Order: "https://www.corridorbookstore.com/mm5/admin.mvc?Screen=MORD&amp;Tab=ORDS&amp;Store_Code= CBS"

                Not sure if that helps.

                Comment


                  #9
                  The admin order view? We can't edit that screen, but we can use batch reports to create custom order displays that would do what you want.

                  This brings up a good practice to follow, though. If your attribute codes aren't readable, such as "X123AB" and the prompt is, "Shirt Size" then you're using the wrong kind of attribute codes. Just like variables, name codes something that makes obvious sense when you see them. For the "shirt size" example, the code could be "size_X123AB" or "shirt_size_X123AB" to make things easier to manage. Just something to think about when making codes in miva merchant.
                  M.A.D.* since 1997

                  http://www.scotsscripts.com

                  *miva application developers

                  Comment


                    #10
                    Oh! I will have to look into Batch Reports.

                    Your advice has been very helpful!

                    Comment

                    Working...
                    X