Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / category point to an Ez-page?

category point to an Ez-page?

Started by gmartakis on 6 Mar 2012, 8:48 AM · Views: 614

Results 1 to 5 of 5
6 Mar 2012, 8:48 AM
#1
gmartakis avatar

gmartakis

New Zenner

Join Date:
Feb 2011
Posts:
73
Plugin Contributions:
0

category point to an Ez-page?

Hi everyone,
I just have a question for you, I have just implemented a site with zen cart https://www.pelagosmarine.gr. I have just embeded the categories inside the first page with their images and their descriptions from a file which is located into modules folder category_row.php. Now I'am trying to change the target link of the 3th category to point to an ez-page.
just read the code below

while (!$categories->EOF) {
if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif';
$categories_description = zen_get_category_description($categories->fields['categories_id'], $_SESSION['languages_id']);

$cPath_new = zen_get_path($categories->fields['categories_id']);


// strip out 0_ from top level cats
$cPath_new = str_replace('=0_', '=', $cPath_new);

//    $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);

?>

<div id="categorylist"> <div class="dosomething"> <?php $description = substr($categories_description, 0, 150); //echo strlen($description); //if($language_id == 1){ if(strlen($categories_description) < 150) { if($cPath_new == 3) { $list_box_contents[$row][$col] = array('params' => '"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<br><a href="http://www.pelagosmarine.gr/index.php?main_page=page&id=42">' . '<span>' . $categories->fields['categories_name'] . '</span></a><br><br>'. zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br /><br><div class="moreinfo">' . $description. '</div><br>'); } $list_box_contents[$row][$col] = array('params' => '"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<br><a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . '<span>' . $categories->fields['categories_name'] . '</span><br><br>'. zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br /></a><br><div class="moreinfo">' . $description. '</div><br>'); $col ++; if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) { $col = 0; $row ++; } $categories->MoveNext(); I know for sure that the variable for the category is $cPath_new and the category_id is 3. But I cannot get it right for some reason... what I'm missing here? Could you please advice me?:smile:
6 Mar 2012, 12:16 PM
#2
gmartakis avatar

gmartakis

New Zenner

Join Date:
Feb 2011
Posts:
73
Plugin Contributions:
0

Re: category point to an Ez-page?

Any help would be apreciated!!:smile:

6 Mar 2012, 12:28 PM
#4
gmartakis avatar

gmartakis

New Zenner

Join Date:
Feb 2011
Posts:
73
Plugin Contributions:
0

Re: category point to an Ez-page?

Because the customer wants to have briefings on the first page and I dont know how I could embed some of the ezpages into the first page to look like briefings. I told him that he could actually have this category as a regular ezpage but it doesn't listen to me :smile:

6 Mar 2012, 3:43 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: category point to an Ez-page?

You are using the right variable for your test, but it does not contain just the cPath number(s). As indicated by this line

$cPath_new = str_replace('=0_', '=', $cPath_new);

'=0_' is being replaced by '=', and the whole content is like 'cPath=3' for your case.
Your test should be

if($cPath_new == 'cPath=3')