Results 1 to 6 of 6
  1. #1
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default wrap group product listing information

    Hi,

    I have installed column layout grid, and it works fine, I am trying to customize it by adding specific divs, some of which are ok when done in common/tpl_columnar_display.php but I need to group some of the information together which I guess should be done in modules/product_listing.php file and I am lost there.

    Right now I have this:

    HTML Code:
    <div class="my-wrapper-one"><!-- this is added in common/tpl_columnar_display.php -->
    <!-- these are coded in modules/product_listing.php -->
    	<div class="centerBoxContentsProducts centeredContent back">
    		<div class="listingImage">
    		<img src="images/dvd/a_bugs_life.gif" />
    		</div>
    		<h3 class="itemTitle">A Bug's Life</h3>
    		<div class="listingDescription">
    		A Bug's Life
    		</div>
    		<div class="listingPrice">
    		35.99
    		</div>
    		<div class="listingButtonGroup">
    		... more info
    		</div>
    		<div class="listingModel">
    		DVD-ABUG
    		</div>
    	</div>
    <!-- END these are coded in modules/product_listing.php -->
    </div>
    Now what I need is to group and wrap those info generated in modules/product_listing.php
    something like this
    HTML Code:
    <div class="my-wrapper-one"><!-- this is added in tpl_columnar_display.php -->
    	<div class="centerBoxContentsProducts centeredContent back">
    		<div class="my-first-group">
    			<div class="listingImage">
    			<img src="images/dvd/a_bugs_life.gif" />
    			</div>
    			<h3 class="itemTitle">A Bug's Life</h3>
    		</div>
    		<div class="my-second-group">
    			<div class="listingDescription">
    			A Bug's Life
    			</div>
    			<div class="listingPrice">
    			35.99
    			</div>
    			<div class="listingButtonGroup">
    			... more info
    			</div>
    			<div class="listingModel">
    			DVD-ABUG
    			</div>
    		</div>
    	</div>
    </div>
    Eventually being able to move some info from one group to the other would be great.

    Thank you

  2. #2
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: wrap group product listing information

    Any idea?

  3. #3
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: wrap group product listing information

    So haven't looked at the code that generates each of those, but not every product would output each of those subgroups, so will need to establish a "flag" indicating the previous group(s) have:have not been output. At the point of outputting any group after the first need to close the previous if it was opened and output the next. If at the end of outputting any then need to be sure to close out the last. Also assuming that evey such thing output will be within some group or else the process becomes a little more complicated.

    Thinking that this tracking could be handled with an array with the key being an integer representing the group number and that the group number would be incoporated into the group's class name. Also, because the sequence of display is based on the arrangement of the data to be displayed, that each item be considered "carefully" as to which group number is to be assigned in order to accomplish the above check. If an item can be "regrouped" into it's main group such that say group 2 could appear multiple times in the page and accomplish the desired goal, then may want a second array or variable tracking what group is currently open so that if the item is not in the desired group the previous group is either closed and then the currently desired group is open or the previous group remains open, the new group opened and closed (or delayed in closng pending the next item) and depending on all that may need to track a sort of "depth" of opening and closing so that in the end everything is closed, the number of times opening a group is minimized for two subsequent items of the same group, etc...

    So, guess question kind of is what items should be in what groups, what is the method by which you expect to assign items to a group, what kind of "frequency" is this grouping to be modified? What is being done with the grouping to possibly address some of the complexity added in the last paragraph?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: wrap group product listing information

    Thank you.

    I lost you at the second line ... ;(

    Not being a coder it seems beyond my reach.
    I thought it was a matter of adding the extra divs in the modules/product_listing.php file somewhere like here:
    PHP Code:
        $product_contents = array(); // Used For Column Layout (Grid Layout) Add on module
        
    $flex_skips 0//reset flag for reducing # of columns
        
    $prev_cell_text '';
        for (
    $col=0$n=sizeof($column_list); $col<$n$col++) {
          
    $lc_align '';
          
    $lc_text '';
          switch (
    $column_list[$col]) {
            case 
    'PRODUCT_LIST_MODEL':
            
    $lc_text '<div class="listingModel">' $listing->fields['products_model'] . '</div>';
            
    $lc_class 'listingModelCell';
            break;
            case 
    'PRODUCT_LIST_NAME':
            
    $lc_text .= '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            
    $lc_class 'listingNameCell';
            break;
            case 
    'PRODUCT_LIST_MANUFACTURER':
            
    $lc_text .= '<div class="listingManufacturer"><a href="' zen_href_link(FILENAME_DEFAULT'manufacturers_id=' $listing->fields['manufacturers_id']) . '">' $listing->fields['manufacturers_name'] . '</a>' '</div>';
            
    $lc_class 'listingManufacturerCell';
            break;
            case 
    'PRODUCT_LIST_PRICE':
            
    $lc_price zen_get_products_display_price($listing->fields['products_id']);
            
    $lc_text .= '<div class="listingPrice">' $lc_price '</div>';
            
    $lc_class 'listingPriceCell'
    Of course the above is just a snip, and might not be the right one, I just saw that there are some of the infos, and relative divs there.

    I guess I'll have to change my mind about this it.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: wrap group product listing information

    If not mistaken that is the area I wrote about yesterday while waiting for the restaurant to prep my food to go. (Meaning, wasn't in a position to give direct code changes.) But it appears that yes that would be the area to apply the above logic so that desired results can be obtained.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    May 2009
    Posts
    1,254
    Plugin Contributions
    3

    Default Re: wrap group product listing information

    Thanks.

    My problem is indeed applying the logic.
    Maybe someone in the future will, for now I'll keep using it as is.

 

 

Similar Threads

  1. v155 Product listing, group products.
    By kylef in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 May 2016, 04:14 PM
  2. Product listing layout - group several products together?
    By Maggie_2010 in forum Addon Templates
    Replies: 2
    Last Post: 24 Feb 2011, 08:23 AM
  3. Information sidebox word wrap problem-TruBlue Template
    By Ecable in forum Addon Templates
    Replies: 0
    Last Post: 15 Feb 2009, 05:31 PM
  4. display group pricing discount in product listing
    By aeisecurity in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 29 Sep 2008, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg