Skip to content

Commit

Permalink
Merge pull request #28 from FosterCommerce/fix/meta-data
Browse files Browse the repository at this point in the history
Fix/meta data
  • Loading branch information
pseudoclass authored Sep 15, 2024
2 parents 58f1de0 + 51c9161 commit 5028e4e
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
// The relative path from the web root of the logo file
// (ex. '/assets/images/logo.svg')
'logo' => '',

// The first part of the text in the title meta tag.
// Leave blank to use the Craft's siteName
'title' => '',
],

// Path Settings
Expand Down
1 change: 1 addition & 0 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Settings extends Model
'color' => '#1F2937',
'font' => 'Rubik',
'logo' => '',
'title' => '',
];

public array $paths = [
Expand Down
11 changes: 7 additions & 4 deletions src/templates/_layouts/default.twig
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="robots" content="noindex, nofollow" />

{% block head %}
<title>Foster Checkout</title>
<title>
{{ craft.checkout.branding.title ? craft.checkout.branding.title : siteName }}
</title>
{% endblock %}

<link rel="preconnect" href="https://fonts.googleapis.com"/>
Expand Down
4 changes: 4 additions & 0 deletions src/templates/cart/index.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{% extends 'foster-checkout/_layouts/default' %}

{% block head %}
<title>{{ craft.checkout.branding.title ? craft.checkout.branding.title : siteName }} | {{ 'Cart'|t('foster-checkout') }}</title>
{% endblock %}

{% block body %}

{% if cart.lineItems|length > 0 %}
Expand Down
8 changes: 8 additions & 0 deletions src/templates/checkout/address.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
{% set primaryShippingAddressId = currentUser ? (currentUser.getPrimaryShippingAddressId() ?? -1) : -1 %}
{% set newAddress = false %}

{% block head %}
<title>
{{ craft.checkout.branding.title ? craft.checkout.branding.title : siteName }} |
{{ 'Checkout'|t('foster-checkout') }} |
{{ 'Address'|t('foster-checkout') }}
</title>
{% endblock %}

{% block body %}
<div class="mt-10 pb-48 lg:mt-20 lg:pb-32">

Expand Down
8 changes: 8 additions & 0 deletions src/templates/checkout/email.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% extends 'foster-checkout/_layouts/default' %}

{% block head %}
<title>
{{ craft.checkout.branding.title ? craft.checkout.branding.title : siteName }} |
{{ 'Checkout'|t('foster-checkout') }} |
{{ 'Email'|t('foster-checkout') }}
</title>
{% endblock %}

{% block body %}

<div class="max-w-[740px] mx-auto my-10 md:my-20">
Expand Down
8 changes: 8 additions & 0 deletions src/templates/checkout/order.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
{% exit 404 %}
{% endif %}

{% block head %}
<title>
{{ craft.checkout.branding.title ? craft.checkout.branding.title : siteName }} |
{{ 'Checkout'|t('foster-checkout') }} |
{{ 'Order'|t('foster-checkout') }}
</title>
{% endblock %}

{% block body %}

<div
Expand Down
8 changes: 8 additions & 0 deletions src/templates/checkout/payment.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% extends 'foster-checkout/_layouts/default' %}

{% block head %}
<title>
{{ craft.checkout.branding.title ? craft.checkout.branding.title : siteName }} |
{{ 'Checkout'|t('foster-checkout') }} |
{{ 'Payment'|t('foster-checkout') }}
</title>
{% endblock %}

{% block body %}
{% set gateways = craft.commerce.gateways.getAllCustomerEnabledGateways %}
{% set addresses = currentUser ? (currentUser.addresses.all() ?? null) : null %}
Expand Down
8 changes: 8 additions & 0 deletions src/templates/checkout/shipping.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% extends 'foster-checkout/_layouts/default' %}

{% block head %}
<title>
{{ craft.checkout.branding.title ? craft.checkout.branding.title : siteName }} |
{{ 'Checkout'|t('foster-checkout') }} |
{{ 'Shipping'|t('foster-checkout') }}
</title>
{% endblock %}

{% block body %}
{% set availableShippingMethodOptions = cart.availableShippingMethodOptions ?? null %}
{% set onlyMethod = null %}
Expand Down

0 comments on commit 5028e4e

Please sign in to comment.