You are here: Home General Chatter Chatterbox Joomla/VirtueMart Hacks

Clapboard - Full Frontal Nerdity

Add Announcement Here

Joomla/VirtueMart Hacks

Joomla/VirtueMart Hacks

Heres where Im going to detail in not-that-great detail what hacks I made to make my new store work.  Feel free to ask questions here, but I cant promise Ill know the answers.  At least if I work out these issues, Ill know how I did it if/when I need to get my shit together again.

Im currently using Joomla 1.5.9 with VirtueMart 1.1.3.  It appears that code changes a lot from release to release, at least with VirtueMart, so its worth noting these numbers.  Im also using a slowly-morphing version of the JA_Purity template.

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

I decided to use the flypage_images.tpl template.  In it, line 15 says

Code:

<?php echo $product_image ?>

I replaced that with this

Code:

<img src="/components/com_virtuemart/shop_image/product/<?php echo $product_full_image ?>" />

after reading notes at this link.

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

So I have navigation.  I like it.  I dont like that when you click on the category page, subcategories re-display between the page name and the page description. After reading around and around the internet, I discovered that if you just delete the categoryChildlist.tpl.php from /com_virtuemart/themes/default/templates/common the bad links go away.

Now, Ive tested in FF, IE & Chrome and its fine, but I have a fear that pulling the file without pulling all references in the site to it might cause trouble, so Ill keep this in mind going forward.

Update:
It turns out that theres a way to tell the cart not to re-print the categories.  I found it yesterday, so I put categoryChildlist.tpl.php back just now as a test, and it seemed to work.  So yay for that.  Ill update again when I re-find the place to do that change.

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

to pull out the Font Size selection option in JA_Purity (My search overwrote it, and who really needs to give users MORE choices?), I just got rid of this line

Code:

    <?php $tmpTools->genToolMenu(JA_TOOL_FONT, png); ?>

in the Template HTML Manager.  It was right before this:

Code:

    <?php if($this->countModules(user4)) : ?>

        <div id="ja-search">
            <jdoc:include type="modules" name="user4" />
        </div>
    <?php endif; ?>

in the <!--BEGIN HEADER--> section.

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

I just decided that I needed to Bulk Change the Flypage info in my already-created categories, so I edited the MySQL database.  I bet theres a better way than that, but I can always use more familiarity with MySQL.  I tried briefly to learn how to bulk edit columns in MySQL, but I ended up just changing the 80ish rows myself.  Weak.

Something to consider going forward.

Turns out that the syntax is very simple - I can just use the following command to change, say, the number of products in a row:

Code:

UPDATE jos_vm_category SET products_per_row=3

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

Heres a list of Modules & Components that Im installing.  Ill try to keep it current.  This should help me with upgrades, etc.  So, no further ado:

to_the_database_I wrote:

VirtueMart
Agora Forums
Phoca Gallery

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

There was a button labeled "Ask the seller a question" that I didnt need in the product page, so I wanted to get rid of it.  All it takes is removing the following snippet of code from the flypage template (in my case flypage_images):

Code:

    <tr>

      <td colspan="2">
          <a class="button" onclick="protoPop( this.href.replace(/index.php/, index2.php ) + &only_page=1, { modal: true,width:640,height:480 } );return false;" href="<?php echo $ask_seller_href ?>"><?php echo $ask_seller_text ?></a>
      </td>
    </tr>

Thats it. Pretty sweet.

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

So Im having problems with EVERY addon in Joomla being fucked up on IE.  I found a way to fix one of the Addons (Phoca), so Im reposting here.

This is the link to the FAQ, and heres what it says

Code:


5. When I am trying to open site in IE, it displays the following message: Internet Explorer cannot open the Internet site - Operation aborted

This is IE bug, type "Internet Explorer cannot open the Internet site - Operation aborted" into Google Search site to get information about this bug.

The following solution added by Ahsya can eliminate this bug on some sites running Joomla!, so if you get this error in IE, just try to read and apply this solution:

First, open:

\libraries\joomla\html\html\behavior.php

and have a look at line 155. There should be the following code:

    <?php
// Attach modal behavior to document
  $document->addScriptDeclaration("
  window.addEvent(domready, function() {

     SqueezeBox.initialize(".$options.");

     $$(".$selector.").each(function(el) {
        el.addEvent(click, function(e) {
           new Event(e).stop();
           SqueezeBox.fromElement(el);
        });
     });
  });");
?>


Edit this line:

window.addEvent(domready, function() {

into this:

window.addEvent(load, function() {

Save the edited file and try to open the site where the error occures in IE.

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

Ive been doing hacks that are too complex to really document in the timeframe Ive been given, but I wanted to come and make note of the fact that Ive been working hard on the layout, while I had a guy in India from ScriptLance write special code to allow for weights to be added to properties.

Specifically to this post, Ive removed the User4 Module, which is lame, but will be cool when I want another module to put somewhere.  Maybe a giant banner across the top.

Anyway, this code

Code:

<!-- BEGIN: MAIN NAVIGATION -->

<?php if ($tmpTools->getParam(ja_menu) != none) : ?>
<div id="ja-mainnavwrap">

  <div id="ja-mainnav" class="clearfix">
        <?php if ($jamenu) $jamenu->genMenu (0); ?>

          <?php if ($this->countModules(user4)) { ?>
    <div id="ja-search">
        <jdoc:include type="modules" name="user4" style="raw" />
    </div>
    <?php } ?>

    </div>

</div>
<?php endif; ?>
<!-- END: MAIN NAVIGATION -->

is the complex main nav that Im working on positioning right now, and Im going to get rid of the search option here entirely.  To do that, Im pulling this bit of that code:

Code:


          <?php if ($this->countModules(user4)) { ?>
    <div id="ja-search">
        <jdoc:include type="modules" name="user4" style="raw" />
    </div>
    <?php } ?>

It seems to work, so were going to just go with that for now.

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Re: Joomla/VirtueMart Hacks

Now Ive pulled out User4 & User6 - I realized a few minutes ago that by using the VirtueMart code in User5 I was making it impossible to use User6, so out it comes.  Maybe someday I can figure out a way to put it back in.

What comes in handy in the case of looking at whats where is the Template Preview built into Joomla.

This is the code I cut out of index.php of my templates main directory:

Code:

    <?php if( $this->countModules(user6) ) {?>

    <div class="ja-box<?php echo $topsl1[user6][class]; ?>" style="width: <?php echo $topsl1[user6][width]; ?>;">
          <jdoc:include type="modules" name="user6" style="xhtml" />
    </div>
    <?php } ?>

flicman
Site Admin
useravatar
Online
418 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
179
Total Polls:
0
Total Posts:
699
Posts this week:
1
User Info:
 
Total Users:
94
Newest User:
exsilebizz
Members Online:
1
Guests Online:
326

Online: 
flicman

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked