Adicionar arquivo de upload no Shopify

Add Upload File in Shopify

Compatibilidade: Compatível com qualquer tema GRATUITO do Shopify 2.0

Muitas pessoas estavam perguntando como conseguir isso. Caras bem simples. Apenas alguns passos. Postei sobre como adicionar um campo de texto na página do seu produto. Ver link

Você também pode verificar nossa ferramenta GRATUITA de geração de elementos de UI do Shopify .

    Para iniciar:

    1. Vá para sua loja de administração > Loja online > Temas > Ações > Editar código.

    2. Abra a pasta Seções e encontre main-product.liquid.

    3. No arquivo, encontre o "buy_buttons", então deve ter um {% form %} . Você pode colar o código abaixo.

    NOTA: Se você tiver a versão mais recente dos temas gratuitos do Shopify 2.0, precisará ir para a pasta Snippet e abrir buy-buttons.liquid.

    <p class="line-item-property__field">
    <label for="image"> Enviar imagem: </label><br>
    <input obrigatório class="required" type="file" accept="image/*" name="properties[image]">
    </p>

    4. Para tornar isso obrigatório, exclua o novalidate: 'novalidate', no formulário. Certifique-se de incluir a vírgula. Confira o vídeo para mais informações.

    É isso (",). Bastante simples. Não é necessário código javascript

    6 comentários

    Hi INEZ,

    You need to create a new product template and add the file upload. You can check this tutorial on how to add a product template https://youtu.be/bg7l0lZcyOU

    Made4Uo

    Hi, is there a way to make this apply to only some products? thanks

    Inez

    Hi Michael,

    You will need to add javascript code that will accept an array of files instead to be able to accept multiple files.

    Made4Uo

    Hi first I would like to thank you for your sharing. Secend, I wonder how to upload multi-images? I cope and paste the code three times, but it only shows one image in the shopping chart.
    Would be very grateful if you reply me.

    Michael

    Hi @Cate,

    This is a section. You can apply it to any part of your shopify store but if you are thinking on applying it to a certain product. You have to create a new product template. You just have to add a section in it. Then change the template of your template in the product section of your admin.

    Anonymous

    Hi! I was thrilled at how simple this is after seeing several other very involved tutorials. I was wondering if there’s a way to only make the upload file apply to one product?

    Cate

    Deixe um comentário