Issue with iframe? Page doesn't direct to correct webpage
-
Hello all!
I’m attempting to use iframe to direct my customers to my checkout page for my services. Since I have two different webpages, I wanted to make it a smooth transition and just have it all on one website. When I test it out and click on a membership service( at the bottom of the webpage), its directed to the homepage of my other website instead of the checkout page which is included in the iframe. I confirmed that it works correctly using a proxy website like kproxy.com but it doesn’t work without it.
Any suggestions? I’m not exactly sure if this is a wordpress issue or not.
website: http://www.mcaproservice.com/memberships
Membership links are at the bottom of the page. Thanks in advance!
-
Are you using the iFrame plugin? I cannot see that plugin active on your website.
Yes I’m using the iFrame plugin and its currently active. I just recently discovered that the webpage works perfectly fine using firefox but theres still trouble when attempting to use Internet Explorer and Safari.
Hi Andrew,
Any suggestions that I should try to resolve this issue since you stated that it was a plugin error?
fwashington
In the iframe URLs that are being passed are something like
https://tvcmatrix.com/secure/cart/addItem.aspx?qty=1&itID=9135&PromoID=83&uid=freddiewashington
while what needs to be in there is something like
https://tvcmatrix.com/secure/cart/addItem.aspx?qty=1&itID=9135&PromoID=83&uid=freddiewashington
Seems the values iframe plugin is getting is after they are replaced.
I was able to get it to work by modifying some code in the plugin(as there were no filters I could use). I changed the code block below:
foreach( $atts as $attr => $value ) { if ( $attr != 'same_height_as' ) { // remove some attributes if ( $value != '' ) { // adding all attributes $html .= ' ' . $attr . '="' . $value . '"'; } else { // adding empty attributes $html .= ' ' . $attr; } } }
To
foreach( $atts as $attr => $value ) { if ( $attr != 'same_height_as' ) { // remove some attributes if($attr="src"){ $value = str_replace(array('&','&'),'&',$value); } if ( $value != '' ) { // adding all attributes $html .= ' ' . $attr . '="' . $value . '"'; } else { // adding empty attributes $html .= ' ' . $attr; } } }
Which replaced the URL components back to what they were before.
You should ask this question in the plugin’s support as well, and can even give this solution to them so that they can fix the issue.
fwashington
Please use this code instead, I was unable to use some special characters in the reply
Hey thank you very much for your help Gagan. I didn’t know where to direct my question. Excuse my ignorance since this is the first website that Ive created so my knowledge is pretty limited but where do I place the code that you provided me?
@ Gagan Deep Singh ( @gagan0123 ) :
Thank you very much for contributing the code.
Can you provide additional details why you added ampersand replacement code?
Because with your code or without it params are added via url successfully.
Your code with underscores added for avoiding the strip:
if ( $attr == 'src' ) { $value = str_replace(array('&_#038;','&_amp;'),'&',$value); }
- The topic ‘Issue with iframe? Page doesn't direct to correct webpage’ is closed to new replies.