News:

Looking for documentation? Take a look on our wiki

Main Menu

Fatal error: Class 'shopFunctions' not found

Started by bbmedia, November 09, 2012, 06:35:13 AM

Previous topic - Next topic

bbmedia

Just updated Joomla 2.5.4 to 2.5.7 and VM from 2.0.6 to 2.0.12f because site was experiencing JSLang errors which seemed to relate to deprecated PHP code.

Now only 3 of the 7 categories work correctly and the others give this error. And any direct links to the products within these categories also give the same error. Can't yet see what the similarities are between these categories.

This is a serious issue since the site is now essentially unusable.

bytelord

Hello,

PHP version?

Also did you try without templates overrides? If is working did you update your template files between 206 to 2012?

changes between versions: http://virtuemart.net/index.php?option=com_content&id=416

Also there is layoutchanges.zip files after 206 (exactly from your current version) that will show you exactly the areas that the code have been changed. Those are images comparing to previous versions will help you to update your template overrides easy.

http://dev.virtuemart.net/attachments/download/456/com_virtuemart.2.0.8_layout_changes.zip
http://dev.virtuemart.net/attachments/download/476/com_virtuemart.2.0.10_layout_changes.zip
http://dev.virtuemart.net/attachments/download/492/com_virtuemart.2.0.12_layout_changes.zip

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bbmedia

Thanks Bytelord
This is the full error I'm getting in all cases:

Fatal error: Class 'shopFunctions' not found in /home/soundrng/public_html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 226

PHP Built On    Linux uswest3.myserverhosts.com 2.6.18-408.el5.lve0.8.58 #1 SMP Wed Mar 14 14:10:01 EDT 2012 x86_64
Database Version    5.1.65-cll
Database Collation    utf8_general_ci
PHP Version    5.3.13
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 2.5.7 Stable [ Ember ] 13-September-2012 14:00 GMT
Joomla! Platform Version    Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT
User Agent    Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:16.0) Gecko/20100101 Firefox/16.0


Template is May 2012 version of myStore (Gavick)
Could it still be a template issue when I have three of exactly the same type of sub-category links and yet only one of them works now?
for instance these two work correctly (included the menu type used, but same issue when clicking directly from the auto generated sub-categories display when viewing the Categories layout):
http://www.soundring.com.au/en/hi-fi-equipment/ (Virtuemart Categories layout)
http://www.soundring.com.au/en/hi-fi-equipment/hi-fi-speaker-stands (Virtuemart Category layout)
and yet these two don't
http://www.soundring.com.au/en/hi-fi-equipment/hi-fi-racks (Virtuemart Category layout)
http://www.soundring.com.au/en/hi-fi-equipment/hi-fi-wall-supports (Virtuemart Category layout)

Also, you'll notice that this site has /en/ (english language) enable for multisite. How do I remove that so it is  there is no /en/ in the URLS, and thus not a multisite - the multisite feature seems to cause havoc with the SSL and results in all sorts of css issues.

Any ideas? Or do I need to re-install the whole site? It seems it's often the only way to resolve Virtuemart problems, I have found.


jenkinhill

Looks like this is failing::

