Community Forums

[MOD] - VirtualQMod "vQmod" Virtual File Modification System

Community created contributions & mods for OpenCart 1.x

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby spitos » Wed Jun 01, 2011 10:54 am

JAY6390 wrote:Post your /system/library/language.php file here. it should definitely have the $default in it


Here is the code, i've made no changes at all to this file:
Code: Select all
<?php
final class Language {
     private $directory;
   private $data = array();
 
   public function __construct($directory) {
      $this->directory = $directory;
   }
   
     public function get($key) {
         return (isset($this->data[$key]) ? $this->data[$key] : $key);
     }
   
   public function load($filename) {
      $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';
       
      if (file_exists($file)) {
         $_ = array();
           
         require($file);
      
         $this->data = array_merge($this->data, $_);
         
         return $this->data;
      } else {
         echo 'Error: Could not load language ' . $filename . '!';
         exit();
      }
     }
}
?>


Cheers
Image Get it here
Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!

Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby ckonig » Wed Jun 01, 2011 11:09 am

same problem for me. i had to remove the operation regarding the $default, in order to make it work.
User avatar
ckonig
 
Posts: 193
Joined: Wed Feb 16, 2011 8:26 am
Location: Netherlands

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby Qphoria » Wed Jun 01, 2011 11:23 am

spitos wrote:
JAY6390 wrote:Post your /system/library/language.php file here. it should definitely have the $default in it


Here is the code, i've made no changes at all to this file:
Code: Select all
<?php
final class Language {
     private $directory;
   private $data = array();
 
   public function __construct($directory) {
      $this->directory = $directory;
   }
   
     public function get($key) {
         return (isset($this->data[$key]) ? $this->data[$key] : $key);
     }
   
   public function load($filename) {
      $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';
       
      if (file_exists($file)) {
         $_ = array();
           
         require($file);
      
         $this->data = array_merge($this->data, $_);
         
         return $this->data;
      } else {
         echo 'Error: Could not load language ' . $filename . '!';
         exit();
      }
     }
}
?>


Cheers


This is because that is the 1.5.0 language class which daniel has mutilated and removed the language fallback. Epic fail. I wouldn't touch 1.5.0 with a stick
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby spitos » Wed Jun 01, 2011 11:42 am

Qphoria wrote:This is because that is the 1.5.0 language class which daniel has mutilated and removed the language fallback. Epic fail. I wouldn't touch 1.5.0 with a stick


I've amended the language file after comparing it to the 1.4.9.5 version and it seems to solve the error in the log file.

