Post by Qphoria » Fri Dec 31, 2010 8:07 am

I don't think offset=1 is needed for the first part. But it works for me if I add that or not. It hides all the categories in my category sidebox. Is that what it is supposed to do?

Does the file get generated in the vqcache folder for you?

It does for me and the result is:

Code: Select all

	foreach ($results as $result) {	
			if (!$current_path) {
				$new_path = $result['category_id'];
			} else {
				$new_path = $current_path . '_' . $result['category_id'];
			}
			
$path = '';
         if (isset($this->request->get['path'])) {
            $path = $this->request->get['path'];
            }
         $cat_array = explode ("_", $path);
         $top_cat_id = $cat_array[0];
         $sub_array = explode ("_", $new_path);
         $sub_path_id = $sub_array[0];
         if ($top_cat_id == $sub_path_id) {
			$output .= '<li>';
			
			$children = '';
It also adds the } before the second index of "if ($results) {" so that appears to be fixed now.

The broken admin was in the 1.0.3 in the first 10 min after I uploaded it (3 people downloaded) and i fixed it and replaced it quietly to fix it so you may have been one of those first 3.. I checked with 1.0.4 on catalog and admin side and all my mods were working still

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Fri Dec 31, 2010 8:25 am

yes I was basically talking about a generic package installer, however with the inclusion of vqmod (and yes I understand it's seperate) you would no longer have to worry about how you are going to handle changed core files, so you could simply unzip without allowing overwrites that way you know you won't obliterate any files. Plus yes long term it would be very nice to somehow keep track of installed mods and allow uninstall, plus it would be great if there were some way to run an install function from the zip file somehow on install. similar to what the modules do now, however when you are talking about generic modifications it is easy to have ones that only modify core files and have new files, but require new db tables. My extra fields mod for instance works this way, of course the functionality will be included in 1.5, but I'm sure there will be other mods that need this. Also I am already faking a database install by calling a check function on every page load of the extra field page, but it would be nice to somehow have a function that only runs on install/uninstall, and yes I realize this is veering quite far from vqmod now. It's just that if vqmod really takes off and most mods are using it that will make a package installer much easier to do where you don't have to worry about overwriting/merging core files.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Fri Dec 31, 2010 8:53 am

yea I have some mods that do the same fake db checker on all admin controller pages. Tho I did add the install option in 1.4.8 that gets called when the extensions is installed from the extensions page. But this is limited to extensions and not new controller pages.

I think that would be something the opencart package installer would need or opencart itself would need a hook for. But yes the inclusion of a package installer for opencart is a must have that will be addressed sooner than later (because I'm tired of people telling me "it doesn't work" because they "allegedly" uploaded the files but it doesn't show up when they really just uploaded it wrong).

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Johnathan » Fri Dec 31, 2010 11:46 am

I applaud what you've done here -- really great work. Any chance on getting Daniel to include this in the core OpenCart package? Kind of like how jQuery is already included. That way everybody would have it already so they wouldn't need to worry about installing it before installing mods.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Qphoria » Fri Dec 31, 2010 12:08 pm

Johnathan wrote:I applaud what you've done here -- really great work. Any chance on getting Daniel to include this in the core OpenCart package? Kind of like how jQuery is already included. That way everybody would have it already so they wouldn't need to worry about installing it before installing mods.
Jquery is a good comparison to this actually. The mod is kinda like javascript on the server. The same way jquery changes the DOM without permanent change to the code, this mod changes the server code without permanent change.

I suppose it would not be completely unrealistic to be included at some point in any project but it might need some maturing. Luckily it is easy to mod in for now.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Fri Dec 31, 2010 12:48 pm

Qphoria wrote:It hides all the categories in my category sidebox. Is that what it is supposed to do?
All the top level categories, yes.
Qphoria wrote:Does the file get generated in the vqcache folder for you?
There was one there, but it had an extra $output .= '</li>'; so I deleted the file. Now I can't get another one to be generated.
Qphoria wrote:The broken admin was in the 1.0.3 in the first 10 min after I uploaded it (3 people downloaded) and i fixed it and replaced it quietly to fix it so you may have been one of those first 3..
Yep, that was me. Life on the bleeding edge, I guess! ;)

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Fri Dec 31, 2010 12:53 pm

Getting rid of the offset got rid of the extra output = <li>. I do need to figure out why it doubled but for now removing it worked for me. Do you have lofging enabled? Check the vqmod.log file (im very proud of my logging :))

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Fri Dec 31, 2010 1:09 pm

Thanks for the tip about the log, Q. It caught the fact that I had copied your instructions as a comment at the bottom of that mod (just to have them handy), and there was a double dash inside the comment, so I guess it thought the comment was ended and the rest was improper code.

All's well now. I'll be using the log and the cache a lot more from now on.

Marc

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Fri Dec 31, 2010 1:57 pm

Awesome. Great to hear that the log was helpful :)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Sat Jan 01, 2011 4:58 am

Q,

In my latest mod I'm using this code:

Code: Select all

<search position="replace" index="2" offset="24">
It's working, but there is an interesting side effect. When I look at the vqcache file, there are 24 blank lines following the code that was replaced. It's probably more cosmetic than anything, but I thought you might want to know.

Marc

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Sat Jan 01, 2011 5:04 am

marc_cole wrote:Q,

In my latest mod I'm using this code:

Code: Select all

<search position="replace" index="2" offset="24">
It's working, but there is an interesting side effect. When I look at the vqcache file, there are 24 blank lines following the code that was replaced. It's probably more cosmetic than anything, but I thought you might want to know.

Marc
Yea.. for replace it deletes the code in the offset then just pastes the new code started at the first of those 24 lines. It is cosmetic and meant so that I don't lose the file line pointer. You also will notice that the modifications made in the cache files aren't tabbed or anything. There is no need for it since its all evaluated the same so no point in adding extra code to process

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Sat Jan 01, 2011 4:25 pm