{
         $safePath = shopFunctions::checkSafePath();
         if(!$safePath){
            return FALSE;
         }

Is safepath properly set in VM configuration?  Have you tried without SEF?

Gavick templates have regularly been found to cause issues with VM, but mainly .js problems.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

bbmedia

safe path is /home/soundrng/vmsafe/

besides, if it wasn't working for one category it wouldn't be working for any. They all contain images. Same goes for SEO.

Anyway, I disabled SEO in Joomla and Virtumart both and separately anyway, but to no avail.
Am lost as to why it would stop working for a few categories and not all as they are setup exactly the same, same links, same amount of images, same types of data, no other VM plugins except v-aio

This is my concern about Virtuemart - for such a seemingly widely used ecommerce plugin, no-one really seems to know how this product works, documentation is scarce, and the problems I've had so far with it have been unfixable without a reinstall. I find myself hesitant to upgrade it or add-on to it, because it I know that once I click that button there's a high likelihood that somethings going to go wrong and it will be irreversible without a complete roll-back or reinstall.

bbmedia

Quote from: jenkinhill on November 09, 2012, 11:43:09 AM
Looks like this is failing::

{
         $safePath = shopFunctions::checkSafePath();
         if(!$safePath){
            return FALSE;
         }

Is safepath properly set in VM configuration?  Have you tried without SEF?

Gavick templates have regularly been found to cause issues with VM, but mainly .js problems.

Well I gather myStore from Gavick definitely has it's problems and wished I had not used it. But then, I wish I hadn't used Virtuemart as well. However it's too late for that.

However, having said that... the safePath issue seems to have only surfaced after upgrading VM 2.0.6 to 2.0.12f  AND it does relate to the highlighted code. I have put in a dodgy fix by setting this site's safePath manually in mediahandler.php

But what I think is happening in that code is that the safePath variable either isn't being properly set by shopfunctions.php or isn't being referenced by this code in the mediahandler.php.

So I can't see how that would have anything to do with the template code... but then... I'm not smart to be able to figure it out.
What I do see is VM upgrades being released at a fast rate (2.0.14 now!) which concerns me that there are many issues with this software.

Does anyone have an answer to this yet? This isn't going to go away, and I notice that I wasn't the one to start this post so there will be others out there with the same issue (as I found when I started searching for it).

bytelord

#6
Hello,

Gavick myStore is a discontinued product as far as  i know and does not exist any longer on gavick templates, so last update was from 2.0.6. The rates of updates isn't it because the "software" is not working but new features are been applied as users request and dev team works on that.

Did you use quickstart package on your installation with gavick template?

You have some jquery conflicts on your site that never tried to solve them out ... you are loading jquery twice. Please remove on instance of query, you could unload vm jquery from the backend configuration and load only the 1.7.x library form k2 i suppose. You are using or just loading k2store that is an k2 extension working with k2 front templates view and virtuemart, do you use it, do you know what k2store is? I didn't see on your web site that you are using it at all!!
Also you are loading vmprices.js twice ... maybe comes from your custom template or any third party module.

<script type="text/javascript" src="/media/system/js/mootools-core.js">
<script type="text/javascript" src="/media/system/js/core.js">
<script type="text/javascript" src="/media/system/js/modal.js">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js">
<script type="text/javascript" src="/media/k2/assets/js/k2.noconflict.js">
<script type="text/javascript" src="/components/com_k2/js/k2.js">
<script type="text/javascript" src="http://www.soundring.com.au/components/com_k2store/js/k2store.js">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
<script type="text/javascript" src="/components/com_virtuemart/assets/js/jquery.noConflict.js">
<script type="text/javascript" src="/components/com_virtuemart/assets/js/vmsite.js">
<script type="text/javascript" src="/components/com_virtuemart/assets/js/facebox.js">
<script type="text/javascript" src="/components/com_virtuemart/assets/js/vmprices.js">
<script type="text/javascript" src="/components/com_virtuemart/assets/js/vmprices.js">

<script type="text/javascript" src="/media/system/js/mootools-more.js">
<script type="text/javascript" src="/components/com_virtuemart/assets/js/vmcreditcard.js">
<script type="text/javascript" src="/media/system/js/validate.js">
<script type="text/javascript" src="http://www.soundring.com.au/templates/gk_mystore/js/menu.gkmenu.js">
<script type="text/javascript" src="http://www.soundring.com.au/templates/gk_mystore/js/prefixfree.js">
<script type="text/javascript" src="http://www.soundring.com.au/templates/gk_mystore/js/gk.scripts.js">

So you just use a quickstart template without knowing how to work with joomla and facing such as issues. So, maybe the mistake was that you did't study properly how joomla, templates, cms systems, js, etc works and may be ask from someone else build your site. When building a web site you will face issues like that especially if you are using a custom commercial template. Using joomla cms or any other cms with their components does not mean that you will have a plug-n-play site in minutes, you have to work on that.
I beleive you problems comes from broken installations on gavick quickstart package and i think you should try:
1. Make a joomla clean installation
2. Install Virtuemart
3. Import your data (from a backup?)
4. Is it working?
5. Install gavick template and it's extensions (modules, plugins, whatever)
6. Update gavick template to 2.0.14 with the links i have you on my first post
7. Test it / debug it / corrected / solve your issues
8. Publish it

Good luck with that

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bbmedia

Thanks Bytelord,

Yes I started with the myStore Quickstart more than 6 months ago as you correctly diagnosed. (btw, myStore is still a current Gavick J2.5 template and have been in contact with them as well) I've upgraded from there and have been trying to remove the unneeded plugins/modules and thus remove unneeded/duplicate js.

But I determined that having created a site designed the way I wanted, I would now go through and rebuild the site from the ground up because I suspected that the site's flakiness was related to conflicting combos, however by the time of when the server PHP upgrades happened I hadn't finished it... I'm almost there. Hopefully this, and using the latest update of every aspect of the installation (Joomla, VM, Linelab's Onepage checkout, Alatek Offline CC), will resolve the issues.

(sigh) Even though I researched this option thoroughly over two weeks before starting this (because I was leery about doing this in a off-the-shelf open source product) has been a very expensive (time-wise) experiment. It would have been faster for us to build it from scratch in Bootstrap, particularly as it includes some unusual search requirements that required some proprietary dev anyway - I'm trying to find some redemptive benefit for having wasted so much time on this.

The new installation is running J2.5.8, Vm2.0.14, and current version plugins. Only installing the base necessities to limit code base, and we've transferred the product database (including proprietary setups) but are carefully rebuilding the VM installation to ensure that we don't end up with /en/ suffix to the URL (as the current http://www.soundring.com.au site unfortunately and intentionally ended up this way - ANY IDEAS on how to ensure we avoid this?).

l will use the links provided once that's done to ensure that the myStore template is compatible.
Thanks

bytelord

Hello,

myStore is there but i think is a discontinued product, so no more updates are been applied. I have already give you the hits to update your template files, so this will be your guideline.

Which one you to avoid, didn't understand you correctly, sorry

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bbmedia

I have turned off all non-essential plugins and replaced the Linelab Onepage Checkout, and with the dodgy hack in the mediahandler.php file that I did, the site is again working correctly. I think it will work better now, because I was getting occasional template, js, and cart errors/faults.

Yeah, I think myStore was a big dud for gavick - it caused a lot of problems. I think it can work OK with only the bare minimum of plugins and (as you pointed out) the correct version of the js is loading.

Still two issues:

(1)
I'm still getting
<script src="/components/com_virtuemart/assets/js/vmprices.js" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/vmprices.js" type="text/javascript"></script>
Can't seem to turn the second one off.
It only loads one in the header for the rest of the site, but int he cart it loads twice. I'll keep testing.

(2)
The current site http://www.soundring.com.au redirects to http://www.soundring.com.au/en/
How do I make it stop doing that? Or, if I can't, how do I ensure that it doesn't happen in the new installation that I'm working on?

Thanks for your assistance, and do you do Joomla/Virtuemart work on a contract basis?
cheers

bytelord

#10
Hello,

On your first question, please check your cart module. Also maybe re-loaded maybe because you are using a third party cart system reloads that file (an updated version). You could stop vm from loading the original one, check if those files are similar.
On the second one this is because you have install your joomla site under the folder "en", am i right? You could edit .htaccess file to "hide" that  folder but this may be cause issues with seach engine seo links. The best is, if for example you have cpanel, configure it the home folder of that site be the /en and it will works, or install your joomla site under the root.

You are welcome. I will send a pm.

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

luizwbr

Hi guys, I found a way to fix this bug.

Just replace the MediaHandler __construct method and include shopfunctions.php.

/public_html/administrator/components/com_virtuemart/helpers/mediahandler.php

class VmMediaHandler {

var $media_attributes = 0;
var $setRole = false;

function __construct($id=0){

require_once "shopfunctions.php"; // <-------------------------------------- insert this line

$this->virtuemart_media_id = $id;

$this->theme_url = VmConfig::get('vm_themeurl',0);
if(empty($this->theme_url)){
$this->theme_url = JURI::root().'components/com_virtuemart/';
}
}


http://virtuemartbrasil.com.br - Brazillian VirtueMart official Support Group
http://loja.weber.eti.br - Paid Plugins for Virtuemart Brasil
https://www.facebook.com/groups/virtuemartpro/ - Brazillian VirtueMart group on Facebook