generated from autonomic-cooperative/wordpress-starter
Compare commits
40 Commits
f1e9f53c41
...
staging
Author | SHA1 | Date | |
---|---|---|---|
22063a6ba0 | |||
8a17a922ac | |||
960d6a22f2 | |||
9e049f7fa6 | |||
2e30e12488 | |||
a9b655e04f | |||
5832b48479 | |||
7890a955ce | |||
986f7d8856 | |||
52e97d16d8 | |||
45c13bf515 | |||
70886ea67d | |||
83be51bf32 | |||
6f3069bee9 | |||
cd14c04689 | |||
dfdf13cf6f | |||
39ba56eca6 | |||
d6004d6cb3 | |||
e7f5673a19 | |||
0852986599 | |||
b3f48f098c | |||
7563c632f5 | |||
cc541c9e7f | |||
de601b4266 | |||
2bb5cf122c | |||
4ea9d5d69c | |||
525e7c1463 | |||
34d9cf604f | |||
58d67a4ec6 | |||
bbca48ef59 | |||
19cd99cea7 | |||
e70171a798 | |||
cd564dc6fe | |||
0ed33f7321 | |||
b43b5989eb | |||
5df235a208 | |||
ad65b5a4b8 | |||
83e8133d3b | |||
3ea3cf7e6f | |||
2046a23a4b |
15
.drone.yml
15
.drone.yml
@ -2,7 +2,7 @@
|
||||
kind: pipeline
|
||||
name: deploy main branch to live site
|
||||
steps:
|
||||
- name: docker cp deploy
|
||||
- name: copy theme files to staging
|
||||
image: git.coopcloud.tech/coop-cloud/docker-cp-deploy:latest
|
||||
settings:
|
||||
host: smol-wp.autonomic.zone
|
||||
@ -12,6 +12,19 @@ steps:
|
||||
dest: /var/www/html/
|
||||
deploy_key:
|
||||
from_secret: drone_ssh_smol-wp.autonomic.zone
|
||||
when:
|
||||
branch:
|
||||
- staging
|
||||
- name: copy theme files to live
|
||||
image: appleboy/drone-scp
|
||||
settings:
|
||||
host: web1.mont58coffee.com
|
||||
username: autonomic
|
||||
overwrite: true
|
||||
key:
|
||||
from_secret: drone_ssh_mont58coffee.com
|
||||
target: /var/www/production.mont58coffee.com/web/
|
||||
source: wp-content/themes/mont58-coffee/
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
|
@ -2,6 +2,10 @@
|
||||
# REQUIRED SETTINGS (you will need these) #
|
||||
##############################################################################
|
||||
|
||||
# run `make fetch_db_info` to find these out
|
||||
DB_USER=
|
||||
DB_PASSWORD=
|
||||
DB_NAME=
|
||||
|
||||
##############################################################################
|
||||
# COMMON SETTINGS (you may need these) #
|
||||
@ -37,5 +41,10 @@ PROJECT_NAME=mont58
|
||||
# Site URL, also just needs to be set once per project
|
||||
SITE_URL=mont58-staging.smol-wp.autonomic.zone
|
||||
|
||||
SSH_USER=autonomic
|
||||
SSH_HOST=web1.mont58coffee.com
|
||||
SSH_PATH=/var/www/production.mont58coffee.com/web/
|
||||
SSH_PORT=22
|
||||
|
||||
# Multi-site config
|
||||
#WORDPRESS_CONFIG_EXTRA="define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); define('DOMAIN_CURRENT_SITE', 'frms.localhost'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); define('SUNRISE', true);"
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,7 +3,7 @@
|
||||
/node_modules
|
||||
|
||||
/wp-content/**
|
||||
!/wp-content/themes/mont58-coffee/**
|
||||
|
||||
|
||||
/data/**
|
||||
!/data/.gitkeep
|
||||
|
14
.gitignore~
Normal file
14
.gitignore~
Normal file
@ -0,0 +1,14 @@
|
||||
/.env
|
||||
|
||||
/node_modules
|
||||
|
||||
/wp-content/**
|
||||
!/wp-content/themes/mont58-coffee/**
|
||||
|
||||
/data/**
|
||||
!/data/.gitkeep
|
||||
|
||||
.vscode/
|
||||
**.tar.gz
|
||||
**.sql
|
||||
**.zip
|
@ -22,12 +22,14 @@ services:
|
||||
- WORDPRESS_DB_NAME=wordpress
|
||||
- WORDPRESS_CONFIG_EXTRA=${WORDPRESS_CONFIG_EXTRA}
|
||||
- WORDPRESS_DEBUG=${WORDPRESS_DEBUG}
|
||||
- WORDPRESS_TABLE_PREFIX=kM7KXt7HQ_
|
||||
- PHP_EXTENSIONS=calendar
|
||||
- PAGER=more
|
||||
container_name: "${PROJECT_NAME}_wordpress"
|
||||
|
||||
db:
|
||||
image: "mariadb:10.6"
|
||||
command: --innodb-buffer-pool-size=10G
|
||||
volumes:
|
||||
- "${MARIADB_VOLUME:-mariadb}:/var/lib/mysql"
|
||||
networks:
|
||||
|
@ -8,6 +8,8 @@ if [ -n "$PHP_EXTENSIONS" ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
echo 'memory_limit = 2048M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini;
|
||||
|
||||
if ! id -u "user" >/dev/null ; then
|
||||
useradd -u 1000 -m user
|
||||
mkdir /var/www/html/vendor
|
||||
|
63
makefile
63
makefile
@ -109,14 +109,53 @@ uploads_load:
|
||||
## Sync wp-content from site
|
||||
uploads_pull: uploads_fetch uploads_load
|
||||
|
||||
fetch_db_info:
|
||||
ssh -p$(SSH_PORT) $(SSH_USER)@$(SSH_HOST) grep DB $(SSH_PATH)/wp-config.php
|
||||
|
||||
## Download database from dev site
|
||||
db_fetch:
|
||||
$(ABRA) app run $(SITE_URL) db bash -c 'mariadb-dump -u root -p"$$(cat /run/secrets/db_root_password)" wordpress' | gzip > data/dbdump.sql.gz
|
||||
ssh -p$(SSH_PORT) autonomic@web1.mont58coffee.com mysqldump -u $(DB_USER) -p$(DB_PASSWORD) "$(DB_NAME)" | gzip > data/dbdump.sql.gz
|
||||
|
||||
## Load latest database from ~/.abra/backups
|
||||
db_load:
|
||||
zcat data/dbdump.sql.gz | $(_DOCKER_COMPOSE) exec -T db mysql -u wordpress -pwordpress wordpress
|
||||
|
||||
db_pull: db_fetch db_load fix_url
|
||||
|
||||
define SQL_HEADER
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
endef
|
||||
export SQL_HEADER
|
||||
|
||||
define SQL_FOOTER
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
endef
|
||||
export SQL_FOOTER
|
||||
|
||||
db_convert:
|
||||
gunzip data/database.sql.gz
|
||||
sed -i -e 's/SERVMASK_PREFIX/wp/g' -e 's/,0x,/,0,/g' data/database.sql
|
||||
echo "$$SQL_HEADER" | cat - data/database.sql > data/database_wrapped.sql
|
||||
echo "$$SQL_FOOTER" >> data/database_wrapped.sql
|
||||
mv data/database_wrapped.sql data/database.sql
|
||||
|
||||
## Replace site URL
|
||||
fix_url:
|
||||
$(_DOCKER_COMPOSE) exec -u user wordpress wp --url=https://$(SITE_URL) search-replace --all-tables-with-prefix 'https://$(SITE_URL)' 'http://$(PROJECT_NAME).localhost'
|
||||
@ -125,18 +164,8 @@ fix_url:
|
||||
set_local_password:
|
||||
$(_DOCKER_COMPOSE) exec -u user wordpress wp user update $(USERNAME) --user_pass=password
|
||||
|
||||
db_pull: db_fetch db_load fix_url
|
||||
|
||||
## Download wp-content files from site
|
||||
plugins_fetch:
|
||||
$(ABRA) app run --no-tty $(SITE_URL) app tar --owner=0 --group=0 --no-same-owner --no-same-permissions -czf- /var/www/html/wp-content/plugins/ > data/plugins.tar.gz
|
||||
|
||||
## Load latest plugins from data/plugins.tar.gz
|
||||
plugins_load:
|
||||
tar -C wp-content --strip-components=4 -xzf data/plugins.tar.gz
|
||||
|
||||
## Sync plugins from site
|
||||
plugins_pull: plugins_fetch plugins_load
|
||||
plugins_pull:
|
||||
rsync -Pavz -e 'ssh -p$(SSH_PORT)' $(SSH_USER)@$(SSH_HOST):$(SSH_PATH)/wp-content/plugins/ wp-content/plugins/
|
||||
|
||||
## Download parent theme from site
|
||||
theme_fetch:
|
||||
@ -149,6 +178,14 @@ theme_load:
|
||||
## Sync wp-content from site
|
||||
theme_pull: theme_fetch theme_load
|
||||
|
||||
#######################################
|
||||
# Releases
|
||||
#######################################
|
||||
|
||||
# Generate ZIP of theme
|
||||
theme_export:
|
||||
cd wp-content/themes/mont58-coffee/ && zip -r ../../../data/mont58-theme_2024-07-09.zip . && cd -
|
||||
|
||||
# "Arguments" for makefiles..
|
||||
# https://stackoverflow.com/a/6273809/1826109
|
||||
%:
|
||||
|
Binary file not shown.
@ -152,27 +152,29 @@ function action_wcs_renewal_order_created($order, $subscription)
|
||||
$order_coffees = [];
|
||||
$seen_subscriptions = [];
|
||||
|
||||
// Get the latest coffee seen in each coffee list from the previous order
|
||||
foreach (array_reverse($last_order_coffees) as $last_order_coffee) {
|
||||
if (
|
||||
array_key_exists(
|
||||
$last_order_coffee["coffee_list"]->ID,
|
||||
$seen_subscriptions
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
if ($last_order_coffees) { // Check last_order_coffees isn't null or false
|
||||
// Get the latest coffee seen in each coffee list from the previous order
|
||||
foreach (array_reverse($last_order_coffees) as $last_order_coffee) {
|
||||
if (
|
||||
array_key_exists(
|
||||
$last_order_coffee["coffee_list"]->ID,
|
||||
$seen_subscriptions
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$position_in_list = array_search(
|
||||
$last_order_coffee["coffee"]->ID,
|
||||
$last_order_coffee["coffee_list"]->coffees
|
||||
);
|
||||
if ($position_in_list === false) {
|
||||
// ignore this, can't find it in list anymore
|
||||
continue;
|
||||
}
|
||||
$seen_subscriptions[
|
||||
$last_order_coffee["coffee_list"]->ID
|
||||
] = $position_in_list;
|
||||
}
|
||||
$position_in_list = array_search(
|
||||
$last_order_coffee["coffee"]->ID,
|
||||
$last_order_coffee["coffee_list"]->coffees
|
||||
);
|
||||
if (!$position_in_list) {
|
||||
// ignore this, can't find it in list anymore
|
||||
continue;
|
||||
}
|
||||
$seen_subscriptions[
|
||||
$last_order_coffee["coffee_list"]->ID
|
||||
] = $position_in_list;
|
||||
}
|
||||
|
||||
// Process coffee items based on the coffees in the last order
|
||||
@ -181,6 +183,8 @@ function action_wcs_renewal_order_created($order, $subscription)
|
||||
// Update the custom field "coffees" with the processed coffee data for the current renewal order
|
||||
update_field("coffees", $order_coffees, $order->get_ID());
|
||||
}
|
||||
|
||||
return $order;
|
||||
}
|
||||
// Hook the above function to the 'wcs_renewal_order_created' action
|
||||
add_action(
|
||||
@ -197,7 +201,7 @@ function mont58_coffee_label_add_sidepanel()
|
||||
{
|
||||
add_meta_box(
|
||||
"mont58_coffee_label_sidepanel",
|
||||
"Coffee Label",
|
||||
"Label",
|
||||
"mont58_coffee_label_render_sidepanel",
|
||||
"shop_order",
|
||||
"side",
|
||||
@ -246,13 +250,3 @@ add_filter(
|
||||
10,
|
||||
3
|
||||
);
|
||||
|
||||
// import acumin variable font
|
||||
function mont58coffee_enqueue_fonts()
|
||||
{
|
||||
wp_enqueue_style(
|
||||
"mont58coffee-fonts",
|
||||
get_theme_file_uri("/fonts/acumin-variable-concept.css")
|
||||
);
|
||||
}
|
||||
add_action("wp_enqueue_scripts", "mont58coffee_enqueue_fonts");
|
@ -2,6 +2,6 @@
|
||||
Theme Name: Mont58 Coffee
|
||||
Description: Theme for mont58coffee.com - child theme of Bridge
|
||||
Template: bridge
|
||||
Version: 1.0.0
|
||||
Version: 1.1.0
|
||||
Text Domain: mont58coffee
|
||||
*/
|
||||
*/
|
||||
|
@ -13,100 +13,144 @@ if(!is_user_logged_in()){
|
||||
<title>Coffee Label</title>
|
||||
<link rel="preconnect" href="https://api/fonts.coollabs.io">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@100..900&display=swap" rel="stylesheet">
|
||||
<link href="<?php echo get_theme_file_uri('/fonts/acumin-variable-concept.css') ?>" rel="stylesheet">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<style>
|
||||
@page {
|
||||
size: 7cm 7cm;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* acumin-variable-concept */
|
||||
@font-face {
|
||||
font-family: Acumin Variable Concept;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local("Acumin Variable Concept"), local("AcuminVariableConcept"), url(<?php echo get_theme_file_uri('/fonts/acumin-variable-concept.woff2'); ?>) format("woff2");
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.label {
|
||||
width: calc(0.35* 400px);
|
||||
height: calc(0.35 *400px);
|
||||
width: 6.8cm;
|
||||
height: 6.8cm;
|
||||
border-radius: 50%;
|
||||
padding: calc(0.35 * 2rem);
|
||||
/* margin: calc(0.35 * 2rem); */
|
||||
margin: 0.05cm;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
background: linear-gradient(
|
||||
0deg,
|
||||
rgba(255, 255, 255, 1) 28%,
|
||||
rgba(231, 184, 32, 1) 28%
|
||||
);
|
||||
/* border: 1px solid black; */
|
||||
}
|
||||
|
||||
.label .product-details {
|
||||
font-family: 'Acumin Variable Concept', sans-serif;
|
||||
font-size: calc(0.35 * 21px);
|
||||
letter-spacing: calc(0.35 * 2px);
|
||||
letter-spacing: 0.23mm;
|
||||
text-transform: uppercase;
|
||||
margin-top: 2.5em;
|
||||
margin-bottom: 2em;
|
||||
font-weight: 500;
|
||||
margin-top: 0.6cm;
|
||||
font-weight: bold;
|
||||
font-variation-settings: 'wdth' 58, 'wght' 600;
|
||||
font-size: 4mm;
|
||||
}
|
||||
|
||||
.label .product-details p {
|
||||
margin-block: 0.5em;
|
||||
margin-block: 1.5mm;
|
||||
}
|
||||
|
||||
.label .product-details .origin {
|
||||
font-size: calc(0.35 * 28px);
|
||||
font-size: 4mm; /* so that 20 char names fit on one line */
|
||||
font-weight: 700;
|
||||
letter-spacing: calc(0.35 * 4px);
|
||||
margin-block: 1.2em 0.8em;
|
||||
min-height: calc(0.35 * 33px);
|
||||
letter-spacing: calc(0.4 * 4px);
|
||||
margin-block: 3mm;
|
||||
min-height: 3mm;
|
||||
font-variation-settings: 'wdth' 70, 'wght' 600;
|
||||
margin-inline: auto;
|
||||
}
|
||||
|
||||
.label .product-details .origin.non-coffee {
|
||||
margin-top: 2.3cm;
|
||||
}
|
||||
|
||||
.label .product-details .weight {
|
||||
text-transform: lowercase;
|
||||
font-weight: bold;
|
||||
font-family: sans-serif;
|
||||
font-size: calc(0.35 * 18px);
|
||||
font-size: 4mm;
|
||||
}
|
||||
|
||||
.label .product-details .code {
|
||||
min-height: calc(0.35 * 20px);
|
||||
letter-spacing: calc(0.35 * 10px);
|
||||
margin-top: 1.5em;
|
||||
font-size: calc(0.35 * 16px);
|
||||
min-height: 6mm;
|
||||
letter-spacing: calc(0.4 * 10px);
|
||||
margin-top: 2mm;
|
||||
font-size: 4mm;
|
||||
}
|
||||
|
||||
.label .order-details {
|
||||
padding-bottom: 1em;
|
||||
font-size: calc(0.35 * 17px);
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
font-size: 3.9mm; /* so that names as long as 50 characters stay on one line */
|
||||
position: absolute;
|
||||
bottom: 1.8mm; /* Adjust this value to set the distance from the bottom of the label */
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.label .order-details p {
|
||||
margin-block: 0.4em;
|
||||
margin-block: 0.5mm;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<?php
|
||||
$j = 0;
|
||||
|
||||
foreach ($_GET["order_ids"] as $order_id) {
|
||||
$order = wc_get_order($order_id);
|
||||
$first_name = $order->get_billing_first_name();
|
||||
$last_name = $order->get_billing_last_name();
|
||||
$postcode = $order->get_billing_postcode();
|
||||
|
||||
// Check if shipping details exist
|
||||
$shipping_first_name = $order->get_shipping_first_name();
|
||||
$shipping_last_name = $order->get_shipping_last_name();
|
||||
$shipping_postcode = $order->get_shipping_postcode();
|
||||
|
||||
// If any shipping detail is empty, use billing details
|
||||
if (empty($shipping_first_name) || empty($shipping_last_name) || empty($shipping_postcode)) {
|
||||
$first_name = $order->get_billing_first_name();
|
||||
$last_name = $order->get_billing_last_name();
|
||||
$postcode = $order->get_billing_postcode();
|
||||
} else {
|
||||
$first_name = $shipping_first_name;
|
||||
$last_name = $shipping_last_name;
|
||||
$postcode = $shipping_postcode;
|
||||
}
|
||||
|
||||
$items = $order->get_items();
|
||||
$total_items = $order->get_item_count();
|
||||
$roast_date = (new DateTime())->modify("-3 days")->format("d/m/Y");
|
||||
$gift_message = $order->get_meta("_shipping_gift_message");
|
||||
|
||||
$order_subscription_coffees = get_field("coffees", $order_id);
|
||||
|
||||
$is_new = false;
|
||||
|
||||
foreach ($items as $item) {
|
||||
$j = 0;
|
||||
|
||||
// checking if product is a coffee
|
||||
$product_id = $item->get_product_id();
|
||||
$product_categories = get_the_terms($product_id, "product_cat");
|
||||
$is_coffee = false;
|
||||
$is_subscription = false;
|
||||
$is_organic = false;
|
||||
|
||||
if (
|
||||
!empty($product_categories) &&
|
||||
@ -122,14 +166,17 @@ if(!is_user_logged_in()){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$product_name = '';
|
||||
$roast = '';
|
||||
|
||||
if (!$is_coffee && !$is_subscription) {
|
||||
continue;
|
||||
if ($is_coffee || $is_subscription) {
|
||||
$brew_method = $item->get_meta("pa_brew-method");
|
||||
$weight = $item->get_meta("weight");
|
||||
} else {
|
||||
$product_name = $item->get_name();
|
||||
}
|
||||
|
||||
$brew_method = $item->get_meta("pa_brew-method");
|
||||
$weight = $item->get_meta("weight");
|
||||
|
||||
if ($is_coffee) {
|
||||
// Non-subscription order
|
||||
$product_name = $item->get_name();
|
||||
@ -152,19 +199,27 @@ if(!is_user_logged_in()){
|
||||
$quantity = $item->get_quantity();
|
||||
for ($i = 0; $i < $quantity; $i++) {
|
||||
if ($is_subscription) {
|
||||
$coffee = $order_subscription_coffees[$i + $j]["coffee"];
|
||||
$product_name = $coffee->post_title;
|
||||
$roast = get_field("roast_level", $coffee->ID);
|
||||
$is_organic = get_field("is_organic", $coffee->ID);
|
||||
} ?>
|
||||
if (($order_subscription_coffees !== null)
|
||||
&& (is_object($order_subscription_coffees[$i + $j]["coffee"]))){
|
||||
$coffee = $order_subscription_coffees[$i + $j]["coffee"];
|
||||
$product_name = $coffee->post_title;
|
||||
$roast = get_field("roast_level", $coffee->ID);
|
||||
$is_organic = get_field("is_organic", $coffee->ID);
|
||||
}
|
||||
} ?>
|
||||
|
||||
<div class="label">
|
||||
<div>
|
||||
<div class="product-details">
|
||||
<?php if ($is_coffee || $is_subscription) { ?>
|
||||
<p class="weight"><?php echo $weight; ?></p>
|
||||
<p class="origin"><?php echo $product_name; ?></p>
|
||||
<?php } ?>
|
||||
<p class="origin<?php echo ($is_coffee || $is_subscription) ? "" : " non-coffee"; ?>"><?php echo $product_name; ?></p>
|
||||
<?php if ($is_coffee || $is_subscription) { ?>
|
||||
<p class="bean-type"><?php echo $brew_method; ?></p>
|
||||
<p class="roast"><?php echo $roast; ?> Roast</p>
|
||||
<p class="date">Roasted on: <span><?php echo $roast_date; ?></span></p>
|
||||
<?php } ?>
|
||||
<p class="code"><?php
|
||||
echo $is_new ? "N" : "";
|
||||
echo $gift_message ? "G" : "";
|
||||
@ -172,7 +227,13 @@ if(!is_user_logged_in()){
|
||||
?></p>
|
||||
</div>
|
||||
<div class="order-details">
|
||||
<p class="customer-name"><?php echo "$first_name $last_name"; ?></p>
|
||||
<?php
|
||||
$customer_name = "$first_name $last_name";
|
||||
if (strlen($customer_name) > 26) {
|
||||
$customer_name = substr($customer_name, 0, 25) . '…';
|
||||
}
|
||||
?>
|
||||
<p class="customer-name"><?php echo $customer_name; ?></p>
|
||||
<p class="purchase-code"><?php echo $postcode; ?></p>
|
||||
<p class="quantity"><?php echo $total_items; ?></p>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user