1.7.xモジュールのアップデートで1 Click UpdateがUpdate Assistantへ更新されます。
PHPバージョンは、1.7.xがサポートしているバージョン7.4を維持。
アップグレード後、以下のエラーを修正。
Table ‘store.ps_layered_filter_block’ doesn’t exist
テーブルを再作成
管理画面で「モジュール」→「モジュールマネージャー」→ Faceted Search (ブロックレイヤードナビゲーション) を確認
再インストール
再インストールすると必要なテーブル (ps_layered_filter_block など) が自動作成されます。
Argument 7 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderInvoiceAddressForViewing::__construct() must be of the type string, array given, called in /var/www/html/src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php on line 356
以下参照して該当ファイルのコード書換え。
[Screenshot from 2025-02-25 08-35-08]
Type error: Argument 7 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderInvoiceAddressForViewing::__construct() must be of the type string, ar…
store/src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php
/*
if ($address->id_state) {
$state = new State($address->id_state);
$stateName = $state->name;
}
*/
if ($address->id_state) {
$state = new State($address->id_state);
$langId = (int) $order->getAssociatedLanguage()->getId();
// `name` が配列の場合、現在の言語 ID に対応する値を取得
if (is_array($state->name)) {
$stateName = $state->name[$langId] ?? reset($state->name);
} else {
$stateName = $state->name;
}
}
overrideフォルダの旧ファイルのリネーム
バージョン1.6から引き継がれているPHPコード(クラス)を無効化するため、overrideフォルダ内のindex.phpを除く全てのPHPクラスファイルを無効化。キャッシュをクリアし、クラスへの参照を全てclassesへ移行。
$ sudo rm -r var/cache/*
$ sudo mv override/classes/xxx.php override/classes/xxx.php.bak
php-fpmのベースイメージを7.4から8.1へアップグレード
prestashop/prestashop - Docker Image
ドキュメント
Learn how to extend, modify and test PrestaShop, create modules, themes, and more.
E-Mail送信テスト
注文後のメール送信テストは下記テンプレートを選択して実行。
国・地域別アクセス制限設定
https://www.prestashop.com/forums/topic/1073412-geolocation-ps-1788/
トラブルシュート
注文メール表示エラー
Emailテーマでテンプレートを上書き後発生
テーブルセルのズレ
以下の要素がそれぞれ参照ファイルにより独自のテーブルを作成しているが、テンプレートで各テーブルを完全に分離した状態で配置していない。
{products} : mails/_partials/order_conf_product_list.tpl
{discounts} : mails/_partials/order_conf_cart_rules.tpl
翻訳テンプレートから修正するか、言語ごとに以下のファイルを直接編集。
翻訳テンプレートの以下の編集画面でテーブルの列を追加してセルをマージ、{products} {discounts} をマージしたセルへ移動。
修正ファイル(修正箇所のみ)
themes/classic/mails/en/order_conf.html
<table class="table table-recap" bgcolor="#ffffff"><!-- Title -->
<tbody>
<tr>
<th bgcolor="#fbfbfb" style="border: 1px solid #D6D4D4; background-color: #fbfbfb; color: #333; font-family: Arial; font-size: 13px; padding: 10px;">Reference</th>
<th bgcolor="#fbfbfb" style="border: 1px solid #D6D4D4; background-color: #fbfbfb; color: #333; font-family: Arial; font-size: 13px; padding: 10px;">Product</th>
<th bgcolor="#fbfbfb" style="border: 1px solid #D6D4D4; background-color: #fbfbfb; color: #333; font-family: Arial; font-size: 13px; padding: 10px;" width="17%">Unit price</th>
<th bgcolor="#fbfbfb" style="border: 1px solid #D6D4D4; background-color: #fbfbfb; color: #333; font-family: Arial; font-size: 13px; padding: 10px;">Quantity</th>
<th bgcolor="#fbfbfb" style="border: 1px solid #D6D4D4; background-color: #fbfbfb; color: #333; font-family: Arial; font-size: 13px; padding: 10px;" width="17%">Total price</th>
</tr>
<tr>
<th bgcolor="#fbfbfb" style="border: 1px solid #D6D4D4; background-color: #fbfbfb; color: #333; font-family: Arial; font-size: 13px; padding: 10px;" colspan="5">{products} {discounts}</th>
</tr>
セラーへ新規注文メールが送信されない
モジュール専用テンプレートディレクトリ
themes/classic/modules/ps_emailalerts/mails/en/new_order.html
を
themes/classic/mails/en/new_order.html
にコピーしないとテンプレートが有効にならない。
PrestaShopのメールテンプレート読み込み処理 は、基本的にモジュール専用のメールテンプレートをこの場所からは参照しないようです。
Manropeフォント崩れ
https://www.prestashop.com/forums/topic/1077642-ps-8-help-with-font-and-background-for-the-store-page/
一部ブラウザでフォント崩れが発生するため、デフォルトのクラッシックテーマのフォントをManropeからArialへ変更。
SSH接続して以下ファイルの該当箇所を変更
themes/classic/assets/css/theme.css
body{font-family:Arial,sans-serif; ........................
8.2.4 -> 9.0.3 へのアップデート時のエラー
管理画面でキャッシュをクリアし、ps_mboとps_metricsを無効にしてアップデートを実行すること。
注)ps_metricsについては、無効にしても下記エラーが発生するため、管理画面で無効にしたの上でモジュールそのものを削除、またはフォルダ名を変更して読み込まないようにすること。
/modules/ps_metrics/src/Adapter/LoggerAdapter.php line 75
Declaration of PrestaShop\Module\Ps_metrics\Adapter\LoggerAdapter::emergency
($message, array $context = [])
must be compatible with
Psr\Log\LoggerInterface::emergency(string|\Stringable $message, array $context = []): void
ps_metricsモジュールの LoggerAdapter(emergency($message, array $context = )) が古いため発生したエラー。
上記モジュールを無効にして再度アップデート。このモジュールはショップのプロセスには何も影響しないため名称変更して無効化。
$ docker exec -ti prestashop-fpm bash
# mv ps_metrics ps_metrics_disabled
メール送信エラー
This section provides a list of the most significant changes in PrestaShop 9.0.x. While this list is not exhaustive, it aims to give developers a clear overview of the important updates. If you notice any missing or incorrect information, please help...
MailerはswiftmailerからSymfony Mailerへ変更
Gmailのsmtpポートは587のままだとエラー。465に設定すると送信可。
オープン 07:25PM - 03 Aug 24 UTC
Bug
Major
Email
Regression
9.0.x
### Prerequisites
- [X] I understand and accept the project's [code of conduc… t](https://github.com/PrestaShop/PrestaShop/blob/develop/CODE_OF_CONDUCT.md).
- [X] I have already [searched in existing issues](https://github.com/PrestaShop/PrestaShop/issues?q=is%3Aissue+label%3ABug) and found no previous report of this bug.
### Describe the bug and add attachments
PS 9 implementing Symfony Mailer, PS 8 Swift Mailer.
PS1.7-PS8 with port 587 with TLS working well.
PS9 port 587 isn't working, I investigated, port 465 is working..
**If eshop owner update PrestaShop from version 8 to 9, SMTP will stop working.** (because other port definition)
Huge BC... After update will eshop owner totally lost with this.
I tested more mail providers, same problem. Not related to mail service.
There is changed connection string:
```
PS 8 connection string:
tcp://smtp.seznam.cz:587
PS 9 connection string
ssl://smtp.seznam.cz:587
```
### Expected behavior
Working same like in PS8
### Steps to reproduce
1) BO - tools - emails
2) fill SMTP credentials (TLS + port 587)
3) compare PS8 vs PS9 (PS8 will works, PS9 doesn't work)
### PrestaShop version(s) where the bug happened
9.0.0
### PHP version(s) where the bug happened
8.1+8.2+8.3
### If your bug is related to a module, specify its name and its version
_No response_
### Your company or customer's name goes here (if applicable).
https://www.openservis.cz/
Friendly URL(URL書き換え)のリセット
管理画面にブラウザからアクセスできなくなった場合、データベースでリセット
PS_REWRITING_SETTINGS( テーブルps_configuration )を検索して1から0へ変更。
キャッシュ削除
# rm -rf var/cache/*
ログイン不可
IDとパスワードは正しく、ログイン画面に戻ってきてしまう。
.htaccessファイルに以下のみを指定。
SetEnvIf X-Forwarded-Proto https HTTPS=on
下記データを一時的に無効
PS_COOKIE_CHECKIP を 0
ログインして以下手順で.htaccessを再生成
管理画面の ショップパラメータ > トラフィック & SEO に移動。
下の方にある「URLの設定」セクションで、フレンドリーURLを一度「いいえ」にして保存し、再度「はい」にして保存
メールテンプレート
themes/classic/mailsにメールテンプレートが残っている場合、ここが優先されて使用されますが、これらテンプレートは変換コマンドでは上書きされないようです。このため、このフォルダは無効にします。
# mv themes/classic/mails themes/classic/mails_backup
下記変換コマンド(または管理画面のEmail Themeから)で作成されるメールテンプレートhtml.txtファイルは、mails/en, mails/ja ディレクトリに保存されます。
# bin/console prestashop:mail:generate -o true classic en-US
# bin/console prestashop:mail:generate -o true classic ja-JP
メールテンプレートについては以下も参照。
E-Mailテンプレートの編集
ModernよりもClassicテーマの方がレイアウトが整然としていて見やすいです。
メールで使用される各テンプレートは、テーマ毎 (Modern, Classic) に mails/themes に纏められています。
mails/themes フォルダ内の各テーマの twig ファイルから、html または txt 形式のファイルが作成されます(この作成…
リダイレクトループ(無限ネスト)+クローラ攻撃系アクセス対策
Nginxの設定変更 —> 設定内容は未公開
対策ファイル追加
override/controllers/front/AuthController.php
<?php
class AuthController extends AuthControllerCore
{
public function init()
{
parent::init();
// backパラメータ取得
$back = Tools::getValue('back');
if ($back) {
// ① 長さ制限(重要)
if (strlen($back) > 1000) {
$back = '';
}
// ② back多重ネスト検出
if (substr_count($back, 'back=') > 1) {
$back = '';
}
// ③ authenticationループ防止
if (stripos($back, 'controller=authentication') !== false) {
$back = '';
}
// ④ URLとして不正なら破棄
if (!filter_var($back, FILTER_VALIDATE_URL)) {
$back = '';
}
// 上書き
if (empty($back)) {
$_GET['back'] = null;
}
}
}
}
9.1.3 —> 9.2
PrestaShop 9.2 is here, and it is a big one! 🎉 This release brings some of the most requested features of recent years straight into the platform: a native One Page Checkout module to make buying faster and smoother, an AI assistant right inside the...
7.6.x ← Jeremie-Kiwik:pr-extra-field-registry
オープン 07:44AM - 19 Jun 26 UTC
| Questions | Answers
| ------------------| ---------------------------… ----------------------------
| Description? | Adds the `extra_property_definition` registry table to the PrestaShop 9.2.0 SQL upgrade script. This ensures shops upgraded to PrestaShop 9.2.0 get the table required by the native Extra Properties feature introduced in PrestaShop/PrestaShop#41092.<br/>Adds the Back Office tab registration for the Extra Properties registry page introduced in PrestaShop/PrestaShop#41775. The 9.2.0 upgrade script creates the `AdminExtraPropertyDefinitions` tab under Advanced Parameters and relies on the existing tab helper to create the related authorization roles and copy access rights from the parent tab.
| Type? | improvement
| BC breaks? | no
| Deprecations? | no
| Fixed ticket? | Related to https://github.com/PrestaShop/PrestaShop/pull/41092 and https://github.com/PrestaShop/PrestaShop/pull/41775 and https://github.com/PrestaShop/PrestaShop/pull/41749 and https://github.com/PrestaShop/PrestaShop/pull/41806
| Sponsor company | Kiwik
| How to test? | Run an upgrade to PrestaShop 9.2.0 using this autoupgrade branch, (from PrestaShop 9.0.0 or above **ONLY**), then verify that the `ps_extra_property_definition` table is created with the expected columns, primary key, unique key, and indexes.
Update Assistantの更新がされないため、下記最新版をダウンロードし
Module manager ---> Upload a module
で手動アップロード・更新。
Update Assistant
v7.6.6 - by PrestaShop
更新後、Update Assistantの手順に従い更新(不必要なモジュールのアンインストールなど)。