Customize Gift Card Code

/* Customize the generated Gift Card Code */ function agcfw_change_prefix() { return array( ‘characters’ => ‘ABCDEFGHJKMNPQRSTUVWXYZ23456789’, // Defines the characters used in the coupon code ‘length’ => 10, // Sets the length of the generated code to 10 characters ‘prefix’…Continue reading

The draft of receipt

from reportlab.lib.pagesizes import A4 from datetime import datetime from reportlab.platypus import Table, TableStyle, Paragraph, SimpleDocTemplate, Image, Frame, PageTemplate from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet current_time = datetime.now() curr_date = current_time.date() time = current_time.strftime(“%H:%M:%S”) receipt_no = current_time.strftime(“%y%m%d%H%M%S”) # Style…Continue reading

CONNECT TO API GATEWAY

// Define the API URL const apiUrl = ‘https://api.example.com/data’; // Make a GET request fetch(apiUrl) .then(response => { if (!response.ok) { throw new Error(‘Network response was not ok’); } return response.json(); }) .then(data => { console.log(data); }) .catch(error => {…Continue reading

MemberPress: Bulk Delete All Expired Subscriptions

function mepr_delete_expired_txns() { $subscriptions = MeprSubscription::get_all(); if( is_array( $subscriptions ) && !empty( $subscriptions ) ) { foreach( $subscriptions as $subscription ) { $subscription = new MeprSubscription( $subscription->id ); if( $subscription->is_cancelled() && $subscription->is_expired() ) { $subscription->destroy(); } } } } add_action(…Continue reading