-
AuthorPosts
-
July 26, 2018 at 12:27 pm #990215
Hello,
while inserting a few amazon product codes via iframe I noticed that the iframes did not work after the page has been saved a second time. The original amazon code looks like this:iframe style="width: 120px; height: 240px;" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=bzhealthymama-20&marketplace=amazon®ion=US&placement=B00AQFGL3O&asins=B00AQFGL3O&linkId=445f99cfce63a9b5644914b45cd44be8&show_border=false&link_opens_in_new_window=false&price_color=333333&title_color=0066c0&bg_color=ffffff" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"> </iframe>
When the page is saved a second time the code gets broken and loos like this:
<iframe style="width: 120px; height: 240px;" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=bzhealthymama-20&marketplace=amazon®ion=US&placement=B00AQFGL3O&asins=B00AQFGL3O&linkId=445f99cfce63a9b5644914b45cd44be8&show_border=false&link_opens_in_new_window=false&price_color=333333&title_color=0066c0&bg_color=ffffff" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"> </iframe>
The part of the iframe that says
amazon®ion=US
gets chnaged after the second saving of the page to:
amazon®ion=US
and that does of course not work.
This happens only with the Enfold Page Builder not if I use the standard WordPress builder.
What can I do to avoid that automatic code change?
- This topic was modified 6 years, 4 months ago by denisesl23.
July 26, 2018 at 2:33 pm #990267Hi denisesl23!
Did you try to use the code block element to embed the iframe ( screenshot: http://www.clipular.com/c/5571279189704704.png?k=mCWLt2MmgiyEVvFqRDnMQjju3hk )?
Best regards,
PeterJuly 26, 2018 at 3:02 pm #990275Yes, I tried both the code block element and the text block – both give the same result and change the code.
July 26, 2018 at 3:13 pm #990281Hi,
Ok in this case we need a workaround – please try to move the ®ion=US parameter to the very beginning of the query string like:
<iframe style="width: 120px; height: 240px;" src="//ws-na.amazon-adsystem.com/widgets/q?region=US&ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=bzhealthymama-20&marketplace=amazon®ion=US&placement=B00AQFGL3O&asins=B00AQFGL3O&linkId=445f99cfce63a9b5644914b45cd44be8&show_border=false&link_opens_in_new_window=false&price_color=333333&title_color=0066c0&bg_color=ffffff" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"> </iframe>
So basically you need to move ®ion=US to the ? sign, then place the & after US. It seems like javascript converts the ® to the registered sign character. I’ll look into it but this should temporarily solve the issue.
Best regards,
DudeJuly 26, 2018 at 4:04 pm #990302Hi Dude, thank you very much, that works as a workaround. Will there be a theme update that covers this?
July 26, 2018 at 4:51 pm #990313Hi,
Yes, Günter (our dev) or I will look into it. I’m pretty sure the javascript function which creates the modal popup (window where you can insert the code/text) breaks the iframe code and converts ® to ® but we need to investigate it a bit more. It should be fixed with the next update.
Best regards,
DudeNovember 21, 2020 at 7:12 pm #1261984Hello, I am still having the same problem. My Enfold version is 4.7.6.4 and the child theme is 4.6.1.
Can you please help me? Thank youNovember 26, 2020 at 2:51 pm #1263271Hi @Jescraw,
Sorry for the late reply!
I believe this issue was not looked into. I just reported the issue to our devs on our GitHub.
We will keep you updated here. In the meantime, please consider using the workaround Dude suggested here – https://kriesi.at/support/topic/enfold-pagebuilder-changes-amazon-iframe-code/#post-990281 :)Best regards,
YigitJanuary 27, 2021 at 1:21 pm #1275782This reply has been marked as private.February 2, 2021 at 1:28 pm #1277142Hi,
Thank you for the info.
You could create a custom shortcode for it instead of directly embedding the iframe code in the builder. Please try this code in the functions.php file to create the custom shortcode.
// amazon widget function avs_amazon_widgets_cb( $atts ) { $params = shortcode_atts( array( 'tracking_id' => 'alevivaamazon-21', 'language' => 'de_DE', 'region' => 'DE', 'placement' => '', 'asins' => '', 'linkId' => '' ), $atts ); return "<iframe style='width:120px;height:240px;' marginwidth='0' marginheight='0' scrolling='no' frameborder='0' src='//ws-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=DE&source=ss&ref=as_ss_li_til&ad_type=product_link&tracking_id={$params['tracking_id']}&language={$params['language']}&marketplace=amazon®ion={$params['region']}&placement={$params['placement']}&asins={$params['asins']}&linkId={$params['linkId']}&show_border=true&link_opens_in_new_window=true'></iframe>"; } add_shortcode( 'avs_amazon_widget', 'avs_amazon_widgets_cb' );
And in a code or text block, use this shortcode.
[avs_amazon_widget tracking_id="alevivaamazon-21" language="de_DE" region="DE" placement="B0049U0DMC" asins="B0049U0DMC" linkId="b4e61f81e27ae4ef8bb010781a7069f0"]
Result: https://imgur.com/2eBXflX
You may notice that there are certain parameters in the shortcode such as the tracking_id, placement, linkId etc, which should be adjusted based on the actual value of the parameters from the amazon iframe or embed code.
Best regards,
IsmaelFebruary 4, 2021 at 7:58 pm #1277775Whatever you sent me is must have a major mistake because I had no more access to my site!
February 4, 2021 at 7:58 pm #1277776February 4, 2021 at 7:59 pm #1277777February 5, 2021 at 2:22 pm #1278009Hi,
Thank you for the screenshot.
Looks like you have copied the code from your email. Please make sure to copy the code directly from this forum to avoid conversion or encoding of symbols as shown in the screenshot that you have provided above. Let us know if that helps.
Best regards,
IsmaelFebruary 11, 2021 at 12:18 pm #1279720Sorry, but still: NOTHING
I copied your code from the forum, I’ve inserted it into the functions.php of the Enfold child theme (I also tried Enfold main but still no success).
Then I changed the parameter and added the code into my page using text element (since it didn’t work, also code element). In the preview you can see the item but as soon as I upload it there is nothing but a blank area with a border.
What do I do now? Why is this so difficult?
Thanks in advance!February 12, 2021 at 2:42 pm #1280047Hi,
@jescraw: The same code works fine on our end. Please open a new ticket and post the WP and FTP details in the private field so that we could implement the code above.
Best regards,
IsmaelDecember 16, 2021 at 2:43 pm #1333135Almost one year later and still not working! I am really fed up with this!
December 20, 2021 at 6:44 am #1333487 -
AuthorPosts
- The topic ‘Enfold Pagebuilder changes amazon iframe code’ is closed to new replies.