File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ if (!customElements.get('product-form')) {
26
26
delete config . headers [ 'Content-Type' ] ;
27
27
28
28
const formData = new FormData ( this . form ) ;
29
- if ( this . dataset . cartType != 'page' ) {
29
+ if ( this . cart ) {
30
30
formData . append ( 'sections' , this . cart . getSectionsToRender ( ) . map ( ( section ) => section . id ) ) ;
31
31
formData . append ( 'sections_url' , window . location . pathname ) ;
32
32
this . cart . setActiveElement ( document . activeElement ) ;
@@ -46,7 +46,7 @@ if (!customElements.get('product-form')) {
46
46
soldOutMessage . classList . remove ( 'hidden' ) ;
47
47
this . error = true ;
48
48
return ;
49
- } else if ( this . dataset . cartType == 'page' ) {
49
+ } else if ( ! this . cart ) {
50
50
window . location = window . routes . cart_url ;
51
51
return ;
52
52
}
Original file line number Diff line number Diff line change 257
257
{%- when 'buy_buttons' -%}
258
258
<div {{ block.shopify_attributes }} >
259
259
{%- if product != blank -%}
260
- <product-form class =" product-form" data-cart-type = " {{ settings . cart_type }} " >
260
+ <product-form class =" product-form" >
261
261
<div class =" product-form__error-message-wrapper" role =" alert" hidden >
262
262
<svg aria-hidden =" true" focusable =" false" role =" presentation" class =" icon icon-error" viewBox =" 0 0 13 13" >
263
263
<circle cx =" 6.5" cy =" 6.50049" r =" 5.5" stroke =" white" stroke-width =" 2" />
Original file line number Diff line number Diff line change 411
411
</noscript >
412
412
{%- when 'buy_buttons' -%}
413
413
<div {{ block.shopify_attributes }} >
414
- <product-form class =" product-form" data-cart-type = " {{ settings . cart_type }} " >
414
+ <product-form class =" product-form" >
415
415
<div class =" product-form__error-message-wrapper" role =" alert" hidden >
416
416
<svg aria-hidden =" true" focusable =" false" role =" presentation" class =" icon icon-error" viewBox =" 0 0 13 13" >
417
417
<circle cx =" 6.5" cy =" 6.50049" r =" 5.5" stroke =" white" stroke-width =" 2" />
You can’t perform that action at this time.
0 commit comments