From a25c1c7e5d20d808a46bc4c6060bba5baeeb92dc Mon Sep 17 00:00:00 2001 From: prateek srivastava Date: Thu, 14 Oct 2021 13:03:08 +0530 Subject: [PATCH 1/5] issue #1243 fixed --- packages/Webkul/Admin/src/Config/system.php | 40 ++++++++++ .../account/wishlist/wishlist.blade.php | 3 +- .../views/shop/products/list/card.blade.php | 76 +++++++++++++++++++ 3 files changed, 118 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Admin/src/Config/system.php b/packages/Webkul/Admin/src/Config/system.php index 7984f2394..056aaa3e6 100644 --- a/packages/Webkul/Admin/src/Config/system.php +++ b/packages/Webkul/Admin/src/Config/system.php @@ -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', diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/wishlist/wishlist.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/wishlist/wishlist.blade.php index 5c00a8e2f..7f6cc4b36 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/wishlist/wishlist.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/customers/account/wishlist/wishlist.blade.php @@ -53,6 +53,7 @@ 'additionalAttributes' => true, 'btnText' => $moveToCartText, 'addToCartBtnClass' => 'small-padding', + 'wishlistShare' => core()->getConfigData('catalog.products.wishlist_social_share.enabled') ]) @endforeach @@ -67,4 +68,4 @@ {!! view_render_event('bagisto.shop.customers.account.wishlist.list.after', ['wishlist' => $items]) !!} -@endsection +@endsection \ No newline at end of file diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php index a210624b2..eea84c87b 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php @@ -11,10 +11,68 @@ 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; + } @endpush @php + $links = []; + + if (core()->getConfigData('catalog.products.wishlist_social_share.facebook')) { + array_push($links, 'facebook'); + } + if (core()->getConfigData('catalog.products.wishlist_social_share.instagram')) { + array_push($links, 'instagram'); + } + if (core()->getConfigData('catalog.products.wishlist_social_share.twitter')) { + array_push($links, 'twitter'); + } + if (core()->getConfigData('catalog.products.wishlist_social_share.pinterest')) { + array_push($links, 'pinterest'); + } + if (core()->getConfigData('catalog.products.wishlist_social_share.linkedin')) { + array_push($links, 'linkedin'); + } + if (core()->getConfigData('catalog.products.wishlist_social_share.whatsapp')) { + array_push($links, 'whatsapp'); + } + if (core()->getConfigData('catalog.products.wishlist_social_share.email')) { + array_push($links, 'email'); + } + $message = core()->getConfigData('catalog.products.wishlist_social_share.share_message'); + if (isset($checkmode) && $checkmode && $toolbarHelper->getCurrentMode() == "list") { $list = true; } @@ -111,6 +169,24 @@ ? true : false, ]) + + @if ($wishlistShare) +
+ +
+ @endif From 61e7f1caed1a455df22db02ab32b28b840577130 Mon Sep 17 00:00:00 2001 From: prateek srivastava Date: Thu, 14 Oct 2021 13:24:47 +0530 Subject: [PATCH 2/5] changes resolved --- .../views/shop/products/list/card.blade.php | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php index eea84c87b..859d0522b 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php @@ -51,26 +51,33 @@ $links = []; if (core()->getConfigData('catalog.products.wishlist_social_share.facebook')) { - array_push($links, 'facebook'); + $links[] = 'facebook'; } + if (core()->getConfigData('catalog.products.wishlist_social_share.instagram')) { - array_push($links, 'instagram'); + $links[] = 'instagram'; } + if (core()->getConfigData('catalog.products.wishlist_social_share.twitter')) { - array_push($links, 'twitter'); + $links[] = 'twitter'; } + if (core()->getConfigData('catalog.products.wishlist_social_share.pinterest')) { - array_push($links, 'pinterest'); + $links[] = 'pinterest'; } + if (core()->getConfigData('catalog.products.wishlist_social_share.linkedin')) { - array_push($links, 'linkedin'); + $links[] = 'linkedin'; } + if (core()->getConfigData('catalog.products.wishlist_social_share.whatsapp')) { - array_push($links, 'whatsapp'); + $links[] = 'whatsapp'; } + if (core()->getConfigData('catalog.products.wishlist_social_share.email')) { - array_push($links, 'email'); + $links[] = 'email'; } + $message = core()->getConfigData('catalog.products.wishlist_social_share.share_message'); if (isset($checkmode) && $checkmode && $toolbarHelper->getCurrentMode() == "list") { From 2ac46334df0fd444fcad38c0a16cdbb84f9a5cdb Mon Sep 17 00:00:00 2001 From: prateek srivastava Date: Thu, 14 Oct 2021 13:41:49 +0530 Subject: [PATCH 3/5] fixed changes --- .../views/shop/products/list/card.blade.php | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php index 859d0522b..0528eda73 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php @@ -50,32 +50,35 @@ @php $links = []; - if (core()->getConfigData('catalog.products.wishlist_social_share.facebook')) { - $links[] = 'facebook'; - } + $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", + ] + ]; - if (core()->getConfigData('catalog.products.wishlist_social_share.instagram')) { - $links[] = 'instagram'; - } - - if (core()->getConfigData('catalog.products.wishlist_social_share.twitter')) { - $links[] = 'twitter'; - } - - if (core()->getConfigData('catalog.products.wishlist_social_share.pinterest')) { - $links[] = 'pinterest'; - } - - if (core()->getConfigData('catalog.products.wishlist_social_share.linkedin')) { - $links[] = 'linkedin'; - } - - if (core()->getConfigData('catalog.products.wishlist_social_share.whatsapp')) { - $links[] = 'whatsapp'; - } - - if (core()->getConfigData('catalog.products.wishlist_social_share.email')) { - $links[] = 'email'; + foreach($keysCollection as $key) { + if (core()->getConfigData($key['config_key'])) { + array_push($links, $key['link']); + } } $message = core()->getConfigData('catalog.products.wishlist_social_share.share_message'); From be4fbb940c3205843de481f52865bdb8af32f9b3 Mon Sep 17 00:00:00 2001 From: prateek srivastava Date: Thu, 14 Oct 2021 13:48:20 +0530 Subject: [PATCH 4/5] fixed changes --- .../src/Resources/views/shop/products/list/card.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php index 0528eda73..90ca26d85 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php @@ -77,7 +77,7 @@ foreach($keysCollection as $key) { if (core()->getConfigData($key['config_key'])) { - array_push($links, $key['link']); + $links[] = $key['link']; } } From ff976f5dcf24d4047aefae5198968ba7cd828ab3 Mon Sep 17 00:00:00 2001 From: prateek srivastava Date: Thu, 14 Oct 2021 13:55:58 +0530 Subject: [PATCH 5/5] fixed changes --- .../views/shop/products/list/card.blade.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php index 90ca26d85..788c19e91 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/card.blade.php @@ -53,25 +53,25 @@ $keysCollection = [ [ "config_key" => "catalog.products.wishlist_social_share.facebook", - "link" => "facebook", + "link" => "facebook", ], [ "config_key" => "catalog.products.wishlist_social_share.instagram", - "link" => "instagram", + "link" => "instagram", ], [ "config_key" => "catalog.products.wishlist_social_share.pinterest", - "link" => "pinterest", + "link" => "pinterest", ], [ "config_key" => "catalog.products.wishlist_social_share.twitter", - "link" => "twitter", + "link" => "twitter", ], [ "config_key" => "catalog.products.wishlist_social_share.linkedin", - "link" => "linkedin", + "link" => "linkedin", ], [ "config_key" => "catalog.products.wishlist_social_share.whatsapp", - "link" => "whatsapp", + "link" => "whatsapp", ], [ "config_key" => "catalog.products.wishlist_social_share.email", - "link" => "email", + "link" => "email", ] ];