block.json
1 year ago
controller.php
1 year ago
index.asset.php
1 month ago
index.js
1 month ago
style-index-rtl.css
1 month ago
style-index.css
1 month ago
view.php
1 month ago
view.php
184 lines
| 1 | <div |
| 2 | class="wp-block-surecart-cart-items__wrapper" |
| 3 | <?php echo wp_kses_data( |
| 4 | get_block_wrapper_attributes( |
| 5 | array( |
| 6 | 'style' => $style, |
| 7 | ) |
| 8 | ) |
| 9 | ); ?> |
| 10 | role="list" |
| 11 | > |
| 12 | <template |
| 13 | data-wp-each--line_item="state.cartLineItems" |
| 14 | data-wp-each-key="context.line_item.id" |
| 15 | > |
| 16 | <div class="sc-product-line-item" role="listitem"> |
| 17 | <div class="sc-product-line-item__item"> |
| 18 | <img |
| 19 | class="sc-product-line-item__image" |
| 20 | data-wp-bind--hidden="!context.line_item.image.src" |
| 21 | data-wp-bind--src="context.line_item.image.src" |
| 22 | data-wp-bind--alt="context.line_item.image.alt" |
| 23 | data-wp-bind--srcset="context.line_item.image.srcset" |
| 24 | data-wp-bind--sizes="context.line_item.image.sizes" |
| 25 | loading="lazy" |
| 26 | alt="" |
| 27 | /> |
| 28 | |
| 29 | <div class="sc-product-line-item__text"> |
| 30 | <div class="sc-product-line-item__text-details"> |
| 31 | <a data-wp-bind--href="state.lineItemPermalink" class="sc-product-line-item__title" data-wp-bind--tabindex="state.lineItemPermalink ? '0' : '-1'"> |
| 32 | <span data-wp-text="context.line_item.price.product.name"></span> |
| 33 | </a> |
| 34 | <div class="sc-product-line-item__description sc-product-line-item__price-variant"> |
| 35 | <div data-wp-text="state.lineItemVariant"></div> |
| 36 | <div data-wp-text="context.line_item.price.name"></div> |
| 37 | </div> |
| 38 | <?php if ( ! $attributes['editable'] ) : ?> |
| 39 | <span class="sc-product-line-item__description"> |
| 40 | <?php esc_html_e( 'Qty:', 'surecart' ); ?> |
| 41 | <span data-wp-text="context.line_item.quantity"></span> |
| 42 | </span> |
| 43 | <?php elseif ( $attributes['editable'] ) : ?> |
| 44 | <div |
| 45 | class="sc-input-group sc-input-group-sm sc-quantity-selector" |
| 46 | data-wp-class--quantity--disabled="state.isQuantityDisabled" |
| 47 | data-wp-bind--hidden="!state.isEditable" |
| 48 | hidden |
| 49 | > |
| 50 | <div |
| 51 | class="sc-input-group-text sc-quantity-selector__decrease" |
| 52 | role="button" |
| 53 | tabindex="0" |
| 54 | data-wp-on--click="surecart/checkout::actions.onQuantityDecrease" |
| 55 | data-wp-on--keydown="surecart/checkout::actions.onQuantityDecrease" |
| 56 | data-wp-bind--disabled="state.isQuantityDecreaseDisabled" |
| 57 | data-wp-bind--aria-disabled="state.isQuantityDecreaseDisabled" |
| 58 | data-wp-class--button--disabled="state.isQuantityDecreaseDisabled" |
| 59 | data-wp-bind--aria-label="surecart/checkout::state.decreaseQuantityAriaLabel" |
| 60 | > |
| 61 | <?php echo wp_kses( SureCart::svg()->get( 'minus' ), sc_allowed_svg_html() ); ?> |
| 62 | </div> |
| 63 | <input |
| 64 | type="number" |
| 65 | class="sc-form-control sc-quantity-selector__control" |
| 66 | data-wp-bind--value="context.line_item.quantity" |
| 67 | data-wp-on--change="surecart/checkout::actions.onQuantityChange" |
| 68 | data-wp-bind--min="context.line_item.min" |
| 69 | data-wp-bind--aria-valuemin="context.line_item.min" |
| 70 | data-wp-bind--max="context.line_item.max" |
| 71 | data-wp-bind--aria-valuemax="context.line_item.max" |
| 72 | data-wp-bind--aria-valuenow="context.line_item.quantity" |
| 73 | data-wp-bind--disabled="surecart/checkout::state.loading" |
| 74 | data-wp-bind--aria-label="surecart/checkout::state.quantityInputAriaLabel" |
| 75 | step="1" |
| 76 | autocomplete="off" |
| 77 | role="spinbutton" |
| 78 | /> |
| 79 | <div |
| 80 | class="sc-input-group-text sc-quantity-selector__increase" |
| 81 | role="button" |
| 82 | tabindex="0" |
| 83 | data-wp-on--click="surecart/checkout::actions.onQuantityIncrease" |
| 84 | data-wp-on--keydown="surecart/checkout::actions.onQuantityIncrease" |
| 85 | data-wp-bind--disabled="state.isQuantityIncreaseDisabled" |
| 86 | data-wp-bind--aria-disabled="state.isQuantityIncreaseDisabled" |
| 87 | data-wp-class--button--disabled="state.isQuantityIncreaseDisabled" |
| 88 | data-wp-bind--aria-label="surecart/checkout::state.increaseQuantityAriaLabel" |
| 89 | > |
| 90 | <?php echo wp_kses( SureCart::svg()->get( 'plus' ), sc_allowed_svg_html() ); ?> |
| 91 | </div> |
| 92 | </div> |
| 93 | <?php endif; ?> |
| 94 | |
| 95 | <!-- Bundle components (nested items) --> |
| 96 | <div |
| 97 | class="sc-bundle-components" |
| 98 | data-wp-bind--hidden="!state.isBundleParent" |
| 99 | hidden |
| 100 | > |
| 101 | <div class="sc-bundle-components__label"> |
| 102 | <span data-wp-text="state.bundleComponentsLabel"></span> |
| 103 | </div> |
| 104 | <template |
| 105 | data-wp-each--component="state.bundleComponents" |
| 106 | data-wp-each-key="context.component.id" |
| 107 | > |
| 108 | <div class="sc-bundle-components__item"> |
| 109 | <img |
| 110 | class="sc-bundle-components__item-image" |
| 111 | data-wp-bind--hidden="!context.component.image.src" |
| 112 | data-wp-bind--src="context.component.image.src" |
| 113 | data-wp-bind--alt="context.component.price.product.name" |
| 114 | loading="lazy" |
| 115 | alt="" |
| 116 | /> |
| 117 | <span class="sc-bundle-components__item-name" data-wp-text="context.component.price.product.name"></span> |
| 118 | </div> |
| 119 | </template> |
| 120 | </div> |
| 121 | </div> |
| 122 | </div> |
| 123 | |
| 124 | <div class="sc-product-line-item__suffix"> |
| 125 | <?php if ( $attributes['removable'] ) : ?> |
| 126 | <button |
| 127 | class="sc-product-line-item__remove-button" |
| 128 | data-wp-bind--aria-label="surecart/checkout::state.removeItemAriaLabel" |
| 129 | data-wp-on--click="surecart/checkout::actions.removeLineItem" |
| 130 | data-wp-on--keydown="surecart/checkout::actions.removeLineItem" |
| 131 | > |
| 132 | <?php echo wp_kses( SureCart::svg()->get( 'x', [ 'class' => 'sc-product-line-item__remove' ] ), sc_allowed_svg_html() ); ?> |
| 133 | </button> |
| 134 | <?php endif; ?> |
| 135 | |
| 136 | <div class="sc-product-line-item__price"> |
| 137 | <div class="sc-product-line-item__price-amount"> |
| 138 | <span> |
| 139 | <span |
| 140 | data-wp-bind--hidden="!state.lineItemHasScratchAmount" |
| 141 | data-wp-text="context.line_item.price.scratchAmount" |
| 142 | ></span> |
| 143 | <span data-wp-text="context.line_item.subtotal_display_amount"></span> |
| 144 | </span> |
| 145 | |
| 146 | <span |
| 147 | class="sc-product-line-item__price-description" |
| 148 | data-wp-bind--hidden="!context.line_item.price.short_interval_text" |
| 149 | data-wp-text="context.line_item.price.short_interval_text" |
| 150 | ></span> |
| 151 | |
| 152 | <span |
| 153 | class="sc-product-line-item__price-description" |
| 154 | data-wp-bind--hidden="!context.line_item.price.short_interval_count_text" |
| 155 | data-wp-text="context.line_item.price.short_interval_count_text" |
| 156 | ></span> |
| 157 | </div> |
| 158 | |
| 159 | <div |
| 160 | class="sc-product-line-item__trial sc-product-line-item__price-description" |
| 161 | data-wp-bind--hidden="!context.line_item.price.trial_text" |
| 162 | data-wp-text="context.line_item.price.trial_text" |
| 163 | ></div> |
| 164 | |
| 165 | <div |
| 166 | class="sc-product-line-item__setup-fee sc-product-line-item__price-description" |
| 167 | data-wp-bind--hidden="!context.line_item.price.setup_fee_text" |
| 168 | data-wp-text="context.line_item.price.setup_fee_text" |
| 169 | ></div> |
| 170 | |
| 171 | <div |
| 172 | class="sc-product-line-item__purchasable-status sc-product-line-item__price-description" |
| 173 | data-wp-text="context.line_item.purchasable_status_display" |
| 174 | data-wp-bind--hidden="!context.line_item.purchasable_status_display" |
| 175 | role="status" |
| 176 | aria-live="polite" |
| 177 | aria-atomic="true"> </div> |
| 178 | </div> |
| 179 | </div> |
| 180 | </div> |
| 181 | </div> |
| 182 | </template> |
| 183 | </div> |
| 184 |