TutorLMSService.php
4 months ago
TutorLMSServiceProvider.php
4 years ago
add-to-cart-surecart.php
1 year ago
add-to-cart-surecart.php
34 lines
| 1 | <?php |
| 2 | use SureCart\Support\Currency; |
| 3 | |
| 4 | foreach ( $prices as $price ) : ?> |
| 5 | <a class="tutor-btn tutor-btn-primary tutor-btn-lg tutor-btn-block tutor-mt-24 tutor-add-to-cart-button" |
| 6 | href=" |
| 7 | <?php |
| 8 | echo esc_url( |
| 9 | add_query_arg( |
| 10 | [ |
| 11 | 'line_items' => [ |
| 12 | [ |
| 13 | 'price_id' => $price->id, |
| 14 | 'quantity' => 1, |
| 15 | ], |
| 16 | ], |
| 17 | ], |
| 18 | \SureCart::pages()->url( 'checkout' ) |
| 19 | ) |
| 20 | ); |
| 21 | ?> |
| 22 | "> |
| 23 | <span> |
| 24 | <?php esc_html_e( 'Purchase', 'surecart' ); ?> |
| 25 | <?php if ( $price->scratch_amount > 0 ) : ?> |
| 26 | <del><?php echo esc_html( Currency::format( $price->scratch_amount ?? 0, $price->currency ) ); ?></del> |
| 27 | <?php endif; ?> |
| 28 | <?php echo esc_html( Currency::format( $price->amount ?? 0, $price->currency ) ); ?> |
| 29 | |
| 30 | <sc-format-interval value="<?php echo (int) $price->recurring_interval_count; ?>" interval="<?php echo esc_attr( $price->recurring_interval ); ?>"></sc-format-interval> |
| 31 | </span> |
| 32 | </a> |
| 33 | <?php endforeach; ?> |
| 34 |