Forums / Templates, Stylesheets, Page Layout / styling product listing pages with column layout grid

styling product listing pages with column layout grid

Views: 50,719

Results 181 to 200 of 220
27 Nov 2012, 9:19 PM
#181
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

styling product listing pages with column layout grid

That is very strange. Your two categories are displaying in very different ways - Airbox & Filters with grid-type elements in a rows table layout, Belts in a completely stock rows layout. Do you know why that is happening? Did it happen before? I remember seeing the group of discount tables above the listing, but don't remember what style the listing elements took then.

The fact that they are behaving differently in response to the quantity coding, with Airbox & Filters not showing at all while Belts is missing only the price, is understandable because the grid coding accumulates the whole product before adding to $list_box_contents while the rows coding adds each element of the product as it is created. Somehow the fact that the quantity code is executing wipes out everything that is being done then.

We need some debugging. Add to the quantity code

echo $qdt . '<br />';

just before

$lc_price = $qdt;//gjh42 20121127

We also need to know why the listings are outputting in different formats. That is puzzling and could be causing any number of unknown problems, and it may not be possible to debug the apparent problem until that is sorted out.

27 Nov 2012, 9:50 PM
#182
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

sorry about the confusion, I have some custom coding that allows me to hard code based on category id whether I want it to show up in grid format or the stock row format. This actually works well besides the obvious maintenance side of it. It was this way before, but you probably did not notice because of all the discount items grouped at the very top.

Do you need our would you like to see that bit of coding allowing the 2 layouts?

The echo $qdt . '<br />'; bit of coding has been added and populated the discounts at the top as before.

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

27 Nov 2012, 10:36 PM
#183
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

At least I can see that the $qdt code in tpl_modules_products_quantity_discounts_list.php is all working correctly. That means that the issue has to be in how the result is being processed in product_listing.php. Can you post the whole case section where you added the quantity code? Use PHP code tags (icon on the right above textbox) to make it more legible.

27 Nov 2012, 11:02 PM
#184
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

I created a test account so I could see pricing in the discount tables, and see that they don't work correctly when prices display. For some reason, php if ($zc_hidden_discounts_on) { $qdt .= ' <table border="1" cellspacing="2" cellpadding="2"> <tr> <td colspan="1" align="center"> ' . TEXT_HEADER_DISCOUNTS_OFF . ' works perfectly to start the table, but the same opening code ```php
} else {
$qdt .= ' <table border="1" cellspacing="2" cellpadding="2">
<tr>
<td colspan="' . $columnCount+1 . '" align="center">
';
switch ($products_discount_type) {
case '1':
$qdt .= TEXT_HEADER_DISCOUNT_PRICES_PERCENTAGE;

' <table border="1" cellspacing="2" cellpadding="2">
<tr>
<td colspan="'
when outputting prices. Try changing this linephp
<td colspan="' . $columnCount+1 . '" align="center">
to this php
<td colspan="' . ($columnCount+1) . '" align="center">

27 Nov 2012, 11:07 PM
#185
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

(When I think about it, it is obvious that the original code was adding all of the initial string (with integer value 0) to 1 and getting 1 as an arithmetic result, then continuing with the string accumulation onto '1'.)

27 Nov 2012, 11:13 PM
#186
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

By the way, your alternate category layout code is not working quite right. It is still handling the grid output as if it were rows content. You need to add some code to tpl_modules_product_listing.php to switch the processing there as well as in product_listing.php.

28 Nov 2012, 2:41 PM
#187
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

gjh42:

At least I can see that the $qdt code in tpl_modules_products_quantity_discounts_list.php is all working correctly. That means that the issue has to be in how the result is being processed in product_listing.php. Can you post the whole case section where you added the quantity code? Use PHP code tags (icon on the right above textbox) to make it more legible.

        case 'PRODUCT_LIST_PRICE':
        $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
        $lc_align = 'right';
        $lc_text =   $lc_price;
//        $lc_text =   ' MSRP ' . $lc_price;
//TM trying ajeh code

//      $lc_align = 'right';
	$lc_price = $products_discount_type = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type');  
    if ($products_discount_type != 0) {
	  $rows++;
      $products_id_current = (int)$listing->fields['products_id'];
      $quantityDiscounts = array();
      $products_discount_type_from = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type_from');
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCTS_QUANTITY_DISCOUNTS));
require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts_list.php'); ///tpl_modules_products_quantity_discounts_list.php contrib by gjh42 20121127
echo $qdt . '<br />';
$lc_price = $qdt;//gjh42 20121127
}
else
{ $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';

$lc_align = 'right';
$lc_text = $lc_price;}

//ending ajeh code  

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

28 Nov 2012, 2:56 PM
#188
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

gjh42:

<td colspan="' . ($columnCount+1) . '" align="center"> ```

I made this change on line 34 and 75 in the tpl_products_quantity_discounts_list.php

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

28 Nov 2012, 3:28 PM
#189
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

gjh42:

By the way, your alternate category layout code is not working quite right. It is still handling the grid output as if it were rows content. You need to add some code to tpl_modules_product_listing.php to switch the processing there as well as in product_listing.php.

Thank you for catching this. It seems as though I had the override version in the wrong location so it was still using the default file. I have moved it to the correct folder but evidently there is something wrong b/c I have 0 results.

I'm going to try and find the original post on this and see where I goofed. Probably missing syntax.

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

