component hack

  • In several previous tips(like Turn caching on!, Caching reloaded, Give a boost to your Joomla site and couple of others) I urged you to turn caching on wherever is appropriate. Recently one of my readers had criticized me, because he tried to follow the tip, but on several modules he used simply he didn't found the option to turn cache on (or off) in module settings.

    Indeed, this might be a problem, since some modules does not have this option! this little detail don't need to stop you to do so!

  • By default, in the VirtueMart 1.1.* Store Information settings you can add only one e-mail address in Contact Information box. All important mails - as new order notifications, for example, will be sent there. What if - for various reasons - you need to add more, than one e-mail address?

  • Recently one of my clients needed an interesting feature: to have different, un-related prices for the products in his shop for each "currencies" he wanted to use. The quote signs aren't by mistake there, one of his "currencies" was for example Payments in USD from China... Interesting currency, what you think?

    At the first the problem seemed to be simple: since the existing VM framework let you define any kind of extra currencies, and also let you enter prices for products in all of your currencies, the logical step was to simply switch off the currency converter plugin, as was possible in VirtueMart 1.1.9 and earlier versions.

    But there is the first catch - this is no more possible.

  • Would be nice to have the contact images in the contact Category table, don't you? Yea, and in fact is a relatively simple trick, since Joomla 1.5 and the template overrides being handy!

  • What? A shopping cart with users which can't actually shop?

    Weird or not, that was a recent request from one of my customers. He wanted to have a quick way to prevent some of his users from putting products in cart, but leave all other site functionality intact.

  • Yup, this might be an interesting feature, but how easy or hard is to implement?

  • You might need to use a plugin's output in a component, or to insert a module in a page outputted by an arbitrary component. I mean ANY plugin which has it's own output in ANY Joomla component you like.

    I know, there are couple of ready-made solutions, but all of these are specific to a given component(s) and some components have their own plugins to do that.

  • JA's K2 Search and Filter add-on is a nice - and powerful tool. But has an annoying problem (at least in version 1.0.7): When one edit a K2 item which have extra fields, on save an ugly error 1062 database error is popping up. The component is working correctly, the modified date is saved, but the user  doing the update gets seriously confused.

  • After updating K2 to version 3.6.3, in the backend, when tried to edit one of items, I got this error:

    Error decoding JSON data: Syntax error.

  • Recently a customer of mine asked for a page with a list of K2 items, sortable by the custom fields and item titles. And I accepted the challenge. a first search on the "k2 list sort by extra fields" term returned a whopping number of 1,120,000+ results... and most of them where how to hack the core component to obtain a list sorted by a given extra field - which was not what I wanted. But, reading these pages an ideea sparkled - and in less, than a hour I had in place a solution wich was clean, no core code was hacked, and the table of results is freely sortable.

  • VirtueMart is great when you want to set up a store which works with multiple currencies. You can set up your own prices for each currencies in your shop, or you can use one of available currency converters. The core functionality supports the use of European Central Bank's live currency rates, but there are plugins supporting other rates too.

    But you can run into trouble where you'd expect to not have any surprises: on PayPal checkout page.

  • When a registered user adds a new entry in your SobiPro powered business directory in your Joomla site you might want to add a link pointing back to his Community Builder profile. Sounds simple... but the powerful templating system of SobiPro might be cryptic even for advanced users. And you might not have a membership in SobiPro club - BTW, worth every penny!

    Here is one way you can do this!

  • Recently I had to build a kind of people directory (ouch, this was  too "politically correct" - in fact a backlist of bad customers for a group of antrepreneurs) and the obvious choice was using of SoBi Pro. But the project has couple of special challenges, and I needed to develop couple of tricks to match my client's needs.

  • You might experienced this, the links in the Alphabar are sometimes misbehaving, the module assignments in the resulted pages are gone off, if you have some fancy module to menu associations set in your SoBiPro powered site. Obviously, this is an ItemID handling problem, and, unfortunately can be fixed only with a core hack.

  • SoBi Pro is great... but misses some basic features, as adding a prefix to a field (might be as simple as willing to add the "dollar" signe as prefix, and not as suffix), and the templating is powerful - but criptyc even for an average Joomla developer. Recently I had to build a site wich had a special need - to display the last 4 digits of a person's Social Security Number, in the format ***-***-1234.

  • A seemingly simple question caused serious headaches in past weeks. One of my clients who has an already seriously cross-hacked VirtueMart shop (SkinRich) asked me to make it possible, that a specific shopper group she had, the Distributors, namely, to be able to order products only in six-packs, making warehouse people's life much easier, and costs lower. The other users should have the default quantity options.

    After thinking a lot about how to solve the problem, I came out with a 4 line simple hack, which works perfectly for me.

  • It's a know fact between VirtueMart insiders, that you can use Joomla plugins in the product descriptions. For that you need to enable this by clicking a checkbox in VirtueMart's main configuration (VirtueMart Admin > Configuration > Global tab > Enable content mambots/plugins in descriptions? checkbox.)

    But what if you want to use plugins elsewhere, in other spots of the VirtueMart pages? For example in some other spot of the product details page - let's say to insert an availability calendar module under the main product image?

    Right, you can do it with a little code hack! Let's make our hands dirty with some PHP then!

  • I am angry on Easter bunny. Really... He delivered to me a nasty surprise: lots of my customers complained during/after Easter weekend, that their shops, sometimes the Easter's week began to malfunction: the users using PayPal as payment gateway aren't charged correctly. After studying the problem, I found, that is happening on shops running versions of VirtueMart 1.1.3 to 1.1.9, charging shipping to customers and using the old PayPal API to communicate with the gateway. More precisely, the sipping net amount was not transferred, the shipping tax was sent correctly.

    Then, by searching for "virtuemart shipping not transferred to paypal" I discovered, that I am not alone: there where some 54k+ search results returned!

  • The VirtueMart forums are full of complaints like:

    When a shopper from my wholesale group (50% off) opens the product page it shows the parent products discounted price as the price of each child. Any help would be appreciated.

    So, here's the much awaited fix!

  • More and more users are switching to Google Mail, Hotmail and other free mail services these days. It's a great move... unless you have VirtueMart and your Joomla is set to send your mails through SMTP. You may easily end seeing something like:

    Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmail.com:25

    The mails from other Joomla apps are sent, just the VirtueMart is behaving badly. Weird thing is, that you can see in the main Joomla config the mailer set up properly, and the port to be used is 465, as required for Google Mail, but as you can see the error message indicates that VirtueMart tries to use port 25! The problem is that VirtueMart has a code flaw, when sending mails through SMTP the port 25 is hardcoded, and isn't inherited from main Joomla configuration file.

    The fix is relatively easy, but you must get your hands dirty with some PHP code.