liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Block setting set in Editor not showing in block.settings in front end

Open JacobCWRodgers opened this issue 2 years ago • 0 comments

I have block schema that holds some checkboxes, images, and text fields that is being validated and updated correctly to the theme, but when I set the image through the editor and output the JSON values of the block.settings there are 3 images that do not show as set in the block.settings object even know they are in the editor.

Here is the schema which gets validated by the theme-check and synced to the theme. I've also verified the JSON through a third party validator.

        "type": "finance",
        "name": "Finance",
        "settings": [
          {
            "type": "checkbox",
            "id": "enable_affirm",
            "label": "Enable Affirm",
            "default": true
          },
          {
            "type": "checkbox",
            "id": "enable_sezzle",
            "label": "Enable Sezzle"
          },
          {
            "type": "checkbox",
            "id": "enable_splitit",
            "label": "Enable Splitit"
          },
          {
            "type": "checkbox",
            "id": "enable_katapult",
            "label": "Enable Katapult"
          },
          {
            "type": "checkbox",
            "id": "enable_paypal",
            "label": "Enable Paypal Credit"
          },
          {
            "type": "header",
            "content": "Images"
          },
          {
            "type": "image_picker",
            "id": "affirm_image",
            "label": "Affirm"
          },
          {
            "type": "image_picker",
            "id": "sezzle_image",
            "label": "Sezzle"
          },
          {
            "type": "image_picker",
            "id": "split_image",
            "label": "Splitit"
          },
          {
            "type": "image_picker",
            "id": "kat_image",
            "label": "Katapult"
          },
          {
            "type": "header",
            "content": "text"
          },
          {
            "type": "text",
            "id": "affirm_text",
            "label": "Affirm Text",
            "default": "Monthly payments as low as 0% APR financing."
          },
          {
            "type": "text",
            "id": "sezzle_text",
            "label": "Sezzle Text",
            "default": "Monthly payments as low as 0% APR financing."
          },
          {
            "type": "text",
            "id": "splitit_text",
            "label": "Splitit Text",
            "default": "Monthly payments using your credit card at 0% interest"
          },
          {
            "type": "text",
            "id": "katapult_text",
            "label": "Katapult Text",
            "default": "Lease to own, $45 down monthly payments, no credit required."
          },
          {
            "type": "text",
            "id": "paypal_text",
            "label": "Paypal Credit Text",
            "default": "No Interest if paid in full in 6 months."
          }
        ]
      
      }

Here is a screen shot of the images set in the editor. Screen Shot 2022-07-18 at 5 19 12 PM

And here is the outputted object of {{ block.settings | json }}. See that it is missing the values for split_image and kat_image. I've formatted it for ease of reading.

{   
    "enable_affirm":true,
    "enable_sezzle":true,
    "enable_splitit":true,
    "enable_katapult":true,
    "enable_paypal":false,
    "affirm_image":"\/\/cdn.shopify.com\/s\/files\/1\/1164\/4236\/files\/black_logo-transparent_bg.webp?v=1652120486",
    "sezzle_image":"\/\/cdn.shopify.com\/s\/files\/1\/1164\/4236\/files\/Color-Logo.png?v=1652128482",
    "affirm_text":"Monthly payments as low as 0% APR financing.",
    "sezzle_text":"Monthly payments as low as 0% APR financing.",
    "splitit_text":"Monthly payments using your credit card at 0% interest",
    "katapult_text":"Lease to own, $45 down monthly payments, no credit required.",
    "paypal_text":"No Interest if paid in full in 6 months."
} 

I have set both of the image_picker to different ids. Removed the two image_picker types that are being set correctly to see if something is wrong there but it would not show the values.

Is there a max value of types you can have in a block? I have this block on two separate pages and they both have this issue. Any insight as to what is going on?

JacobCWRodgers avatar Jul 18 '22 21:07 JacobCWRodgers