*

Brandso

  • ****
  • 108 posts
No option to share business profile
« on: August 11, 2022, 07:47:44 PM »
Hi,

I was trying to integrate social share plugin on business profile page using the code mentioned in social share plugin settings.

It shows the share button and also shares the link on WhatsApp but the problem is that it doesn't picks the correct URL of the users business profile.

It shares an invalid URL which ends with 0 and when we click on the URL and goto the link it says invalid page.

So, how can I use social share plugin on business profile page.

If social share plugin doesn't work then is there any way to add built in share button on business profile page because from website users can share there business profile by copying URL but from pwa it's not possible to copy page URL and there is no point of a business profile if users can't share it.

Please help.

Thanks

*

Brandso

  • ****
  • 108 posts
Re: No option to share business profile
« Reply #1 on: August 14, 2022, 05:28:17 PM »
Okay, so finally managed to get a working code to share business profile by copying different codes from different websites and some from Osclass existing plugin. If anyone want to add a share button in Business Profile page and who have zero coding experience like me can use this code as it works fine for me on mobile. Its made only for mobile because on desktop anyways users can copy url but if anyone is using PWA then there is no option to copy url.

WhatsApp Share button on Business Profile

CSS code in Theme Customisation

.fa-whatsapp  {
  color:#fff;
  background:
   linear-gradient(#25d366,#25d366) 14% 84%/16% 16% no-repeat,
   radial-gradient(#25d366 60%,transparent 0);
}

.button123 {
  background-color: #25d366;
  border: white;
  padding: 4px 8px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
  margin: 4px 2px;
  border-radius: 12px;
}

Code to enter in Business Profile > form > seller.php ( I used it under <div class="bpr-right”>)

<?php
$Url = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
$Url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
?>
<div id="share" class="isMobile">
    <a href="whatsapp://send?text=<?php echo $Url; ?>" target="_blank" class="button123" style="color:white"><i class="fab fa-whatsapp fa-2x"></i>&nbsp; Share on WhatsApp</a>
        </div>

The only problem I see in this code is that the text is not properly align to the centre of the Icon how it is in the Social Share plugin. Attaching the screenshot for the result of the above shared code.

*

MB Themes

Re: No option to share business profile
« Reply #2 on: August 15, 2022, 09:04:37 AM »
@Brandso
Looks good, but you can use plugin routes to get profile URL ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Brandso

  • ****
  • 108 posts
Re: No option to share business profile
« Reply #3 on: August 15, 2022, 01:16:27 PM »
Sorry I didn't get what you mean by plugin route. I actually tried to use the code which was mentioned in the social share plugin and it shows the buttons on business profile page. But when we click on button to share user profile from mobile or computer it picks the incorrect user code that does not exist, like at the end of the URL it shows 0 instead of the current business profile id and when we click on that URL it redirects to an error page. Anyways this code which I am using right now doesn't give very good on front end but atleast does the job. So, thanks for your time and support.

*

MB Themes

Re: No option to share business profile
« Reply #4 on: August 16, 2022, 11:07:14 AM »
@Brandso
In order to get profile URL, you can use:
Code: [Select]
<?php echo osc_route_url('bpr-seller', array('identifier' => '')); ?>
where you define identifier of profile
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots