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

商品詳細ページにSNS共有ボタンを表示する #4916

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ボタンをブロック管理に移動
  • Loading branch information
matsuoshi committed Feb 12, 2021
commit 279930c5b4e250553231e6c4757e8746ec378ab9
1 change: 1 addition & 0 deletions src/Eccube/Resource/doctrine/import_csv/en/dtb_block.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ id,device_type_id,block_name,file_name,create_date,update_date,use_controller,de
12,10,News,news,2017-03-07 10:14:52,2017-03-07 10:14:52,0,0,block
13,10,Product Search,search_product,2017-03-07 10:14:52,2017-03-07 10:14:52,1,0,block
14,10,Featured,topic,2017-03-07 10:14:52,2017-03-07 10:14:52,0,0,block
15,10,Social Buttons,social_buttons,2021-02-12 14:00:00,2021-02-12 14:00:00,0,0,block
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matsuoshi
このあたりを参考に、マイグレーションの作成もお願いできますか?
https://github.com/EC-CUBE/ec-cube/blob/4.0/app/DoctrineMigrations/Version20201218044542.php

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chihiro-adachi 確認ありがとうございます、マイグレーションファイルを追加しました

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

マイグレーションでエラーになりました。

An exception occurred while executing 'INSERT INTO dtb_block (
            id, device_type_id, block_name, file_name, create_date, update_date, use_controller, deletable, discriminator_type
        ) VALUES(
            ?, 10, "ソーシャルボタン", "social_buttons", "2021-02-12 14:00:00", "2021-02-12 14:00:00", 0, 0, "block"
        )' with params [15]:
SQLSTATE[42703]: Undefined column: 7 ERROR:  column "ソーシャルボタン" does not exist
LINE 4:             $1, 10, "ソーシャルボタン", "social_buttons", "2...
                            ^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kiy0taka すいません、マイグレーションのエラーを修正しました

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
"7","11","1","3","blockposition"
"7","2","1","4","blockposition"
"7","12","1","5","blockposition"
"10","6","1","1","blockposition"
"10","15","1","1","blockposition"
"10","6","1","2","blockposition"
"11","13","1","1","blockposition"
"11","4","1","2","blockposition"
"11","9","1","3","blockposition"
"3","7","2","1","blockposition"
"3","10","2","2","blockposition"
"3","3","2","3","blockposition"
"10","6","2","1","blockposition"
"10","15","2","1","blockposition"
"10","6","2","2","blockposition"
"11","13","2","1","blockposition"
"11","4","2","2","blockposition"
"11","9","2","3","blockposition"
1 change: 1 addition & 0 deletions src/Eccube/Resource/doctrine/import_csv/ja/dtb_block.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
"12","10","新着情報","news","2017-03-07 10:14:52","2017-03-07 10:14:52","0","0","block"
"13","10","商品検索","search_product","2017-03-07 10:14:52","2017-03-07 10:14:52","1","0","block"
"14","10","トピック","topic","2017-03-07 10:14:52","2017-03-07 10:14:52","0","0","block"
"15","10","ソーシャルボタン","social_buttons","2021-02-12 14:00:00","2021-02-12 14:00:00","0","0","block"
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
"7","11","1","3","blockposition"
"7","2","1","4","blockposition"
"7","12","1","5","blockposition"
"10","6","1","1","blockposition"
"10","15","1","1","blockposition"
"10","6","1","2","blockposition"
"11","13","1","1","blockposition"
"11","4","1","2","blockposition"
"11","9","1","3","blockposition"
"3","7","2","1","blockposition"
"3","10","2","2","blockposition"
"3","3","2","3","blockposition"
"10","6","2","1","blockposition"
"10","15","2","1","blockposition"
"10","6","2","2","blockposition"
"11","13","2","1","blockposition"
"11","4","2","2","blockposition"
"11","9","2","3","blockposition"
23 changes: 23 additions & 0 deletions src/Eccube/Resource/template/default/Block/social_buttons.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="ec-socialButtons">
<div class="ec-socialButtons__btn ec-socialButtons--twitter">
<a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-show-count="false">Tweet</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
<div class="ec-socialButtons__btn ec-socialButtons--facebook">
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v9.0" nonce="akhQXdmn"></script>
<div class="fb-share-button" data-href="{{ app.request.uri }}" data-layout="button" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?src=sdkpreparse" class="fb-xfbml-parse-ignore">シェア</a></div>
</div>
<style>
.ec-socialButtons {
display: flex;
justify-content: flex-end;
line-height: 1;
margin-top: 16px;
margin-bottom: 16px;
}
.ec-socialButtons__btn:not(:last-of-type) {
margin-right: 16px;
}
</style>
</div>
25 changes: 0 additions & 25 deletions src/Eccube/Resource/template/default/Product/detail.twig
Original file line number Diff line number Diff line change
Expand Up @@ -378,30 +378,5 @@ file that was distributed with this source code.
{{ include(template_from_string(Product.freearea)) }}
</div>
{% endif %}


<div class="ec-socialButtons">
<div class="ec-socialButtons__btn ec-socialButtons--twitter">
<a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-show-count="false">Tweet</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
<div class="ec-socialButtons__btn ec-socialButtons--facebook">
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v9.0" nonce="akhQXdmn"></script>
<div class="fb-share-button" data-href="{{ app.request.uri }}" data-layout="button" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?src=sdkpreparse" class="fb-xfbml-parse-ignore">シェア</a></div>
</div>
<style>
.ec-socialButtons {
display: flex;
justify-content: flex-end;
line-height: 1;
margin-top: 16px;
margin-bottom: 16px;
}
.ec-socialButtons__btn:not(:last-of-type) {
margin-right: 16px;
}
</style>
</div>
</div>
{% endblock %}