e1commerce.com
Ask a question
  • New questions
  • With the answers
  • Unanswered
  1. Home
  2. html - Issue copy pasted Form doesn't work in shopify

315 votes
0 answers

html - Issue copy pasted Form doesn't work in shopify

I have an issue I have a small form where you can add sizes of an item, once you click on it a quick card appears. I need to add the same form in the same but it appears only on hover. The copied one is not working. In the console I found this message when I click on the submit button: " Form submission canceled because the form is not connected shopify"

<form v-if="!isSoldOut" :data-single-variant="product.variants.length == 1 || !product.options.find(o => o.name == 'TAILLE')"
     :data-variant="selectedVariantForPrice.id"
      class="usf-add-to-cart" 
      formmethod="POST" 
      enctype="multipart/form-data" 
      :data-product-id="product.id" 
      :action="usf.platform.addToCartUrl" 
      @submit="e => _usfAddCartAjax(event)">
                        <input type="hidden" name="id" :value="selectedVariantForPrice.id">
                        <button v-if="product.variants.length == 1 || !product.options.find(o => o.name == 'TAILLE')" 
                            :class="{'usf-visible': isHover}" 
                            type="submit" name="add" 
                            :disabled="isSoldOut" 
                            class="usf-add-to-cart-btn usf-single usf-ajax-to-cart" 
                            :data-product-id="product.id"  >
                                <span class="usf-text" v-html="loc.addToCart"></span>
                                <svg x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" class="checkmark">
                                     <path fill="none" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" d="M9,17l3.9,3.9c0.1,0.1,0.2,0.1,0.3,0L23,11"/>
                                </svg>
                        </button>
                        <div v-else :class="{'usf-visible': isHover}" type="submit" name="add" :disabled="isSoldOut" class="usf-add-to-cart-btn  usf-ajax-to-cart" :data-product-id="product.id"  >
                            <span class="usf-text" v-html="loc.addToCart"></span>
                            <svg x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" class="checkmark">
                                <path fill="none" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" d="M9,17l3.9,3.9c0.1,0.1,0.2,0.1,0.3,0L23,11"/>
                            </svg>
              <usf-sizes :value="product"></usf-sizes></div>
 </form>

Undefined asked
2022-08-16


Source

Didn't find the answer?

Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Similar questions

Find the answer in similar questions on our website.

681 Want to add a Product Detail Dropdown (That shows Product title, image and price) inside a contact form in shopify
52 jquery - Shopify - Rewrite the Add to cart button code to send custom AJAX request that includes custom products
580 shopify - when i click on add to cart button, page refreshes and then product is added how can i do this without getting the page refreshing
657 javascript - In a Web Component How to show tooltip & hide tooltip when clicking outside or when another tooltip clicked
801 javascript - Shopify created_at_min parameter with event endpoint does not work?
30 liquid - Shopify: Product grid - how overwrite a Product STOCK-OUT msg, with "Coming Soon" if it's in a ComingSoon collection
67 Solving the Mystery: How to fix "This action requires merchant approval for read_checkouts scope" Error on Shopify REST Admin API GET Request
469 api - Is there a way to create a Shopify storefront app that only affects one page of the store?
219 html - How to paste text into the descrpition field on Shopify by using Python Selenium
967 liquid - Splitting Shopify Multi Single Line Metafield to HTML List

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.







Latest questions:

357 Get product description with metafield in shopify

492 html - CSS animation looks wrong/broken in some places on iOS devices only?

469 Shopify refund amount wrong when refund in pending state (Admin REST API)

832 How to Add Fonts to the Shopify Admin

221 css selectors - Custom font for specific language shopify



© 2021-2023

E-mail: infot@e1commerce.com