Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

MetaMod/Hikashop Combo Valid?

MetaMod/Hikashop Combo Valid?

Pretty much what the thread title/description ask. Is it possible to use this with Hikashop? I'm trying to add additional functionality to a website and I've had good experiences with this in the past. I really need a quick answer if possible. Thanks.

GallJ
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: MetaMod/Hikashop Combo Valid?

Hi GallJ,

Yes, MetaMod works well with HikaShop. There's some built-in functionality so that MetaMod can detect some HS things via the JomGenius system. This isn't documented yet (sorry) so here's a brief tutorial:

$hs = JomGenius("hikashop");
if ($hs->check("keyword = something")) return XXX;
// replace XXX with the id of the module you want to display when keyword = something.

Now, the keywords you can use are:

productid (returns the numeric id)

pagetype:
/* returns one of: user.profile, category, checkout#0, checkout#1 etc,
* contact.sent, contact, product.listing, product.compare, product.show,
* user.address.add, user.address.edit, user.address.listing,
* user.order.listing, user.order.show, user.downloads, user.cpanel, user
*/

categoryid
    /* returns the category id of the list, or the item being displayed.
     * * top / bottom (default bottom)
     * If the list: this is taken from the URL
     * If the item: if a category id was in the URL then this is used. Otherwise,
     *  if the item is in only 1 category, then that is used. Otherwise, if it's
     *  in more than one, then one will be selected in no particular order.
     */

categoryids:
    /* returns an array of immediate category ids that the item is in; not their parents.
     * If the category id is in the URL, then this one will be first on the list.
     */

ancestorcategoryids
/* returns a list of all the category ids that the product is in,
* and their parent category ids, all the way up the line to
* the top level
*/


So for example if you want to detect whether a product is in a particular category or any of its subcategories, you can do this, specifying the category you want to check the descendents of:

$hs = JomGenius("hikashop");
if ($hs->check("ancestorcategoryids = 22")) return XXX;
// replace XXX with the id of the module you want to display when keyword = something.

(in this case, checks that the product or category displayed has any ancestor that is category id 22. Another way of looking at it is that it checks for any descendents of category id 22.)

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1680
Total Polls:
6
Total Posts:
5914
Total Posts Today:
1
User Info:
 
Total Users:
10831
Newest User:
bluesky1
Members Online:
0
Guests Online:
93

Online: 
There are no members online

Forum Legend:

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