This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import stripe | |
stripe.api_key="" | |
def create_payment(): | |
# This is just an example. You would need to handle payments in a secure environment | |
session = stripe.checkout.Session.create( | |
payment_method_types=['card'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Document, { Html, Head, Main, NextScript } from "next/document" | |
import { ServerStyleSheet, createGlobalStyle } from "styled-components" | |
const GlobalStyle = createGlobalStyle` | |
body { | |
padding: 0; | |
margin: 0; | |
} | |
` | |
class MyDocument extends Document { | |
static async getInitialProps(ctx) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wootips_hide_price_add_cart_not_logged_in() { | |
if ( !is_user_logged_in() ) { | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); | |
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); | |
add_action( 'woocommerce_single_product_summary', 'wootips_print_login_to_see', 31 ); | |
add_action( 'woocommerce_after_shop_loop_item', 'wootips_print_login_to_see', 11 ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Jackson Template</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VIEWS | |
def index(request): | |
template = loader.get_template('index.html') | |
return HttpResponse(template.render({},request)) | |
========================= |