Change this:
Code: Select all
public function load($filename) {
      $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';


To this:
Code: Select all
public function load($filename) {
   $_ = array();

      $default = DIR_LANGUAGE . 'english/' . $filename . '.php';

      if (file_exists($default)) {
         require($default);
      }
      $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';


However this still doesn't solve my issue with the mods not working and being unable to see any changes after upload of an xml file. I've even edited the xml file to update it with the new code changes but it is still unsuccessful.
Trying to install 'new_order_entry_v2.xml'.
An operation in that file is:
Code: Select all
      <file name="admin/controller/common/header.php">
        <operation>
            <search position="after"><![CDATA[
            $this->data['order'] = HTTPS_SERVER . 'index.php?route=sale/order&token=' . $this->session->data['token'];
            ]]></search>
            <add><![CDATA[
            $this->data['order_new'] = HTTPS_SERVER . 'index.php?route=sale/order_new&token=' . $this->session->data['token'];
            ]]></add>
        </operation>
   </file>


But the code in header.php has now changed.
For the operation to complete successfully, I amended that code to this:
Code: Select all
   <file name="admin/controller/common/header.php">
        <operation>
            <search position="after"><![CDATA[
            $this->data['order'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'], 'SSL');
            ]]></search>
            <add><![CDATA[
            $this->data['order_new'] = $this->url->link('sale/order_new', 'token=' . $this->session->data['token'], 'SSL');
            ]]></add>
        </operation>
   </file>

the log showed no errors but the mod still doesn't work! :'(

I'm pretty new to all of this... are my changes valid? Should things be working?
Image Get it here
Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!

Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby Qphoria » Wed Jun 01, 2011 11:53 am

You are using a 1.4 mod with 1.5
won't work
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby ckonig » Wed Jun 01, 2011 11:59 am

are there already any vQmods for 1.5?
User avatar
ckonig
 
Posts: 193
Joined: Wed Feb 16, 2011 8:26 am
Location: Netherlands

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby spitos » Wed Jun 01, 2011 1:01 pm

Qphoria wrote:You are using a 1.4 mod with 1.5
won't work


I don't understand... If the mod has been rewritten to match v1.5.0 and insert the code correctly, why wouldn't it work?

It seems to be a fairly straightforward mod, what am I missing? Please take a look if you could (i'm not desperate to get this particular mod working, just curious as to why it wouldn't), all of the code in the attachment is applicable to the code in the relevant v.1.5.0 files.

Has the way the core files are coded changed in v1.5.0?

I look forward to some 1.5.0 mods ;D
Attachments
new_order_entry_v2(OCv1.5.0).xml
Updated to *work* with OpenCart v1.5.0
(2.99 KiB) Downloaded 53 times
Last edited by spitos on Wed Jun 01, 2011 1:15 pm, edited 1 time in total.
Image Get it here
Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!

Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby ckonig » Wed Jun 01, 2011 1:11 pm

try empty your vqmod.log and reload the page. Then open the vqmod.log again and search for "failed".
Also check the vqcache folder if the modified files appear there.
User avatar
ckonig
 
Posts: 193
Joined: Wed Feb 16, 2011 8:26 am
Location: Netherlands

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby Qphoria » Wed Jun 01, 2011 3:05 pm

Didn't know it was updated for150.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby spitos » Wed Jun 01, 2011 3:58 pm

ckonig wrote:try empty your vqmod.log and reload the page. Then open the vqmod.log again and search for "failed".
Also check the vqcache folder if the modified files appear there.

I emptied the log and tried again but searching for 'failed' shows no results.
I also cleared the cache folder and checked again after reloading the page... for some reason one of the operations didn't seem to work as one of the cached files wasn't present (a change in admin/view/template/common/header.tpl), I don't understand why not. I simply put the code directly into that template to get the mod to appear in the admin area.

Clicking the new 'New Order' option in sales then bought up an error (didn't make a note of this but it was something to do with 'Document $title'). So, in one of the files necessary for the mod to *work* which gets uploaded to admin > controller > sale > 'order_new.php', I had to make to amendments.

Changed 2 instances of this:
Code: Select all
$this->document->title = $this->language->get('heading_title');


To this:
Code: Select all
$this->document->setTitle($this->language->get('heading_title'));


After making those changes I could then click the 'New Order' link and view the page.
However, the css is all out, it uses a different tab.js (instead of tabs.js in v1.5.0) and also has some other issues relating to the sql query and currency field upon saving the new order! :bash:

Almost there but don't have the time to proceed any further... It seems that much of the code has changed in v1.5.0 but without any documentation it makes it much more difficult and time consuming. I hope someone can help progress/convert the fantastic 1.4.9.5 mods for 1.5.0, I give up :'(
Image Get it here
Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!

Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
User avatar
spitos
 
Posts: 258
Joined: Mon May 23, 2011 10:19 am
Location: UK

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby Qphoria » Wed Jun 01, 2011 4:52 pm

Im in the process of converting my mods from 1.4.x to 1.5.0
There are basically 25 steps to convert. Looks like the updated version missed a few steps, like that setTitle one
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby opencartisalright » Wed Jun 01, 2011 5:48 pm

Qphoria wrote:This is because that is the 1.5.0 language class which daniel has mutilated and removed the language fallback. Epic fail. I wouldn't touch 1.5.0 with a stick


You could just mysteriously add it back in to one of the point releases in the future. Ooops, how'd that get back in there... :-X
opencartisalright
 
Posts: 375
Joined: Sun Feb 20, 2011 8:09 pm

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby Qphoria » Wed Jun 01, 2011 8:20 pm

opencartisalright wrote:
Qphoria wrote:This is because that is the 1.5.0 language class which daniel has mutilated and removed the language fallback. Epic fail. I wouldn't touch 1.5.0 with a stick


You could just mysteriously add it back in to one of the point releases in the future. Ooops, how'd that get back in there... :-X


Gotta get past ol' eagle eye or better.. you all need to complain
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby opencartisalright » Wed Jun 01, 2011 9:42 pm

Qphoria wrote:Gotta get past ol' eagle eye or better.. you all need to complain


It would help if I actually knew what to complain about. Language class...language fallback, it's all foreign language to me.

Maybe the basic "What happened to the Language Class, why isn't there a language fallback in version 1.5?" would suffice...

But seriously, why is it important. I'm just curious to know now.
opencartisalright
 
Posts: 375
Joined: Sun Feb 20, 2011 8:09 pm

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby hellogoodbye » Thu Jun 02, 2011 3:46 am

just read this thread for the first time. when do you think it'll be ready for 1.5? thanks
hellogoodbye
 
Posts: 50
Joined: Tue May 03, 2011 10:33 pm

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby Qphoria » Thu Jun 02, 2011 4:01 am

UPDATED FIRST POST!

v1.1.0 - 2011-JUN-01 - Qphoria@gmail.com
- AutoInstaller for OpenCart! (Thanks JayG)
- Updated core script to be 1.4.x and 1.5.x compatible
- Fixed another bug with source path on some servers
- Changed fwrite to file_put_contents for tempfiles
- Added write delays to tempfiles

DO NOT RUN AUTO-INSTALLER IF YOU HAVE ALREADY MANUALLY INSTALLED!
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18200
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby webpie it. » Thu Jun 02, 2011 5:05 am

This is awesome.

I just installed the VQMOD for 1.5

That installed very easily, auto installer rocks!

Tried the mod new_order_entryV.2 above but could not get that to showup.

Everything looks like it works though, thanks to Q and Jayg and everyone else getting this out so fast, i must admit this was my only worry for 1.5 as I see this as a core reason that opencart beats everyone else!

Again thanks guys and hopefully now we will see people porting their mods over, and i dare i say i it, i may even try and port one myself as i feel confident enough to do so.

Peace

Chris
Regards

Chris
webpie it.
 
Posts: 374
Joined: Mon Jan 31, 2011 11:28 am

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby hellogoodbye » Thu Jun 02, 2011 7:57 am

err i don't know what's going on. when the opencart root has .htaccess.txt and i try to install virtualqmod it gives me internal server error and when I rename it to .htaccess and try to install virtualqmod again, it gives me The page you requested cannot be found. opencart is installed on subdomain....or the hosting just sucks
hellogoodbye
 
Posts: 50
Joined: Tue May 03, 2011 10:33 pm

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby webpie it. » Thu Jun 02, 2011 8:52 am

err i don't know what's going on. when the opencart root has .htaccess.txt and i try to install virtualqmod it gives me internal server error and when I rename it to .htaccess and try to install virtualqmod again, it gives me The page you requested cannot be found. opencart is installed on subdomain....or the hosting just sucks


I too had the exact same problem with the auto installer, after my post i tried it again, and i too got a the same error, followed your method with the htaccess and same problem.

I just installed manually as i feel better doing it that way anyway.

But possibly this is an error as this has been rolled out super fast, and only very very early this morning by Q and the with the help of JayG.
Regards

Chris
webpie it.
 
Posts: 374
Joined: Mon Jan 31, 2011 11:28 am

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Postby JAY6390 » Thu Jun 02, 2011 12:56 pm

lol the auto installer was made a couple of weeks ago (before 1.0.9 was released), just not publicly available, so it's not been rushed out at all 8) . If the .htaccess file is called ".htaccess.txt" then it should have NO effect on your site, or give an internal server error. I have a feeling this might actually be due to the .htaccess file(s) inside the vqmod folder itself. If you open vqmod/.htaccess and put a # before Options Indexes and save does it work then?
ImageImageImage

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links


Image
User avatar
JAY6390
 
Posts: 4634
Joined: Wed May 26, 2010 3:47 pm
Location: United Kingdom

PreviousNext

Return to Free Contributions

Who is online

Users browsing this forum: No registered users and 10 guests

Hosted by Arvixe Web Hosting