Merge pull request #5234 from prateek-webkul/wishlist-share

issue #1243 fixed
This commit is contained in:
Devansh 2021-10-14 14:33:54 +05:30 committed by GitHub
commit 9dc002c1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 128 additions and 1 deletions

View File

@ -268,6 +268,46 @@ return [
'type' => 'text',
]
],
], [
'key' => 'catalog.products.wishlist_social_share',
'name' => 'Wishlist Social Share',
'sort' => 9,
'fields' => [
[
'name' => 'enabled',
'title' => 'Enable Social Share?',
'type' => 'boolean',
], [
'name' => 'facebook',
'title' => 'Enable Share in Facebook?',
'type' => 'boolean',
], [
'name' => 'twitter',
'title' => 'Enable Share in Twitter?',
'type' => 'boolean',
], [
'name' => 'pinterest',
'title' => 'Enable Share in Pinterest?',
'type' => 'boolean',
], [
'name' => 'whatsapp',
'title' => 'Enable Share in What\'s App?',
'type' => 'boolean',
'info' => 'What\'s App share link just will appear to mobile devices.'
], [
'name' => 'linkedin',
'title' => 'Enable Share in Linkedin?',
'type' => 'boolean',
], [
'name' => 'email',
'title' => 'Enable Share in Email?',
'type' => 'boolean',
], [
'name' => 'share_message',
'title' => 'Share Message',
'type' => 'text',
]
],
], [
'key' => 'catalog.inventory',
'name' => 'admin::app.admin.system.inventory',

View File

@ -53,6 +53,7 @@
'additionalAttributes' => true,
'btnText' => $moveToCartText,
'addToCartBtnClass' => 'small-padding',
'wishlistShare' => core()->getConfigData('catalog.products.wishlist_social_share.enabled')
])
@endforeach

View File

@ -11,10 +11,78 @@
font-size: 18px;
font-weight: 600;
}
.bb-social-share {
padding: 1rem 0;
}
.bb-social-share__title {
margin-bottom: 1rem;
font-weight: bold;
}
.bb-social-share__items {
list-style: none;
display: flex;
align-items: center;
}
.bb-social-share__item {
margin-right: 1rem;
}
.bb-social-share__item a {
text-decoration: none;
}
.bb-social-share__item a:hover {
text-decoration: none;
}
.bb-social-share__item a svg {
display: inline-block;
width: 2rem;
height: 2rem;
}
</style>
@endpush
@php
$links = [];
$keysCollection = [
[
"config_key" => "catalog.products.wishlist_social_share.facebook",
"link" => "facebook",
], [
"config_key" => "catalog.products.wishlist_social_share.instagram",
"link" => "instagram",
], [
"config_key" => "catalog.products.wishlist_social_share.pinterest",
"link" => "pinterest",
], [
"config_key" => "catalog.products.wishlist_social_share.twitter",
"link" => "twitter",
], [
"config_key" => "catalog.products.wishlist_social_share.linkedin",
"link" => "linkedin",
], [
"config_key" => "catalog.products.wishlist_social_share.whatsapp",
"link" => "whatsapp",
], [
"config_key" => "catalog.products.wishlist_social_share.email",
"link" => "email",
]
];
foreach($keysCollection as $key) {
if (core()->getConfigData($key['config_key'])) {
$links[] = $key['link'];
}
}
$message = core()->getConfigData('catalog.products.wishlist_social_share.share_message');
if (isset($checkmode) && $checkmode && $toolbarHelper->getCurrentMode() == "list") {
$list = true;
}
@ -111,6 +179,24 @@
? true : false,
])
</div>
@if ($wishlistShare)
<div class="share-wishlist">
<aside class="bb-social-share">
<div class="bb-social-share__title">
{{ __('Share Now') }}
</div>
<ul class="bb-social-share__items">
@foreach($links as $link)
@include(
'social_share::links.' . $link,
compact('product', 'message')
)
@endforeach
</ul>
</aside>
</div>
@endif
</div>
</div>
</div>