Forums / Templates, Stylesheets, Page Layout / Product description on main page

Product description on main page

Views: 910

Results 1 to 9 of 9
2 Jun 2016, 5:45 AM
#1
vvomble avatar

vvomble

Zen Follower

Join Date:
Feb 2013
Posts:
111
Plugin Contributions:
1

Product description on main page

Hi guys,

I'm wondering if it's possible to add the products description to the main page or a cut down version to 300 characters maybe as a featured listing.

I'm assuming it would require /includes/modules/featured_products.php being added to the overrides folder and then being edited I'm just not 100% sure how or where I would edit the file to do that.

2 Jun 2016, 10:14 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product description on main page

If understand the request correctly, I thought the plugin SNAF offered that capability of showing the specials, new, and featured product similar to how product listings are displayed. Haven't chased down the code for this answer, but it may also involve files in includes/templates/YOUR_TEMPLATE/templates

such as tpl_modules_featured.php, or tpl_featured.php or similarly named.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Jun 2016, 12:34 PM
#3
vvomble avatar

vvomble

Zen Follower

Join Date:
Feb 2013
Posts:
111
Plugin Contributions:
1

Re: Product description on main page

I've read up I don't think that does cover it.

Basically I want it to appear with a description like this

Small Dog Full Groom
Small Dog Full Groom Here at The Temple of Groom we offer Small Dog Grooming located in Seaton Delaval. Seaton Delaval is only a few short...
Contact Us

as seen here

http://thetempleofgroom.uk/index.php?main_page=index&cPath=1

But on the front page

http://thetempleofgroom.uk/

2 Jun 2016, 12:47 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product description on main page

To try to be sure it is understood, you aren't wanting category 1 to be displayed as the main page, but want your new product group, specials product group, etc. To have more information about each product. The solution to both of those is different as they are different issues. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Jun 2016, 1:03 PM
#5
vvomble avatar

vvomble

Zen Follower

Join Date:
Feb 2013
Posts:
111
Plugin Contributions:
1

Re: Product description on main page

yes but just the specials the new products will be removed from the front page

2 Jun 2016, 1:12 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product description on main page

If it is to "just" add the "abbreviated" description, you were spot on with the file to be modified:
Includes/modules/YOUR_TEMPLATE/specials_index.php

Once you have that file copied from the modules directory. You will want to find this set of code:

$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . (int)$specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . $specials_index->fields['products_id']) . '">' . $specials_index->fields['products_name'] . '</a><br />' . $products_price);

Somewhere in that stream of the 'text' part (second line) you will want to put the reference to the description using the function that truncates such text. (sorry haven't gone to find that "command" yet, but plan to do so unless you or someone else finds/found it sooner.)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Jun 2016, 1:20 PM
#7
vvomble avatar

vvomble

Zen Follower

Join Date:
Feb 2013
Posts:
111
Plugin Contributions:
1

Re: Product description on main page

If you could find it I'd be forever grateful PHP still scares me a bit hahaha

2 Jun 2016, 1:59 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product description on main page

From the product_listing.php file in the same directory, there is:

zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($specials_index->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)

The above code has been modified to support the $specials_index variable. The length of text is controlled by the constant PRODUCT_LIST_DESCRIPTION. I was going to try to use a specials equivalent, but there is not one by default in ZC which would require a sql command to install.

So that code would have to be put in line with the 'text'=> line and possibly bounded by css applicable code or at least an ending ```
<br />

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Jun 2016, 2:40 PM
#9
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Product description on main page

vvomble:

I've read up I don't think that does cover it.

Basically I want it to appear with a description like this

Small Dog Full Groom
Small Dog Full Groom Here at The Temple of Groom we offer Small Dog Grooming located in Seaton Delaval. Seaton Delaval is only a few short...
Contact Us

as seen here

http://thetempleofgroom.uk/index.php?main_page=index&cPath=1

But on the front page

http://thetempleofgroom.uk/

Flexible NSF (New, Specials & Featured) Center-boxes