Common Problems RSS feed for this section

3.8.11 – How to Update your wpsc-user-log.php file.

You’ve likely landed on this page because you recently upgraded to WPeC 3.8.11 or greater and you happen to have a theme that has modified the wpsc-user-log.php page.  This was a change made in 3.8.10, and this documentation is our effort to, as easily as possible, assist you in upgrading your theme file to be compatibile with the latest version of WPeC.

Before 3.8.10

Before WPeC 3.8.10 was released, the wpsc-user.log.php was a mish-mash of presentation and logic filled with tons of conditionals and inconsistent hooks and mechanisms for plugin developers to modify the output.  If you have a very basic understanding of HTML and template tags in WordPress, you can check out the source of this file here.

You’ll see a few basic blocks

  • is_user_logged_in()
  • START OF PROFILE PAGE
  • START OF DOWNLOADS PAGE
  • START OF PURCHASE HISTORY PAGE
  • You must be logged in (Preceded by <?php else : ?>)

After 3.8.10

After 3.8.10, the wpsc-user-log.php page has been streamlined into a fairly versatile system where each view of the user account page is inserted via hooks.  This means it is far easier for plugin developers to add (or remove) different view in the My Account page without having to worry the user with making changes to their theme files.  If you look at the source file, you’ll see it drastically simplified. The blocks are as follows:

  • is_user_logged_in()
  • do_action (this is important)
  • You must be logged in (Preceded by <?php else : ?>)

After looking at the code, here are the really important differences to note:

  1. Near the top, by the global keyword –  the new version removes all of the previous globals, and adds one, $current_tab.
  2. The contents inside of the user-profile-links <div> have completely changed. It’s only a few lines, but they are important.
  3. Outside of that <div>, there is a new action, <?php do_action( 'wpsc_user_profile_section_' . $current_tab ); ?>
    Also super important.
  4. Aside from that, everything else is stripped away and you’re left with the “else” condition for the logged out form.

If there are new changes you want to make, or you’re beginning the process of re-applying changes to different areas of this file, you’ll notice three new files which contain the areas previously contained in this file.

  1. wpsc-account-downloads.php
  2. wpsc-account-purchase-history.php
  3. wpsc-account-edit-profile.php

Naturally, you can just apply your previous changes to each of these files.  This should be a fairly easy change, even for novices.  But of course, if you need any help in this process, WPEC Consultants are highly capable and should be able to handle even the more complex theme files within an hour’s time – for most themes, it could be much less than that.

Read Documentation ·

JS conflicts

Nothing in your Cart? Forever spinning loading wheel? Light-box acting strange? All these problems and a lot more occur because your site is loading jQuery more than once.

Hello I’m Cameron and I have been helping people in support for about a month now; this issue is probably one of the most common problems that I get. So I thought I would write a decent explanation here of what is going wrong and how to fix it. So, if the front end of your site is acting strange (even if it is not, read this…) it could be because your site is including jQuery multiple times.

So how do I check?

 

  • Open up the page that is giving you grief and view its source in your browser.
  • Open up your browser’s find/search window (Ctrl+F)
  • type in jQuery’ and view what highlighted text. You should see this as a group, since WP e-Commerce loads all javascript libraries.
  • Now pay attention to the first line that loads the jQuery itself – the rest are jQuery plugins that require jQuery to be loaded first.
  • Now keep looking though the source, if you see another line where jQuery is being loaded, (it doesn’t matter about the version info) this will be your problem.

Why is this a problem?

As you probably know, the order in which scripts are loaded matters. As far as the computer is concerned, they are not separate, the browser will just read them as one long script, not as many small ones, so if another jQuery script is loaded it can really mess up the jQuery plugins that have already been loaded.

Ok I’ve determined that it is happening, but why is my site calling jQuery twice?

Generally, this happens because your theme or other plugins you are using are calling jQuery but are not calling it in the correct WordPress way.

WordPress has a function called wp_enqueue_script, which is the correct way to call jQuery (or any other commonly used script). What this function does is check if jQuery is already being used, and if so it doesn’t call it again.

Ok, so where is this call being generated so I can delete it?

Well that depends if it is being called by your theme or by another active plug in. If it is being called in your theme it will most likely be in your header.php file or your footer.php file, so have a look for a line that looks like this (insert image)

Now the beginning of the line may look different but what is important is the jquery/jquery bit. So if you find that line delete it and use the wp_enqueue_script() function in your themes functions.php file.

If the call is coming from one of your plugins then it may be that the easiest thing to do is to turn off all your plugins and then turn them on one by one, each time checking your page source to see if that duplicate jQuery comes up. When you find the plugin causing the problem simply not deactivating it would be the easiest solution. However, if you really want to use the plugin it might be worthwhile contacting the plugin author and asking them to fix their plugin so that they include scripts correctly. Or, you could just try and find where it is being called using the technique described above.

Its also worth noting that even though jQuery is usually the script that is included twice, there could also be other scripts included twice that could be causing problems.

Another technique for finding duplicate scripts is by using the scripts section of Firebug plugin for Firefox. Just click on the script drop down and you can see a list of all the scripts that have been loaded in. From there you can check if there are any duplicates.

Hopes this helps
Cameron

Read Documentation ·

Troubleshooting for PHP Allowed memory size

Have you ever get an error warning displays one of these messages? Is your WordPress too slow and run out of memory?
PHP Memory Limit

Fatal error: Allowed memory size of 8388608 bytes exhausted.

or

(more…)

Read Documentation ·
KIWI