Announcement

Collapse
No announcement yet.

Can Miva Template Based Feed Generate XML Product Catalog Feeds?

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

    Can Miva Template Based Feed Generate XML Product Catalog Feeds?

    Hi everyone,

    I’m using the Miva Template Based Feed system to generate product feeds for platforms like Pinterest, but I’m running into issues with CSV files. Many of my product fields contain commas and quotes, which causes formatting problems in the exported file. Pinterest’s CSV option doesn’t support alternative delimiters like pipes (|), which could help avoid these issues.

    To solve this, I’m wondering if the Template Based Feed can generate an XML product catalog feed instead of CSV. XML would handle the complex data more cleanly and ensure the structure stays intact.

    Has anyone had success generating an XML feed, or know if this is possible within the Template Based Feed system?

    Thanks in advance for any insights!

    Thank you, Bill Davis

    #2
    I haven't worked much with feeds; but if they're template-based, isn't it possible to write a new template that will generate XML?
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      Provision files are in XML format.
      http://www.alphabetsigns.com/

      Comment


        #4
        Hi everyone,

        I wanted to thank you all for your efforts in helping me with the XML product feed issue. While it seems there’s no direct way to export product data in XML format via the Template Based Feed, I was hopeful there might be a workaround since Miva does allow XML generation for sitemaps.

        It looks like my best options now are:
        1. Exporting the data as a CSV with a pipe (|) delimiter and then converting it to XML using online conversion tools or spreadsheet software like Excel.
        2. Writing a custom script (e.g., in Python) to convert the pipe-delimited CSV into XML.
        Again, thank you for your time and suggestions. I really appreciate the support from this community!
        Thank you, Bill Davis

        Comment


          #5
          You can use Miva Template Based Feeds to generate XML style feeds. As Raf eluded to you'll want to set the encoding to "None" and then use "Advanced" mode to build your template and logic to generate the XML to match the spec for the service you are targeting. Here's an example of creating an XML Google Merchant Center Product Review Feed from the tgreviews module content , but a similar technique can be applied for whichever XML feed format you are working with.

          Screenshot 2024-11-12 at 8.18.07 AM.png
          Adam Christianson
          Senior Web Developer
          https://www.miva.com/

          Comment


            #6
            Originally posted by William Davis View Post
            Hi everyone,

            I’m using the Miva Template Based Feed system to generate product feeds for platforms like Pinterest, but I’m running into issues with CSV files. Many of my product fields contain commas and quotes, which causes formatting problems in the exported file.
            In regards to the original problem where, "product fields contain commas and quotes, which causes formatting problems in the exported file," this should not be an issue.

            CSV files can contain commas and quotes in them if they are quoted and escaped properly (See https://www.rfc-editor.org/rfc/rfc4180), and the template-based feeds module is capable of encoding & escaping properly when the Marketing Feed settings are configured to do so. If you're configuring your Marketing Feed's > Template Based Feed settings and you specify "Encoding: CSV" and "Delimiter: Comma" while in the point-and-click/non-advanced mode, then the feed will output a valid CSV even when the data contains commas & quotes.

            Here's an example of the Template Based Feed settings:

            template-based-feed-settings.png
            (Note: you can use the "Advanced Mode" and customize the template too. You just need to always quote the data and miva_csv_encode your data. Something like:
            Code:
            "<mvt:eval expr="miva_csv_encode(l.settings:record:code, ',')" />", "<mvt:eval expr="miva_csv_encode(l.settings:record:name, ',')" />"
            Here's an example of the CSV file the settings in the image above generated for some products with commas and quotes in the product-data: see the attached example-csv-with-commas-and-quotes.txt (Note: I had to rename the .csv file to .txt so that it could be uploaded here; just rename it back from .txt to .csv and it will open in Excel)

            Here is an example showing how Excel and other CSV parsers can parse product-data with commas and quotes in it:

            excel-parsing-csv-with-commas-and-quotes.png

            If for some reason Pinterest or any other 3rd-party processing the file isn't parsing with valid CSV encoding and escaping of commas & quotes, then I would go the route Adam mentioned above:

            Originally posted by Adam Christianson View Post
            You can use Miva Template Based Feeds to generate XML style feeds. As Raf eluded to you'll want to set the encoding to "None" and then use "Advanced" mode to build your template and logic to generate the XML to match the spec for the service you are targeting. Here's an example of creating an XML Google Merchant Center Product Review Feed from the tgreviews module content , but a similar technique can be applied for whichever XML feed format you are working with.
            Do you have any more details about why your CSV format is not working? Can you provide an example of your marketing feed settings/template and the csv output?

            Attached Files

            Comment

            Working...
            X