Skip Navigation

[Resolved] sku in url parameter adds %5B%5D which ruins whatsapp link

This support ticket is created 3 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by Ido Angel 3 years, 8 months ago.

Assisted by: Jamal.

Author
Posts
#1717175

hey
I have a button which sends a link with generated url parameters from a certain view, filtered by products sku:

the link is:

hidden link

if I paste this link in the web browser, it works fine, but when I try to share it in whatsapp, which is its only purpose actually, whatsapp takes the "%5B%5D" and transfroms then to "[]", which then results in toolset not recongnizing the parameters and not filtering properly.
If I try to send the url without "%5B%5D" (e.g hidden link), then toolset ignores the filtering too.

my code to produce this link is by identifying all existing sku's which are currently shown:

var skulinks = "";
jQuery('.compare-sku').each(function(){
  skulinks += "sku%5B%5D=" + jQuery(this).text() + "%26";
});
 jQuery(".share-compare").on("click", function() {
  jQuery(this).attr("href", "<em><u>hidden link</u></em>?"+skulinks);
});

anyway I can force whatsapp to accept the brackets so that the link can be shared properly?

thanks!

#1717975

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

I am not really sure to understand the issue, below what I tested:
- Visit hidden link
- Click on the "Whatsapp" button. Check this screenshot hidden link
- It took me to the Whatapp web, and I selected one contact and clicked on send.
- Open the WhatsApp discussion and click on the link there hidden link

And I can't see any difference with the first page. There is a slight difference in the URL because one is encoded and the other is not. But the results of the page are identical.

Maybe I missed something. Can you give more details or record a short video to demonstrate the issue.

#1717987

Hey Jamal, Thanks.
You see it the same because you didn't change anything in the initial display. Try pressing the X above some columns, it will remove them, and when you will be left with, say, 3 columns, press the send on whatsapp button. You will get the URL but whatsapp will convert %5B%5D into [] and then toolset will ignore this filtering and just take you to the initial stage where all products are there, no filtering.

#1717991

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

I am very sorry, but I still don't understand the real issue.
Check this screenshot hidden link

I removed one column(the middle one), shared the URL via WhatsApp and open it again, I do not see any issues on the page, except that it still kept the 3 columns.

Can you, please, record a short video, using Loom or Screencastify that demonstrates the issue?

#1717993

Jamal, in your screenshot you see that you removed some columns and left with only 2, but when shared, the link send you back to the page with ALL products in it, unfiltered - because toolset IGNORES the url parameters because toolset doesnt count the [] properly... it's in your screenshot.

#1717995

let's try explaining this again like this:

the difference between this URL:

hidden link (what is sent to whatsapp)

and this URL (what whatsapp turns the url into):

hidden link

is that in the first, the products showing are only the three products which sku is in the url parameter. But in the second - ALL products are showing, it's the same as hidden link without filtering at all... or am i wrong?

#1718009

Ok - there was an issue in the jquery code.... thanks and sorry for the trouble!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.