28 Nov 2012, 5:55 PM
#190
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

idc1:

Thank you for catching this. It seems as though I had the override version in the wrong location so it was still using the default file. I have moved it to the correct folder but evidently there is something wrong b/c I have 0 results.

I'm going to try and find the original post on this and see where I goofed. Probably missing syntax.

I have the correct file in the correct override location now and am getting NO error logs in my cache folder. I still have the layout issue though.

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

28 Nov 2012, 6:19 PM
#191
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

Looking at the Bolts listing, the entire <td> for the price is missing when discounts are processed. I need to investigate further how this could happen. I forgot the "username" I made when creating the test account, so even though I can login, I can't fill out the popup for access to see the prices. That username is not visible in the "My Account" page. Can you tell me what it is so I don't have to make a second dummy account?

Are the quantity discount tables showing correctly now when the prices can be seen? The () fix should have fixed those tables, and I was hoping that having complete HTML would make the product display work... apparently not, though.

What happens if you change the debug from

echo $qdt . '<br />';

to

$lc_price = $qdt;//gjh42 20121127
echo $lc_price . '<br />';

I will want to see the results from more echo locations until one shows up as not having content.

28 Nov 2012, 6:58 PM
#192
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

gjh42:

I forgot the "username" I made when creating the test account, so even though I can login, I can't fill out the popup for access to see the prices. That username is not visible in the "My Account" page. Can you tell me what it is so I don't have to make a second dummy account?

[email protected]

gjh42:

Are the quantity discount tables showing correctly now when the prices can be seen? The () fix should have fixed those tables, and I was hoping that having complete HTML would make the product display work... apparently not, though.

Not really. The tables appear to be created and populated correctly but they are not shown attached to the item.

gjh42:

What happens if you change the debug from

echo $qdt . '<br />';

to

$lc_price = $qdt;//gjh42 20121127
echo $lc_price . '<br />';
Done. I see no change.

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

28 Nov 2012, 8:52 PM
#193
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

The only other thing I can think of is that the string with visual HTML formatting (carriage returns) is blowing up when handled as array values. For a test, replace the

$lc_price = $qdt;//gjh42 20121127
echo $lc_price . '<br />';

with this:```php
$qdt = '<table>

<tr> <td>format testing</td> </tr> </table>'; $lc_price = $qdt;//gjh42 20121127 echo $lc_price . '<br />'; ``` and if the test tables show up at the top, switch to this:```php $qdt = '<table>' . "\n" . ' <tr>' . "\n" . ' <td>format testing</td>' . "\n" . ' </tr>' . "\n" . '</table>'; $lc_price = $qdt;//gjh42 20121127 echo $lc_price . '<br />'; ``` If that is the issue, the price display will come back (with the dummy tables as content).
28 Nov 2012, 9:06 PM
#195
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

gjh42:

I see the "format testing" tables are displaying as expected.

Yes I get the same results with both pieces of code

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

28 Nov 2012, 9:12 PM
#196
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

There is nothing in the tpl_columnar_display.php or the tpl_tabular_display.php that would cause this from what I can tell...correct? All this is way over my head. Is seeing "format testing" a good sign or an uh oh sign?

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

28 Nov 2012, 10:07 PM
#197
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

The "format testing" is inside a correct table structure (without borders), so it is working as it should.
If it gives the same result with both styles of string building, there must be something seemingly unrelated that is blowing up. The dummy table content is almost as simple as you can get for information going into the array, so if neither version displays in the product, there must be something about the mere fact of its existence that is breaking something.

I may have found the problem. The transplanted code contains this line
$rows++;
which will increment the current row in the middle of a product. This is not good. It may cause the current $lc_text content to be orphaned with nowhere to be put.
How about going back to this, with that line commented out:

//TM trying ajeh code

//      $lc_align = 'right';
    $lc_price = $products_discount_type = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type');  
    if ($products_discount_type != 0) {
      //$rows++;
      $products_id_current = (int)$listing->fields['products_id'];
      $quantityDiscounts = array();
      $products_discount_type_from = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type_from');
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCTS_QUANTITY_DISCOUNTS));
require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts_list.php'); ///tpl_modules_products_quantity_discounts_list.php contrib by gjh42 20121127
echo $qdt . '<br />';
$lc_price = $qdt;//gjh42 20121127
}
else
{ $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';

$lc_align = 'right';
$lc_text = $lc_price;}

//ending ajeh code  
29 Nov 2012, 2:20 PM
#198
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

Progress!!!! :clap:

That seemed to have fix the product listing issue where items were missing on the grid layout and where pricing wasn't shown for the row layout.

So now it's just the fact that the discount table isn't shown with the corresponding item.

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

29 Nov 2012, 2:32 PM
#199
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: styling product listing pages with column layout grid

Great! I wasn't certain exactly how that $rows++ would mess things up, but I believed it would. So did you go all the way back to your original code, or is the _list file still in, and the $lc_price = $qdt;?

29 Nov 2012, 2:40 PM
#200
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: styling product listing pages with column layout grid

gjh42:

Great! I wasn't certain exactly how that $rows++ would mess things up, but I believed it would. So did you go all the way back to your original code, or is the _list file still in, and the $lc_price = $qdt;?

The _list file and $lc_price=$qdt;? is still in.....I will try the orig file real quick while commenting out the $rows++ to see what happens and report back.

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3