Closed xxx1285 closed 10 years ago
Not working
$main = array( 'tablePrefix' => 'shop_', //prefix for modx tables 'package' => 'shop','matras', 'packagePath' => '{core_path}components/shop/model/','{core_path}components/matras/model/', 'class' => 'ShopContent','MatrasContent', 'fields' => 'pagetitle, id, alias, price, image', // displayed 'withFields' => 'pagetitle, id, alias, price', // where we do the search 'sortby' => 'pagetitle ASC' );
I have 5 tables - in MIGX - MODX REVO. What can i do, thets work - and searching to 5 tables. Seaching working - only to 'package' => 'shop'
<?php
$main = array( 'tablePrefix' => 'shop_', //prefix for modx tables 'package' => 'shop', 'packagePath' => '{core_path}components/shop/model/', 'class' => 'ShopContent', 'fields' => 'pagetitle, id, alias, price, image', // displayed 'withFields' => 'pagetitle, id, alias, price', // where we do the search 'sortby' => 'ShopContent.pagetitle ASC' );
$joined = array( array( 'tablePrefix' => 'shop_', 'package' => 'matras', 'packagePath' => '{core_path}components/matras/model/', 'class' => 'MatrasContent', 'fields' => 'pagetitle, id, alias, price, image', // displayed 'withFields' => 'pagetitle, id, alias, price', // where we do the search 'joinCriteria' => 'MatrasContent.pagetitle = ShopContent.pagetitle' ) );
// set the query hook declaration $qhDeclaration = array( 'qhVersion' => '1.2', // version of queryHook - to manage futures changes 'main' => $main, 'joined' => $joined, );
$hook->setQueryHook($qhDeclaration); return true;
Please HELP.