dashboard
3 years ago
buy-template.php
2 years ago
buy.php
2 years ago
login.php
3 years ago
no-customer.php
3 years ago
product-canvas.php
3 years ago
buy-template.php
134 lines
| 1 | <!-- wp:surecart/columns {"isFullHeight":true,"style":{"spacing":{"blockGap":{"top":"0px","left":"0px"}}}} --> |
| 2 | <sc-columns is-stacked-on-mobile="1" is-full-height class="is-layout-constrained is-horizontally-aligned-right is-full-height" style="gap:0px 0px;"><!-- wp:surecart/column {"layout":{"type":"constrained","contentSize":"550px","justifyContent":"right"},"width":"","style":{"spacing":{"padding":{"top":"100px","right":"100px","bottom":"100px","left":"100px"},"blockGap":"30px"},"border":{"width":"0px","style":"none"},"color":{"background":"#fafafa"}}} --> |
| 3 | <sc-column class="wp-block-surecart-column is-layout-constrained is-horizontally-aligned-right" style="border-style:none;border-width:0px;padding:30px 5rem 5rem 5rem;--sc-column-content-width:450px;--sc-form-row-spacing:30px"> |
| 4 | |
| 5 | <?php if ( $show_image && ! empty( $product->product_medias->data ) ) : ?> |
| 6 | <?php if ( count( $product->product_medias->data ) > 1 ) : ?> |
| 7 | <sc-image-slider id="sc-product-media-<?php echo esc_attr( esc_attr( $product->id ) ); ?>" style="--sc-product-slider-height: 310px;"></sc-image-slider> |
| 8 | <?php |
| 9 | \SureCart::assets()->addComponentData( |
| 10 | 'sc-image-slider', |
| 11 | '#sc-product-media-' . $product->id, |
| 12 | array( |
| 13 | 'hasThumbnails' => true, |
| 14 | 'images' => array_map( |
| 15 | function ( $product_media ) use ( $product ) { |
| 16 | return array( |
| 17 | 'src' => $product_media->getUrl( 450 ), |
| 18 | 'alt' => esc_attr( $product_media->media->alt ?? $product_media->media->filename ?? $product->name ?? '' ), |
| 19 | 'width' => 450, |
| 20 | ); |
| 21 | }, |
| 22 | $product->product_medias->data |
| 23 | ), |
| 24 | 'thumbnails' => array_map( |
| 25 | function ( $product_media ) use ( $product ) { |
| 26 | return array( |
| 27 | 'src' => $product_media->getUrl( 90 ), |
| 28 | 'srcset' => $product_media->getSrcset( array( 90, 120, 240 ) ), |
| 29 | 'sizes' => '(min-width: 780px) 90px, 13vw', // 13vw = 13% of the viewport width because of 5 thumbnails per page, plus spacing for arrows. |
| 30 | 'alt' => esc_attr( $product_media->media->alt ?? $product_media->media->filename ?? $product->name ?? '' ), |
| 31 | 'width' => 90, |
| 32 | ); |
| 33 | }, |
| 34 | $product->product_medias->data |
| 35 | ), |
| 36 | ) |
| 37 | ); |
| 38 | ?> |
| 39 | <?php else : ?> |
| 40 | <!-- wp:image {"sizeSlug":"full","linkDestination":"none","style":{"border":{"radius":"5px"}}} --> |
| 41 | <figure class="wp-block-image size-full is-resized has-custom-border"> |
| 42 | <img src="<?php echo esc_url( $product->product_medias->data[0]->getUrl( 450 ) ); ?>" alt="<?php echo esc_attr( $product->featured_media->alt ); ?>" title="<?php echo esc_attr( $product->featured_media->title ); ?>" style="border-radius:5px" /> |
| 43 | </figure> |
| 44 | <!-- /wp:image --> |
| 45 | <?php endif; ?> |
| 46 | <?php endif; ?> |
| 47 | |
| 48 | <sc-text style="--font-size: var(--sc-font-size-x-large); font-weight: var(--sc-font-weight-bold); --line-height: 1" aria-label="<?php echo esc_attr_e( 'Product name', 'surecart' ); ?>"> |
| 49 | <?php echo wp_kses_post( $product->name ); ?> |
| 50 | </sc-text> |
| 51 | |
| 52 | <sc-product-selected-price product-id="<?php echo esc_attr( $product->id ); ?>"></sc-product-selected-price> |
| 53 | |
| 54 | <?php if ( $show_description ) : ?> |
| 55 | <sc-prose> |
| 56 | <span class="screen-reader-text"><?php echo esc_attr_e( 'Product description', 'surecart' ); ?></span> |
| 57 | <?php echo wp_kses_post( $product->description ?? '' ); ?> |
| 58 | </sc-prose> |
| 59 | <?php endif; ?> |
| 60 | |
| 61 | <div> |
| 62 | <sc-checkout-product-price-variant-selector label="<?php esc_attr_e( 'Pricing', 'surecart' ); ?>" id="sc-product-price-variant-selector-<?php echo esc_attr( esc_attr( $product->id ) ); ?>"></sc-checkout-product-price-variant-selector> |
| 63 | <?php |
| 64 | \SureCart::assets()->addComponentData( |
| 65 | 'sc-checkout-product-price-variant-selector', |
| 66 | '#sc-product-price-variant-selector-' . $product->id, |
| 67 | array( |
| 68 | 'product' => $product->toArray(), |
| 69 | ) |
| 70 | ); |
| 71 | ?> |
| 72 | </div> |
| 73 | |
| 74 | </sc-column> |
| 75 | <!-- /wp:surecart/column --> |
| 76 | |
| 77 | <!-- wp:surecart/column {"layout":{"type":"constrained","contentSize":"550px","justifyContent":"left"},"backgroundColor":"ast-global-color-5","style":{"spacing":{"padding":{"top":"100px","right":"100px","bottom":"100px","left":"100px"},"blockGap":"30px"}}} --> |
| 78 | <sc-column class="wp-block-surecart-column is-layout-constrained is-horizontally-aligned-left" style="padding:30px 5rem 5rem 5rem;--sc-column-content-width:450px;--sc-form-row-spacing:30px"> |
| 79 | <!-- wp:surecart/checkout-errors --> |
| 80 | <sc-checkout-form-errors></sc-checkout-form-errors> |
| 81 | <!-- /wp:surecart/checkout-errors --> |
| 82 | |
| 83 | <!-- wp:surecart/email {"placeholder":"<?php esc_attr_e( 'Your email address', 'surecart' ); ?>","label":"<?php esc_attr_e( 'Email', 'surecart' ); ?>"} /--> |
| 84 | |
| 85 | <!-- wp:surecart/name {"required":true,"placeholder":"<?php esc_attr_e( 'Your name', 'surecart' ); ?>"} --> |
| 86 | <sc-customer-name label="<?php esc_attr_e( 'Name', 'surecart' ); ?>" placeholder="<?php esc_attr_e( 'Your name', 'surecart' ); ?>" required></sc-customer-name> |
| 87 | <!-- /wp:surecart/name --> |
| 88 | |
| 89 | <!-- wp:surecart/payment {"label":"<?php esc_attr_e( 'Payment', 'surecart' ); ?>"} --><!-- /wp:surecart/payment --> |
| 90 | |
| 91 | <sc-order-bumps label="<?php esc_attr_e( 'Recommended', 'surecart' ); ?>"></sc-order-bumps> |
| 92 | |
| 93 | <?php if ( $show_coupon ) : ?> |
| 94 | <!-- wp:surecart/coupon {"text":"<?php esc_attr_e( 'Coupon Code', 'surecart' ); ?>","collapsed":false,"placeholder":"<?php esc_attr_e( 'Enter coupon code', 'surecart' ); ?>","button_text":"<?php esc_attr_e( 'Apply', 'surecart' ); ?>"} /--> |
| 95 | <?php endif; ?> |
| 96 | |
| 97 | <sc-order-summary collapsible="true" collapsed="true" closed-text="<?php esc_attr_e( 'Total', 'surecart' ); ?>" open-text="<?php esc_attr_e( 'Total', 'surecart' ); ?>"> |
| 98 | |
| 99 | <sc-divider></sc-divider> |
| 100 | |
| 101 | <sc-line-items removable="false" editable="true" class="wp-block-surecart-line-items"></sc-line-items> |
| 102 | |
| 103 | <sc-divider></sc-divider> |
| 104 | |
| 105 | <!-- wp:surecart/subtotal --> |
| 106 | <sc-line-item-total total="subtotal" class="wp-block-surecart-subtotal"> |
| 107 | <span slot="description"><?php esc_html_e( 'Subtotal', 'surecart' ); ?></span> |
| 108 | </sc-line-item-total> |
| 109 | <!-- /wp:surecart/subtotal --> |
| 110 | |
| 111 | <!-- wp:surecart/tax-line-item --> |
| 112 | <sc-line-item-tax class="wp-block-surecart-tax-line-item"></sc-line-item-tax> |
| 113 | <!-- /wp:surecart/tax-line-item --> |
| 114 | |
| 115 | <!-- wp:surecart/total --> |
| 116 | <sc-line-item-total total="total" size="large" show-currency="1" class="wp-block-surecart-total"> |
| 117 | <span slot="title"><?php esc_html_e( 'Total', 'surecart' ); ?></span> |
| 118 | <span slot="subscription-title"><?php esc_html_e( 'Total Due Today', 'surecart' ); ?></span> |
| 119 | </sc-line-item-total> |
| 120 | <!-- /wp:surecart/total --> |
| 121 | </sc-order-summary> |
| 122 | |
| 123 | <?php if ( $show_terms && $terms_text ) : ?> |
| 124 | <sc-checkbox name="terms_and_privacy" value="accepted" required><?php echo wp_kses_post( $terms_text ); ?></sc-checkbox> |
| 125 | <?php endif; ?> |
| 126 | |
| 127 | <!-- wp:surecart/submit {"text":"<?php esc_attr_e( 'Purchase', 'surecart' ); ?>","show_total":true,"full":true} --> |
| 128 | <sc-order-submit type="primary" full="true" size="large" icon="lock" show-total="true" class="wp-block-surecart-submit"> |
| 129 | <?php esc_html_e( 'Purchase', 'surecart' ); ?> |
| 130 | </sc-order-submit> |
| 131 | <!-- /wp:surecart/submit --></sc-column> |
| 132 | <!-- /wp:surecart/column --></sc-columns> |
| 133 | <!-- /wp:surecart/columns --> |
| 134 |