[Closed] Types shortcode inside third party shortcode inside view
This support ticket is created 7 years, 5 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Hello,
I am trying to display this shortcode in a view loop but it does not work
[asa2 value="OffersMainPriceAmount"][types field="asin-amazon"][/types][/asa2]
As you can see, that is a custom field created with types inside a third party shortcode.
Both plugins work perfectly separately but not together, thats what the shortcodes returns separately:
[types field="asin-amazon"][/types] = B01LWX98Q8
[asa2 value="OffersMainPriceAmount"]B01LWX98Q8[/asa2] = 429,00
What I whould like to get is this:
[asa2 value="OffersMainPriceAmount"][types field="asin-amazon"][/types][/asa2] = 429,00
But when I load the page where the view should be display I get an error. The only content of that page that appears is the tittle.
I get the same result if I write the same external shortcode with and empty internal shorcode (only brackets):
[asa2 value="OffersMainPriceAmount"][][/asa2]
So I guess the problem is related with the views module...
I tried to register the third party shortcode with the name (asa2) but it does not work.
Asa2 is a shortcode from a third party plugin (hidden link)
The shortcode is created by a plugin called Amazon Simple Affiliate. This plugin connects with Amazon via API
There is a free version of that plugin (hidden link) but I am usin the pro version.
If you want I can send you privately a copy of that pro version for testing purposes and also an Amazon "Access Key Id" and "AWSSecretKey" for Amazon Api connection
Let me know a private email please and I will send you everything
I see so, I thought it was a plugin that you had developed.
In this case I would recommend getting the support team for the plugin involved as well. The reason is because they could be doing something that is stripping out or not parsing the shortcodes.
It would be a best practice to contact them because any work that would be done would be on their plugin side and this goes against our support policy 🙁
Would you mind contacting them and let me know the results and how best I can help 🙂
Ok Shane I have been talking with "Amazon Simple Affilate" plugin developer and they have resolved the incompatibility problem between the shortcodes ([asa2 value="OffersMainPriceAmount"][types field="asin-amazon"][/types][/asa2]) , so that is the new situation:
-It works perfectly if I introduce the shorcodes in the post content template
-It does not work if I introduce the shorcodes in a view.
This is the plugin developer replay:
Now the loop walks till the end. BUT: It does not load the product boxes because the ASINs inside the loop get prepended with the string "###SPACE###". You can see the ASA 2 error messages in the Log section: hidden link
This is why the products in the loop do not get displayed, because the ASIN "###SPACE###B01LWX98Q8" is obviously not a valid ASIN. I do not know where the "###SPACE###" is coming from. Definitely not out of ASA 2. I guess it has something to do with the Types template rendering. Please ask the Types devs if they know where it comes from.
I hope I was able to help you. If you still have questions, please let me know.
Kind regards
Timo
I do not know if you understand what he say, maybe it is not clear because you don't know how ASA plugin works, I am going to try to clarify that:
"ASIN" is an Amazon code like this: B01LWX98Q8. This code indentfy a unique product.
I created a Post Field called "asin-amazon" for that number, so:
The shortcode [types field="asin-amazon"][/types] displays B01LWX98Q8.
This shortcode [asa2 value="OffersMainPriceAmount"]B01LWX98Q8[/asa2] displays the price of that product, for example 251,58
If I combine both shortcodes [asa2 value="OffersMainPriceAmount"][types field="asin-amazon"][/types][/asa2] in a post content template it works perfectly, that shortcode displays de price, but if I combine them in a view there is an error
That error is because the ASIN that should be "B01LWX98Q8" becomes in this "###SPACE###B01LWX98Q8" but only in views. It is like if Types added a string "###SPACE###" before B01LWX98Q8. So obiously Amazon cannot identify that string as an ASIN