Announcement

Collapse
No announcement yet.

Read_Product for meta fields

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

  • lesliekirk
    replied
    Originally posted by Kent Multer View Post
    Maybe I can save you the trouble. The library function Product_Load_ID only reads from the store's Products table. It doesn't retrieve data about meta-tags.
    Thanks, Kent, like I said, I got lazy and created a Product Custom Field to do what I needed ... sigh.

    Leave a comment:


  • Kent Multer
    replied
    Maybe I can save you the trouble. The library function Product_Load_ID only reads from the store's Products table. It doesn't retrieve data about meta-tags.

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    ok, fair enough...did you try the suggestion and what was the result? :)
    I would need the exact "do" statement for what is needed. Hence the reason I posted. If I knew what statements to use for this situation, I would not have started this thread...

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    ok, fair enough...did you try the suggestion and what was the result? :)

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post

    to both? (there where two questions)
    I saw one question and one suggestion. It looked like if I had answer no, then try what you suggested. Sort of an if not then type statement. What was the second question I missed?

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    Originally posted by lesliekirk View Post
    To answer Bruce's question - yes.
    to both? (there where two questions)

    Leave a comment:


  • lesliekirk
    replied
    It should be noted that I'm trying to integrate this into the sub-sub-category template that pulls products into it (from sub-sub-categories).

    To answer Bruce's question - yes.

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    Have you checked if
    &mvt:product:metafield:robots;
    (or whatever the actual code name is for your robots meta data is (check in Global Settings | Meta Data Settings under 'name')?

    If not, you could try running

    <mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_ID(id, product var)" />

    and see if that has the variable loaded in.

    Leave a comment:


  • lesliekirk
    replied
    I have a most ignorant follow-up question for this. If "customfields" is the mvt:item name for the Product Read to find the custom field "notes", what would the mvt:item name be to find the metafield robots?

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by alphabet View Post
    There is a code sample on Miva Docs:

    https://docs.miva.com/code-samples/l...ct-meta-fields


    Code:
    <mvt:foreach iterator="meta_item" array="product:meta_items">
    <mvt:if expr="l.settings:meta_item:name EQ 'keywords'">
    <mvt:assign name="l.settings:product:meta_keywords" value="l.settings:meta_item:value" />
    <mvt:elseif expr="l.settings:meta_item:name EQ 'description'">
    <mvt:assign name="l.settings:product:meta_description" value="l.settings:meta_item:value" />
    <mvt:elseif expr="l.settings:meta_item:name EQ 'robots'">
    <mvt:assign name="l.settings:product:meta_robots" value="l.settings:meta_item:value" />
    </mvt:if>
    </mvt:foreach>
    Or can you assign the META:robots on the product page from the product:display tab?
    I need this to create a conditional link to the product based on robots index.follow. It's "complicated" because it's part of the code to display products from sub-sub- categories on to a category page.

    Thanks!

    Leave a comment:


  • alphabet
    replied
    There is a code sample on Miva Docs:

    https://docs.miva.com/code-samples/l...ct-meta-fields


    Code:
    <mvt:foreach iterator="meta_item" array="product:meta_items">
        <mvt:if expr="l.settings:meta_item:name EQ 'keywords'">
            <mvt:assign name="l.settings:product:meta_keywords" value="l.settings:meta_item:value" />
        <mvt:elseif expr="l.settings:meta_item:name EQ 'description'">
            <mvt:assign name="l.settings:product:meta_description" value="l.settings:meta_item:value" />
        <mvt:elseif expr="l.settings:meta_item:name EQ 'robots'">
            <mvt:assign name="l.settings:product:meta_robots" value="l.settings:meta_item:value" />
        </mvt:if>
    </mvt:foreach>
    Or can you assign the META:robots on the product page from the product:display tab?

    Leave a comment:


  • Kent Multer
    replied
    Meta-tags are controlled by a module that comes standard with all stores. There's a version in the LSK named mmlsk-cmp-mv-prodctgy-meta.mv. A quick look at the source code suggests that, Yes, you can write template code to read the values, but it might take two or three mvt:do tags to do it; it's not as simple as custom fields.

    Leave a comment:


  • lesliekirk
    started a topic Read_Product for meta fields

    Read_Product for meta fields

    Is there a way to do something like this but for the meta fields instead of the custom fields?

    Code:
    <mvt:item name="customfields" param="Read_Product_ID(l.settings:product:id, 'notes', l.settings:product:notes)" />
    I need to "read" what might be in this field l.settings:product:metafield:robots
Working...
X