PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 4.2.2
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v4.2.2
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / views / web / buy.php
buy.php
92 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Template Name: SureCart
4 */
5
6 use SureCartBlocks\Blocks\Form\Block as FormBlock;
7
8 // this needs to happen before wp_head to ensure that blocks can add scripts and styles in wp_head().
9 global $post;
10 $post = $product->post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
11 setup_postdata( $product->post );
12 ob_start();
13 require 'buy-template.php';
14 $content = ob_get_clean();
15
16 $template_html = filter_block_content(
17 ( new FormBlock() )->render(
18 [
19 'product' => $product,
20 'mode' => $mode,
21 'success_url' => $success_url,
22 ],
23 do_blocks( $content )
24 ),
25 );
26
27 ?>
28 <!DOCTYPE html>
29 <html <?php language_attributes(); ?>>
30
31 <head>
32 <meta charset="<?php bloginfo( 'charset' ); ?>" />
33 <meta name="viewport" content="width=device-width, initial-scale=1">
34 <?php wp_head(); ?>
35 <style>
36 /** block editor theme fix. */
37 body .is-layout-constrained > * + * {
38 margin-top: 0;
39 }
40 </style>
41 </head>
42
43 <body <?php body_class( 'sc-buy-page' ); ?>>
44
45 <?php wp_body_open(); ?>
46
47 <?php do_action( 'surecart_buy_page_body_open' ); ?>
48
49 <header class="sc-buy-header">
50 <div class="sc-buy-logo">
51 <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
52 <?php if ( ! empty( $show_logo ) && ! empty( $logo_url ) ) : ?>
53 <img src="<?php echo esc_url( $logo_url ?? '' ); ?>"
54 style="max-width: <?php echo esc_attr( $logo_width ?? '180px' ); ?>; width: 100%; height: auto;"
55 alt="<?php echo esc_attr( get_bloginfo() ); ?>"
56 />
57 <?php endif; ?>
58 </a>
59 <?php if ( empty( $enabled ) ) : ?>
60 <sc-tag type="warning" size="small">
61 <?php esc_html_e( 'Not Published', 'surecart' ); ?>
62 </sc-tag>
63 <?php endif; ?>
64 </div>
65
66 <?php if ( ! empty( $user->ID ) ) : ?>
67 <sc-dropdown position="bottom-right" style="font-size: 15px;">
68 <sc-avatar image="<?php echo esc_url( get_avatar_url( $user->user_email, [ 'default' => '404' ] ) ); ?>" style="--sc-avatar-size: 34px" role="button" tabindex="0" initials="<?php echo esc_attr( substr( $user->display_name, 0, 1 ) ); ?>"></sc-avatar>
69 <sc-menu>
70 <?php if ( ! empty( $dashboard_link ) ) : ?>
71 <sc-menu-item href="<?php echo esc_url( $dashboard_link ); ?>">
72 <?php esc_html_e( 'Dashboard', 'surecart' ); ?>
73 </sc-menu-item>
74 <?php endif; ?>
75
76 <?php if ( ! empty( $logout_link ) ) : ?>
77 <sc-menu-item href="<?php echo esc_url( $logout_link ); ?>">
78 <?php esc_html_e( 'Logout', 'surecart' ); ?>
79 </sc-menu-item>
80 <?php endif; ?>
81 </sc-menu>
82 </sc-dropdown>
83 <?php endif; ?>
84 </header>
85
86
87 <?php echo $template_html; ?>
88
89 <?php wp_footer(); ?>
90 </body>
91 </html>
92