Announcement

Collapse
No announcement yet.

Google Shopping Feed issue -- Double encoding

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

    Google Shopping Feed issue -- Double encoding

    Have a Google shopping feed file where the product description is sourced from a custom field. For example, Data contains ™ I am told this is in error because it's "double" encoding. So my question, How should ™ be represented in the text file so that google feed won't complain about html characters? I don't think it will work, but Should it be & # 153; without spaces, or directly in UTF-8; %E2 %84 %A2 ?

    Thanks,

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    #2
    Are you using the Template Based Feed module to generate this feed? We wouldn't be encoding anything like that by default. I would imagine the ™ is stored that way in the custom field. If Google is complaining about HTML, you should just store the value directly as as long as it won't break anything else. OR you could edit the iterator template of the feed and convert it there if you wanted. You could to see if the value was ™ and if so output directly.
    David Carver
    Miva, Inc. | Software Developer

    Comment


      #3
      No, someone else wrote the template feed file manually, so not the feed module. There was a reason not to, but I don't know what that was, or this is from before the module was available.

      So the question then is: when the ™ needs to be written in the custom field, How? Right now I am trying to find out if there is a way to do a glosub when the custom field is read.

      Scott
      Need to offer Shipping Insurance?
      Interactive Design Solutions https://www.myids.net
      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
      Competitive Rates, Custom Modules and Integrations, Store Integration
      AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
      My T-shirt Collection is mostly MivaCon T-shirts!!

      Comment


        #4
        How is the feed being generated now?

        You can't do a glosub directly in the reading of the custom field but you can do it before outputting the custom field value.
        David Carver
        Miva, Inc. | Software Developer

        Comment


          #5
          Yes, trying to glosub after getting the value. Sorry, didn't accurately describe what I was doing.

          So the header is written to the file, then that file is appended through a Foreach when the conditions match.

          Example attempt:

          Code:
          <mvt:assign name="l.settings:customs:prod_description" value="glosub(g.prod_description, '&trade;', '& #153;' )" />
          NOTE: this forum doesn't easily render the actual code correctly -- there's a space...

          Thanks,

          Scott
          Last edited by ids; 10-29-18, 12:06 PM.
          Need to offer Shipping Insurance?
          Interactive Design Solutions https://www.myids.net
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          Competitive Rates, Custom Modules and Integrations, Store Integration
          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
          My T-shirt Collection is mostly MivaCon T-shirts!!

          Comment


            #6
            So what is happening now exactly? Google is still complaining? Can you not just pass '™' as the replacement character?
            David Carver
            Miva, Inc. | Software Developer

            Comment


              #7
              In the raw text file, the character exists as & trade ; or & # 153 ; That is how it loads in the text file, as text. When the text file or the variable renders to the browser, it's the TM symbol.
              Need to offer Shipping Insurance?
              Interactive Design Solutions https://www.myids.net
              MivaMerchant Business Partner | Certified MivaMerchant Web Developer
              Competitive Rates, Custom Modules and Integrations, Store Integration
              AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
              My T-shirt Collection is mostly MivaCon T-shirts!!

              Comment


                #8
                Sorry if I'm still confused but would this / does this not work?
                Code:
                <mvt:assign name="l.settings:customs:prod_description" value="glosub(g.prod_description, '&trade;', '™™<tm_symbol_here>' )" />
                The forum won't show this symbol in that code snippet.
                David Carver
                Miva, Inc. | Software Developer

                Comment


                  #9
                  Can you not just pass '™' as the replacement character?
                  This is exactly what I am trying to find out how to do.

                  This is control character keystroke stuff. How do I do that with a glosub or other method in a template?

                  Scott


                  Need to offer Shipping Insurance?
                  Interactive Design Solutions https://www.myids.net
                  MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                  Competitive Rates, Custom Modules and Integrations, Store Integration
                  AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                  My T-shirt Collection is mostly MivaCon T-shirts!!

                  Comment


                    #10
                    OK, between your answers and mine...I need to figure out the keys/strokes I need to use.
                    Need to offer Shipping Insurance?
                    Interactive Design Solutions https://www.myids.net
                    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                    Competitive Rates, Custom Modules and Integrations, Store Integration
                    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                    My T-shirt Collection is mostly MivaCon T-shirts!!

                    Comment


                      #11
                      I just wrote this code in a template and it worked for me
                      Code:
                      <mvt:eval expr="glosub( '&trade;', '&trade;', '<trademark_symbol_here>')" />
                      This output to the screen <actual trademark symbol>
                      David Carver
                      Miva, Inc. | Software Developer

                      Comment


                        #12
                        Originally posted by ids View Post
                        OK, between your answers and mine...I need to figure out the keys/strokes I need to use.
                        Are you trying to hit the ALT / CTRL key and then some random numbers so your keyboard generates that character for you?
                        David Carver
                        Miva, Inc. | Software Developer

                        Comment


                          #13
                          This is so stupid I don't remember how to do this.

                          Yes, trying to use CTRL-ALT-T.

                          no results.

                          Scott
                          Need to offer Shipping Insurance?
                          Interactive Design Solutions https://www.myids.net
                          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                          Competitive Rates, Custom Modules and Integrations, Store Integration
                          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                          My T-shirt Collection is mostly MivaCon T-shirts!!

                          Comment


                            #14
                            The unicode character is U+2122. On my Mac keyboard if I hold down the Option key and then press 2122 it outputs the trademark symbol for me. You should be able to do something similar on your Mac / Windows machine. Can you not just copy the symbol to your clipboard and paste it?
                            David Carver
                            Miva, Inc. | Software Developer

                            Comment


                              #15
                              Can you not just copy the symbol to your clipboard and paste it?
                              Huh? Why would I want it to be that simple?

                              I'll see if that is all it takes for this when the store own submits the feed.

                              Thanks.

                              Scott
                              Need to offer Shipping Insurance?
                              Interactive Design Solutions https://www.myids.net
                              MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                              Competitive Rates, Custom Modules and Integrations, Store Integration
                              AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                              My T-shirt Collection is mostly MivaCon T-shirts!!

                              Comment

                              Working...
                              X