Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]支払い方法を変更した時に支払い方法のアンカーへ移動 #5187

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Eccube/Controller/ShoppingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,17 @@ public function redirectTo(Request $request, RouterInterface $router)
// リダイレクト先のチェック.
$pattern = '/^'.preg_quote($request->getBasePath(), '/').'/';
$redirectTo = preg_replace($pattern, '', $redirectTo);
//リダイレクト先にアンカーが設定されてたらflagmentに設定
$redirectTo = explode("#",$redirectTo);
$fragment = $redirectTo[1];
$redirectTo = $redirectTo[0];

$result = $router->match($redirectTo);
// パラメータのみ抽出
$params = array_filter($result, function ($key) {
return 0 !== \strpos($key, '_');
}, ARRAY_FILTER_USE_KEY);
$params['_fragment'] = $fragment;

log_info('[リダイレクト] リダイレクトを実行します.', [$result['_route'], $params]);

Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Resource/template/default/Shopping/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,15 @@ file that was distributed with this source code.
<button type="button" class="ec-inlineBtn" data-trigger="click" data-path="{{ path('shopping_shipping_multiple') }}">{{ 'front.shopping.to_multiple'|trans }}</button>
</div>
</div>
<div class="ec-orderPayment">
<div class="ec-orderPayment" id="payment-method">
<div class="ec-rectHeading">
<h2>{{ 'front.shopping.payment_info'|trans }}</h2>
</div>
<div class="ec-radio">
{% for key, child in form.Payment %}
<div style="display: block;">
{% set Payment = form.Payment.vars.choices[key].data %}
{{ form_widget(child, { 'attr': { 'data-trigger': 'change' }}) }}
{{ form_widget(child, { 'attr': { 'data-trigger': 'change', 'data-path': '/shopping#payment-method' }}) }}
{% if Payment.payment_image is not null %}
<p><img src="{{ asset(Payment.payment_image, 'save_image') }}"></p>
{% endif %}
Expand Down