Forums / General Questions / Add field (short desc.) to All Listing Products

Add field (short desc.) to All Listing Products

Locked

Views: 1,484

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
16 Dec 2007, 9:17 PM
#1
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Add field (short desc.) to All Listing Products

I have Short Desc. mod and I would like to add this field to "Listing All Products" "New Products". I tried to find the appropriate page(s) via Dev. Tool Kit, made changes in few pages (god, I have to keep track of these...), but still I did not find the right place/page since it does not appear on these pages. Could someone please point me to these pages??
Tx

16 Dec 2007, 10:35 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Add field (short desc.) to All Listing Products

/includes/templates/your_template/templates/tpl_modules_products_all_listing.php, /includes/templates/your_template/templates/tpl_modules_products_new_listing.php.

The description is added below the rest of the elements of this listing style, around line 108:
if (PRODUCT_ALL_LIST_DESCRIPTION != '0') {
etc.

and line 192:

<?php if (PRODUCT_ALL_LIST_DESCRIPTION != 0) { ?>

etc.

16 Dec 2007, 11:19 PM
#3
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Re: Add field (short desc.) to All Listing Products

gjh42:

/includes/templates/your_template/templates/tpl_modules_products_all_listing.php, /includes/templates/your_template/templates/tpl_modules_products_new_listing.php.

The description is added below the rest of the elements of this listing style, around line 108:
if (PRODUCT_ALL_LIST_DESCRIPTION != '0') {
etc.

and line 192:

<?php if (PRODUCT_ALL_LIST_DESCRIPTION != 0) { ?>

etc.

Around those line I have:
if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {

but have added the following to around lines 48:

if (PRODUCT_INFO_SHORT_DESC != '0') {
$dislay_products_short_desc = TABLE_HEADING_SHORT_DESC . $products_all->fields['products_short_desc'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_SHORT_DESC, 3, 1));
} else {
$dislay_products_short_desc = '';
}

but is does not do anything....

16 Dec 2007, 11:46 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Add field (short desc.) to All Listing Products

That file works in two parts. The first part creates the content (which it looks like your code is doing), and the second part (starting around line 118) arranges the output into two columns, with the description below both columns.

You will have to decide where you want the short description to go and place an "echo" statement there, like the other elements have.

16 Dec 2007, 11:58 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Add field (short desc.) to All Listing Products

You need to keep the short description echo out of the loop, since it doesn't have a configuration key for that listing, so put it like this if you want it at the bottom of the left or right column:

                  if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
                    echo $display_products_date_added;
                  }
                  $disp_sort_order->MoveNext();
                } //end of while loop
                echo $display_products_short_desc;

Alternatively, you could put it in with another element if you want it grouped that way:```php
if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
echo $display_products_short_desc;
echo $display_products_date_added;
}
$disp_sort_order->MoveNext();
} //end of while loop

17 Dec 2007, 12:10 AM
#6
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Re: Add field (short desc.) to All Listing Products

gjh42:

You need to keep the short description echo out of the loop, since it doesn't have a configuration key for that listing, so put it like this if you want it at the bottom of the left or right column:

              if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
                echo $display_products_date_added;
              }
              $disp_sort_order->MoveNext();
            } //end of while loop
            echo $display_products_short_desc;
> 
> Alternatively, you could put it in with another element if you want it grouped that way:```php
                  if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
                    echo $display_products_short_desc;
                    echo $display_products_date_added;
                  }
                  $disp_sort_order->MoveNext();
                } //end of while loop

Thanks, I will try this..
As I was looking into files of Short Desc., I noticed that in admin/include/modules/products/collect_info.php (part of it bellow) it does not select "pd.products_short_desc" but I don't know if it should be pd.xx or just p.xx

if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
p.products_id, p.products_quantity, p.products_model,

Also this file has
$products_short_description = $_POST['products_short_description'];
I am guessing it should be
$products_short_desc = $_POST['products_short_desc'];
Am I correct?

17 Dec 2007, 12:43 AM
#7
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Re: Add field (short desc.) to All Listing Products

You need to keep the short description echo out of the loop, since it doesn't have a configuration key for that listing, so put it like this if you want it at the bottom of the left or right column:

Well I tried both, no result..

17 Dec 2007, 1:15 AM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Add field (short desc.) to All Listing Products

Do you have the short description working for the product listing? If not, don't try to make it work here until you have it functioning as designed.

The collect_info.php works in admin and has no connection to the store output, except that it has to function in order for there to be a short description.
As far as I know, the mod works correctly as written, and you should not go changing that.

You wrote that you added

...
$dislay_products_short_desc = TABLE_HEADING_SHORT_DESC ...

Is this an exact copy of what is in your file? It is missing the "p" from display, so will not match the echo code as I wrote it:

echo $display_products_short_desc;

17 Dec 2007, 2:34 AM
#9
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Re: Add field (short desc.) to All Listing Products

gjh42:

Do you have the short description working for the product listing? If not, don't try to make it work here until you have it functioning as designed.

The collect_info.php works in admin and has no connection to the store output, except that it has to function in order for there to be a short description.
As far as I know, the mod works correctly as written, and you should not go changing that.

You wrote that you added

...
$dislay_products_short_desc = TABLE_HEADING_SHORT_DESC ...

Is this an exact copy of what is in your file? It is missing the "p" from display, so will not match the echo code as I wrote it:

echo $display_products_short_desc;

Thank you for your help; I have it working in the product listing and category listing. I guess that will have to do.
And yes, I had a typo you mentioned, thanks. However, even after I corrected that, I still did not get it to display in new or all listings.:frusty:

17 Dec 2007, 3:18 AM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: Add field (short desc.) to All Listing Products

I haven't looked at the short description mod, so this is just speculation, but if you have the short desc stored in a new db field, the all products page would need to retrieve it when it gets the rest of the product information.
If it doesn't do that, there is no content for $display_products_short_desc to hold or output.