Pricing Table Problem

Hello,

I have a problem with the pricing table. If you add a price box with a short code see screenshot: https://www.dropbox.com/s/6bl3ljzbfazjr7j/Screenshot%202015-06-10%2012.02.22.jpg?dl=0 then save you get this message: https://www.dropbox.com/s/a2yawlmm969k6zb/Screenshot%202015-06-10%2012.03.03.jpg?dl=0 I have to refresh the screen and you will see it correctly: https://www.dropbox.com/s/yig3mvdqyqbbjco/Screenshot%202015-06-10%2012.03.38.jpg?dl=0 The problem is Every Time you edit this price box you get this and have to refresh the screen.

This short code pulls my package price from WHMCS & the Title pulls the name from the package.

FEATURE REQUEST: It would be nice to make it easier to add a check, X, or other icons without code. Also a table like this would be REAL helpful: https://www.dropbox.com/s/v05uuwrxfmplb6v/Screenshot%202015-06-10%2012.06.45.jpg?dl=0

Hey John. Thanks for the feedback and sorry you’re having trouble with the shortcodes. Your screenshots (except for the last one) don’t seem to be working. Can you please repost those. Also, what is WHMCS? Is it a plugin? If you can let me know, I can install it and test the shortcodes.

WHMCS is a software for web hosting companies www.whmcs.com I have integrated them into Wordpress as many have done before it’s a big thing. When you do this you can use short codes to pull details from the package into this. WHY? If I change anything in WHMCS like prices or package name it will reflect on the price table.

The url’s are working but when clicked through your program is does not loading. Copy the link and open the URL in your browsers and it should work for you.

Okay. I can see the screenshots now. I am not able to recreate the issue on my dev server using a generic shortcode. Can you please provide us with a temporary admin login to your site? It might be helpful to get FTP info as well.

Also, can you please explain a bit on how you integrated WHMCS with WordPress? Did you do this using a plugin? Thanks, John.

[Content Hidden]

Awesome, thanks! The problem is because the shortcode generates some javascript that is overwriting the page. This is the code that is called by the shortcode:

document.write('<span class=&quot;price-prefix&quot;>$</span>3.99<span class=&quot;price-suffix&quot;> USD</span>');

Since the document.write is being called after the page is loaded, it’s overwriting all of the existing content. Can you change this to use innerHTML instead?

Robby,

Sorry unfortunately this is controlled by WHMCS to call up the details outside of my site. So changing this can’t happen. My current price table pages using a plugin with this short code functions just fine.

Hmm. I am not sure if there’s anything we can do then. Using document.write is generally considered bad practice for this very reason. You can see some of the reasons for that here:

http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice

When you’re using the page builder, we’re dynamically inserting the content on the page after it’s loaded, so the document.write call is overwriting the existing page. There’s really no avoiding it. You could reach out to WHMCS to see if they might be willing to update their code? Or, you may have to live with refreshing the page. Sorry. I wish I had a better answer for you.

Robby,

This just will not happen as WHMCS is a standalone software built and designed to be the gateway for clients. The down side is everything always looks the same. So using there API and modifications you can change that. We have went a step more and intergraded that into Wordpress. So it one site for everything but everything is connected to WHMCS and this is the way they provided.

It’s a shame as this was the big reason why I ordered this was many sites we work on are doing the same thing. Now even more I can’t see upgrading to the agency as it would just be more of a waste for me. :frowning: very unhappy… and sadden.

John,

Sorry you’re unhappy. You mention WHMCS has an api? If you can access the raw data, you could experiment with creating your own shortcode that would grab just the data and not the javascript. Also, you could just live with having to refresh the page after entering the shortcode. I know that’s not ideal, but it might be better than nothing?

Sorry again, but as long as that document.write function is being inserted on a page, there’s no way we can prevent it from running and overwriting the existing page content.

Robby,

Leaving the short code and dealing with the refresh. Well, that is just not even possible. Any thing you try to do or add it does a refresh and get this message. I have to quickly “TRY” to press save before it refresh otherwise I lose the changes. This goes for anything on the page.

I will look deeper into the API but this is not a cool solution at all.

Hi, John,

Just a thought. Could you do a minimal page - no header, sidebar etc with just the pricing table? The use an iframe in an html module to pull that minimal page in to the page you want?

Well if I was to go through that and removed my current theme header and footer to downgrade and use iframe that I would just not use short codes and just include prices. But that was a selling point to be able to use short codes and being compatible with it.

My site handles many currencies so if they were to choose pounds the price would change in the price table to reflect this. This is why it’s really handy.

Maybe they can figure out a different method but iframe is not a option, but thank you!

Hmm. I see what you mean. If you think of anything that we can do to help, let us know. Again, though, there’s not much we can do to prevent the document.write from firing. Sorry about all the trouble.