in the opencart_examples folder, in the Drop_Down_Qty_On_Product_Page.xml file there is a typo that makes it not work:

edit it and find:

Code: Select all

<?php for ($i=$minimum; ?>; $i<=20; $i++) { ?>
replace with:

Code: Select all

<?php for ($i=$minimum; $i<=20; $i++) { ?>

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by chuck5625 » Sat Jan 01, 2011 4:57 pm

I just wanted to make sure I understand this correctly...

Basically this mod will allow you to upload an XML file that will modify the output that we see on a frontend or admin page without having to worry about it breaking during an upgrade.

But this has nothing to do with extensions in its current state. This is only for modifications to files that already exist in OpenCart.

Will this be able to be developed to include extensions at some point or would that have to be done differently? I know I read on the forum somewhere that a few people are working on something similar for extensions, but I was not sure if it would be integrated into this.


Thanks to the OpenCart team for their great work and users on the forums for their help.

Newbie

Posts

Joined
Mon Sep 06, 2010 3:06 pm

Post by JNeuhoff » Sat Jan 01, 2011 9:45 pm

chuck5625 wrote:I just wanted to make sure I understand this correctly...

Basically this mod will allow you to upload an XML file that will modify the output that we see on a frontend or admin page without having to worry about it breaking during an upgrade.

But this has nothing to do with extensions in its current state. This is only for modifications to files that already exist in OpenCart.

Will this be able to be developed to include extensions at some point or would that have to be done differently? I know I read on the forum somewhere that a few people are working on something similar for extensions, but I was not sure if it would be integrated into this.


Thanks to the OpenCart team for their great work and users on the forums for their help.
VQMod's only purpose is to allow modifications of Opencart core files on the fly during a PHP include_once or require_once call, it is not a replacement for current Opencart extensions. An Opencart extension normally adds new files to the Opencart server, but sometimes they also modify Opencart core files which is where VQMod comes in handy.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Qphoria » Sun Jan 02, 2011 12:32 am

Correct. It is also meant to be really good with having a bunch of small mods on your site that are hard to keep track of and you worry about losing when upgrading. i have a dozen tiny changes and tweaks on my store.. all of which have been preventing me from upgrading. But when I put them into a vqmod file, I will be able to upgrade with no worries

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by chuck5625 » Sun Jan 02, 2011 6:49 am

Thanks for the clarification.

Newbie

Posts

Joined
Mon Sep 06, 2010 3:06 pm

Post by spikeachu » Tue Jan 04, 2011 3:46 am

I'm getting some code duplication and replacement when using offset.
For example. I'm editing the admin category template file;

original code looks like this

Code: Select all

     </div>
                <?php } ?>
              </div></td>
          </tr>
          <tr>
            <td><?php echo $entry_keyword; ?></td>
            <td><input type="text" name="keyword" value="<?php echo $keyword; ?>" /></td>
          </tr>
          <tr>
            <td><?php echo $entry_image; ?></td>
            <td valign="top"><input type="hidden" name="image" value="<?php echo $image; ?>" id="image" />
              <img src="<?php echo $preview; ?>" alt="" id="preview" class="image" onclick="image_upload('image', 'preview');" /></td>
          </tr>
I'm using the following XML;

Code: Select all

<file name="admin/view/template/catalog/category_form.tpl">
        <operation>
            <search position="before" offset="1"><![CDATA[<td><?php echo $entry_keyword; ?></td>]]></search>
            <add><![CDATA[<!-- test -->]]></add>
        </operation>
	</file>
and the cache file is showing;

Code: Select all

 </div>
                <?php } ?>
              </div></td>
          </tr>
<!-- test -->
            <td><?php echo $entry_keyword; ?></td>
            <td><?php echo $entry_keyword; ?></td>
            <td><input type="text" name="keyword" value="<?php echo $keyword; ?>" /></td>
          </tr>
          <tr>
            <td><?php echo $entry_image; ?></td>
            <td valign="top"><input type="hidden" name="image" value="<?php echo $image; ?>" id="image" />
              <img src="<?php echo $preview; ?>" alt="" id="preview" class="image" onclick="image_upload('image', 'preview');" /></td>
          </tr>
So the search criteria is being duplicated and is replacing <tr> instead of inserting before it.
This only happens when using offset.

Do I have a funky server set up, or is there a bug somewhere?

Wedding Invitations and Stationery by Love2print

Commercial Mods
Product Colours on Category Page
Cardsave Direct Gateway
Clear Cache
Promotional Watermarks on Images
Multiple Category / Product Templates ** Popular **
Log Failed Login Attempts
Display Eligible Coupons with Products
Twitter Feeds

Have I helped you out or saved you some time? Please donate


Active Member

Posts

Joined
Fri Mar 12, 2010 6:31 am

Post by Qphoria » Tue Jan 04, 2011 3:51 am

It's a bug.. i'll look at it today

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by spikeachu » Tue Jan 04, 2011 3:57 am

You sir, are a legend. Thanks Q.
Have you considered running down the patent office with this feature?

Wedding Invitations and Stationery by Love2print

Commercial Mods
Product Colours on Category Page
Cardsave Direct Gateway
Clear Cache
Promotional Watermarks on Images
Multiple Category / Product Templates ** Popular **
Log Failed Login Attempts
Display Eligible Coupons with Products
Twitter Feeds

Have I helped you out or saved you some time? Please donate


Active Member

Posts

Joined
Fri Mar 12, 2010 6:31 am

Post by Qphoria » Tue Jan 04, 2011 4:43 am

Update in first post:
- Fixed bug with search "offset" duplicating the existing line

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 93 guests