Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tfc_get_subcat function content for osclass 3.8
function tfc_get_subcat( $parentId = '' ) {
$tfccache = new tfcCache();
$key = 'subcat' . $parentId;
if ( ! $categories = $tfccache->tfcFetch( $key ) ) {
if ( ! $parentId ) {
$categories = Category::newInstance()->listWhere( 'fk_i_parent_id IS NULL AND b_enabled=1' );
//$sql = "SELECT pk_i_id FROM `" . DB_TABLE_PREFIX . "t_category` where fk_i_parent_id IS NULL AND b_enabled=1 Order by i_position";
} else {
$categories = Category::newInstance()->listWhere( 'fk_i_parent_id = ' . $parentId . ' AND b_enabled=1' );
}
$tfccache->tfcStore( $key , $categories , 680 );
}
if ( $parentId != "" ) {
?>
<li>
<a href="<?php echo osc_esc_html( osc_update_search_url( array (
'sCategory' => null ,
'iPage' => null
) ) ) ?>"><?php _e( 'Reset Categories:' , 'shopclass' ); ?></a>
</li>
<?php
}
if ( ! empty( $categories ) ) {
foreach ( $categories as $category ) {
$nameurl = tfc_category_name_url( $category[ 'pk_i_id' ] );
?>
<li><i class="text-muted fa fa-chevron-right"></i><a
href="<?php echo osc_esc_html( osc_update_search_url( array (
'sCategory' => $category[ 'pk_i_id' ] ,
'iPage' => null
) ) ) ?>"><?php echo $nameurl[ 'name' ]; ?></a>
</li>
<?php
}
}
}
@navjottomer

This comment has been minimized.

Copy link
Owner Author

@navjottomer navjottomer commented Aug 13, 2018

Replace same functions in core-functions.php file to fix osclass 3.8 compatibility issue.
function tfc_get_subcat is around line no. 388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.