Giter VIP home page Giter VIP logo

add-to-cart-form-shortcode's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

add-to-cart-form-shortcode's Issues

Could you explain how to use this on my website?

Hi. Thanks for sharing this.

Could you explain how to use this on my website?

I already have a child theme installed.

I would like to replace the current shortcode [add_to_cart] with yours, using the same name.

To see if so the quantity field will be displayed in my products listed by ContentViews.

But I don't know how to insert this code, I tried to add to the functions.php file but it didn't work.

Detect current page query from inside the shortcode.

We are intentionally killing the current $wp_query here but that means that we have no way to detect what page we're currently on when we are inside the shortcode... making any conditional logic (like is_checkout()) impossible.

Recent Woo update broke plugin with variable products?

Hi. We just had a client report that the shortcode isnt working correctly with variable products all of the sudden.

Inside the variations_form div you start to see malformed or escaped code?:

`<span class="&quot;woocommerce-Price-amount" amount"="">$</span>568.00</bdi></span></span>","sku":"EVC3AA0A2E1A1","variation_description":"","variation_id":112,"variation_is_active":true,"variation_is_visible":true,"weight":"15","weight_html":"15 lbs","woofs_image":"<img width="&quot;300&quot;" height="&quot;300&quot;" src="&quot;https://evocharge.com/wp-content/uploads/2021/01/3-1-300x300.jpg&quot;" class="&quot;attachment-woocommerce_thumbnail" size-woocommerce_thumbnail"="" alt="&quot;&quot;" decoding="&quot;async&quot;" loading="&quot;lazy&quot;" srcset="&quot;https://evocharge.com/wp-content/uploads/2021/01/3-1-300x300.jpg" 300w,="" https:="" ="" evocharge.com="" wp-content="" uploads="" 2021="" 01="" 3-1-1024x1024.jpg="" 1024w,="" 3-1-150x150.jpg="" 150w,="" 3-1-768x768.jpg="" 768w,="" 3-1-600x600.jpg="" 600w,="" 3-1-100x100.jpg="" 100w,="" 3-1-50x50.jpg="" 50w,="" 3-1.jpg="" 1080w"="" sizes="&quot;(max-width:" 300px)="" 100vw,="" 300px"="">","display_price_cents":56800},{"attributes":{"attribute_pa_cable-length":"25-cable"},"availability_html":"","backorders_allowed":false,"dimensions":{"length":"16","width":"15","height":"11"},"dimensions_html":"16 ร— 15 ร— 11 in","display_price":599,"display_regular_price":599,"image":{"title":"EVSE-32-Amp-Home-Charger","caption":"","url":"https://evocharge.com/wp-content/uploads/2021/01/3-1.jpg","alt":"EVSE-32-Amp-Home-Charger","src":"https://evocharge.com/wp-content/uploads/2021/01/3-1-600x600.jpg","srcset":"https://evocharge.com/wp-content/uploads/2021/01/3-1-600x600.jpg 600w, https://evocharge.com/wp-content/uploads/2021/01/3-1-300x300.jpg 300w, https://evocharge.com/wp-content/uploads/2021/01/3-1-1024x1024.jpg 1024w, https://evocharge.com/wp-content/uploads/2021/01/3-1-150x150.jpg 150w, https://evocharge.com/wp-content/uploads/2021/01/3-1-768x768.jpg 768w, https://evocharge.com/wp-content/uploads/2021/01/3-1-100x100.jpg 100w, https://evocharge.com/wp-content/uploads/2021/01/3-1-50x50.jpg 50w, https://evocharge.com/wp-content/uploads/2021/01/3-1.jpg 1080w","sizes":"(max-width: 600px) 100vw, 600px","full_src":"https://evocharge.com/wp-content/uploads/2021/01/3-1.jpg","full_src_w":1080,"full_src_h":1080,"gallery_thumbnail_src":"https://evocharge.com/wp-content/uploads/2021/01/3-1-100x100.jpg","gallery_thumbnail_src_w":100,"gallery_thumbnail_src_h":100,"thumb_src":"https://evocharge.com/wp-content/uploads/2021/01/3-1-300x300.jpg","thumb_src_w":300,"thumb_src_h":300,"src_w":600,"src_h":600},"image_id":10192,"is_downloadable":false,"is_in_stock":true,"is_purchasable":true,"is_sold_individually":"no","is_virtual":false,"max_qty":"","min_qty":1,"price_html":"<span class="&quot;woocommerce-Price-amount" amount"="">$</span>599.00</bdi></span></span>","sku":"EVC3AA0B2E1A1","variation_description":"","variation_id":113,"variation_is_active":true,"variation_is_visible":true,"weight":"17","weight_html":"17 lbs","woofs_image":"<img width="&quot;300&quot;" height="&quot;300&quot;" src="&quot;https://evocharge.com/wp-content/uploads/2021/01/3-1-300x300.jpg&quot;" class="&quot;attachment-woocommerce_thumbnail" size-woocommerce_thumbnail"="" alt="&quot;&quot;" decoding="&quot;async&quot;" loading="&quot;lazy&quot;" srcset="&quot;https://evocharge.com/wp-content/uploads/2021/01/3-1-300x300.jpg" 300w,="" https:="" ="" evocharge.com="" wp-content="" uploads="" 2021="" 01="" 3-1-1024x1024.jpg="" 1024w,="" 3-1-150x150.jpg="" 150w,="" 3-1-768x768.jpg="" 768w,="" 3-1-600x600.jpg="" 600w,="" 3-1-100x100.jpg="" 100w,="" 3-1-50x50.jpg="" 50w,="" 3-1.jpg="" 1080w"="" sizes="&quot;(max-width:" 300px)="" 100vw,="" 300px"="">","display_price_cents":59900}]">

Cable Length Choose an option
  • 18' Cable
  • 25' Cable
Clear
EvoCharge EVSE 32 Amp Level 2 EV Charging Station for Homes quantity
Add to cart
`

You can view that on the live site here:
https://evocharge.com/home-charging-solutions/

(click buy now under evse or 32 amp ievse).
We recently updated to wp 6.2 and the latest woo. Site was working fine before that I believe. Any idea what is going on here?

Missing notices

When an add to cart button is clicked, the page reloads but there's no "this product has been added" notification. Pages/posts probably don't have the wc_print_notices() function and not sure how to add that.

https://share.getcloudapp.com/geuwOr9z
image

Support ajax add to cart

could possibly add a parameter to toggle ajax? typically an add to cart button needs to have add_to_cart_button and ajax_add_to_cart and the data-product_id attribute for it to automatically have the WooCommerce ajax add to scripts kick in.

Unsure how quantity inputs would be handled (possibly add data-quantity to the button. and finally, may not work well with custom product types.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.