• Resolved resurehtonatey

    (@resurehtonatey)


    Hello,

    Please, could you write verbose changelog, especially when you change theme integration, I quote readme.txt:

    = 2.9.12 - 28/10/2019 =
    
    * Minor responsive styling improvements
    * Theme integration improvements
    * Product import and export link added on products admin screen

    It will prevent us our child thems regressions.

    And maybe harmonize files between changelog.txt, readme.txt and README.md 😉

    Thanks !

    Regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ndre

    (@ndre)

    Hi @resurehtonatey,

    Do you mean that something broke in your theme integration with the latest update? Can you please specify what?

    Hi @ndre ,
    Yes, some times ago, I have written a function in subthem folder to mix grid view for categories listing and classic-list for product listing.
    With the update, categories-listing is called twice, to show categories and sub-categories in the same page.
    I’ms earching about this calls.

    Plugin Author ndre

    (@ndre)

    Hi @resurehtonatey,

    What is the code that you added?

    Hi @ndre

    The following function is a version of product_cat_shortcode from shortcode.php

    function modification_product_cat_shortcode( $atts ) {
    //ifvcurrent object is homepage: init 0 for category product view
    $parent = get_queried_object_id();
    $titre_page = get_queried_object()->post_name;
    // for homepage, if empty parent & product page
    if ( $parent == get_option('page_on_front') || empty( $parent) || ($titre_page == 'produits')) {
    	$parent = '0';
    }
    // affiche grid catégories	
    	global $cat_shortcode_query, $product_sort, $archive_template;
    	$cat_shortcode_query				 = array();
    	$cat_shortcode_query[ 'current' ]	 = 0;
    	$available_args						 = apply_filters( 'show_categories_shortcode_args', array(
    		'exclude'			 => array(),
    		'include'			 => array(),
    		'archive_template'	 => 'grid',//
    		'parent'			 => $parent,//
    		'sort'				 => 0,
    		'shortcode_query'	 => 'yes',
    		'orderby'			 => 'name',//
    		'order'				 => 'ASC',
    		'per_row'			 => get_current_category_per_row()
    	), $atts );
    	if ( $available_args[ 'orderby' ] == 'none' ) {
    		$available_args[ 'orderby' ] = 'include';
    	}
    	$args = apply_filters( 'show_categories_args', shortcode_atts( $available_args, $atts ) );
    	if ( !is_array( $args[ 'include' ] ) ) {
    		$args[ 'include' ] = explode( ',', $args[ 'include' ] );
    	}
    	//$div		 = '<div class="product-subcategories responsive ' . $args[ 'archive_template' ] . ' ' . product_list_class( $args[ 'archive_template' ], 'category-list' ) . '">';
    	$taxonomy						 = apply_filters( 'show_categories_taxonomy', 'al_product-cat', $args );
    	$cat_shortcode_query[ 'enable' ] = $args[ 'shortcode_query' ];
    	$product_sort					 = intval( $args[ 'sort' ] );
    	$inside							 = '';
    	$per_row						 = intval( $args[ 'per_row' ] );
    	if ( !empty( $per_row ) ) {
    		ic_save_global( 'shortcode_per_row', $per_row );
    	}
    	if ( $args[ 'parent' ] == '' && empty( $args[ 'include' ] ) ) {
    		//$old_args			 = $args;
    		$args[ 'parent' ]				 = '0';
    		$cats							 = get_terms( $taxonomy, $args );
    		$cat_shortcode_query[ 'count' ]	 = count( $cats );
    		foreach ( $cats as $cat ) {
    			$inside	 .= get_product_category_template( $args[ 'archive_template' ], $cat );
    			$cat_shortcode_query[ 'current' ] ++;
    			$inside	 .= get_sub_product_subcategories( $args, $cat );
    		}
    	} else {
    		$cats							 = get_terms( $taxonomy, $args );
    		$cat_shortcode_query[ 'count' ]	 = count( $cats );
    
    		foreach ( $cats as $cat ) {
    			$inside .= get_product_category_template( $args[ 'archive_template' ], $cat );
    			$cat_shortcode_query[ 'current' ] ++;
    		}
    	}
    // fin grid
    	// if ( !empty( $inside ) ) {
    		// $ready	 = apply_filters( 'category_list_ready', $inside, $args[ 'archive_template' ] );
    		// ic_save_global( 'current_product_categories', $ready );
    		// ic_save_global( 'current_product_archive_template', $args[ 'archive_template' ] );
    		// ob_start();
    		// do_action( 'before_category_list', $args[ 'archive_template' ] );
    		// $inside	 = ob_get_clean();
    		// ob_start();
    		// ic_show_template_file( 'product-listing/categories-listing.php' );
    		// $inside	 .= ob_get_clean();
    		// ic_delete_global( 'current_product_categories' );
    		// ic_delete_global( 'current_product_archive_template' );
    	// }
    	reset_row_class();
    	return $inside;
    }

    called from categories-listing template:

    <div class="product-subcategories responsive grid ">
    <?php 
    echo modification_product_cat_shortcode('current_product_categories');
    ?>
    </div>

    Hello,

    So, I have solved problems due to the missing term_id for product page and name which has changed to describe products and product’s category pages.

    But please, update your github or changelogs files verbosely =)

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.