Jump to content

image category in product page


Guest diazangulo

Recommended Posts

Guest diazangulo

im really desesperate and a little angy, i been working a couple weeks trying to add the current image category in product page , but i didnt have any luck .

In the last week i analized the viewCat.inc.php and viewCat.tpl , how is works, and then i add the next code in viewProd.tpl and viewProd.inc.php

In viewProd.inc.php i added the next code arround line 84:

$view_prod->assign("CURRENT_DIR",getCatDir($prodArray[0]['cat_name'],$prodArray[0]['cat_father_id'], $prodArray[0]['cat_id'],$link=TRUE));

// here begin the image cat

if(isset($_GET['page'])){

$page = treatGet($_GET['page']);

} else {

$page = 0;

}

if(isset($_GET['catId'])) {

$_GET['catId'] = treatGet($_GET['catId']);

// build query

$query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY cat_name ASC";

// get category array in foreign innit

$resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."'");

// query database

$currentCat = "";

$currentCat = $db->select($query);

}

if(!empty($currentCat[0]['cat_image'])) {

$view_prod->assign("IMG_CURRENT_CATEGORY","images/uploads/".$currentCat[0]['cat_image']);

$view_prod->parse("view_prod.cat_img");

}

// here end the image cat

in the viewProd.tpl i added the next lines:

<!-- BEGIN: cat_img -->

<img src="{IMG_CURRENT_CATEGORY}" border="0" />

<img src="{IMG_CATEGORY}" border="0" />

<!-- END: cat_img -->

i really need some help to do that to procedure add the category product in product page too asap, please is somebody know where i have the mistake , please give me some lessons.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...