Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 08-08-2007 17:03:35

rvr84
Member
Registered: 05-13-2006
Posts: 80

Product Detail Display

Hi,

I have used the old version 5.1 of CCP and have now started to work with V6.  I am also new to php so would like a bit of advise on editing the layout please.

I would like to edit the product detail display so that the quantity and add to cart/wish list buttons are alongside the image.  I just cant figure out how to move this section up.

You can view how it currently is at: http://www.essentialart.co.uk/art/index … ref=BLOCK2

Any help would be appreciated.

Thanks,
Becky.

Offline

 

#2 08-09-2007 05:22:56

kidsandco
Member
Registered: 02-12-2005
Posts: 264
Website

Re: Product Detail Display

Hi,

To edit product displays and similar you can use an editor like macromedia dreamweaver, which makes it alot easier to make changes if you dont know much about php.

In this case the following code for the product detail display should do the job, and its not really a major change, but i see where you're coming from becuase the php for a beginner can be totally confusing:


Code:

<?php 

// +--
// | Get variables we need to draw this display.
// +--

$app      = $this->globals('khxc.app');
$ns       = $this->globals('khxc.namespace');
$eol      = $this->globals('khxc.eol');
$proddisp = $this->globals('ecom.prod_proddetail');
$xid      = $proddisp['id'];
$id       = $this->xhtml_encode($xid);

if ($ns == 'addcart') {$ns = 'prodshow';}

$this->globals('ecom.prod_proddisp',$proddisp);
$this->globals('ecom.prod_priceinfo',$proddisp['khxc.priceinfo']);

// +--
// | Create the product name and description.
// +--

$prodname  = $this->xhtml_encode($proddisp['name']);
$proddesc  = $proddisp['desclong'];
$hastags   = $proddisp['deschastags'];

if (empty($proddesc)) {

     $proddesc = $proddisp['descshort'];
     $hastags  = 0;

} // End of if statement.

if (empty($hastags)) {$proddesc = '<p>' . $this->xhtml_encode($proddesc) . '</p>';}

// +--
// | Create the image tag(s).
// +--

$imglist  = $proddisp['imglg'];

if (empty($imglist)) {$imglist = 'none.png';}

$imglist  = $this->make_list($imglist);
$imgwidth = $this->globals('khxc_settings.' . $app . '.imgsizeprodlg');
$imgtag   = '';

if (empty($imgwidth)) {$imgwidth = 200;}

foreach ($imglist as $num => $img) {

     $imgurl   = 'media/' . $app . '/prodlg/' . $img;

     $imgtag   .= '<img src="' . $imgurl . '" ';
     if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';}
     $imgtag  .= 'alt="' . $prodname . '" />';

} // End of foreach statement.

// +--
// | Handle extra large image.
// +--

$showxl  = 0;

$imglist = $proddisp['imgxl'];

if (empty($imglist)) {$imglist = 'none.png';}

if (($imglist) && ($imglist != 'none.png') && ($ns == 'prodshow')) {

     $this->globals('khxc.load_lightbox',1);

     $showxl   = 1;
     $xlcount  = 0;
     $xlimgtag = '';
     $zlcount  = count($imglist);

     $imglist  = $this->make_list($imglist);

     if (count($imglist) == 1) {$text = 'View Larger Image';}
     else                      {$text = 'View Larger Image Slideshow';}

     foreach ($imglist as $num => $img) {

          $xlcount++;

          $xlurl  = $this->globals('khxc.url_nonssl');
          $xlurl .= '/media/' . $app . '/prodxl/' . $img;

          if ($xlcount == 1) {

               $xlimgtag .= '<p><a href="' . $xlurl . '" rel="lightbox[prodgroup]" title="';
               $xlimgtag .= $prodname . '" class="khxc_hrefbutton">' . $text . '</a></p>';

          } else {

               $xlimgtag .= '<p class="hidden"><a href="' . $xlurl . '" rel="lightbox[prodgroup]" title="';
               $xlimgtag .= $prodname . '" class="khxc_hrefbutton">' . $text . '</a></p>';

          } // End of if statement.

     } // End of foreach statement.

} // End of if statement.

// +--
// | Print the display.
// +--

?>

<table id="proddetail--<?php print $id; ?>" class="khxc_cptbl_det">

<tr class="khxc_cptbl_det"><td class="khxc_cptbl_det">

<table class="khxc_ghost"><tr><td class="khxc_ghost" style="width: <?php print $imgwidth; ?>px">

<?php print $imgtag; ?>

<?php 

// +--
// | Handle the extra large image tag and email a friend link.
// +--

$emailfr = $this->globals('khxc_settings.' . $app . '.emailfriend');

if ($ns != 'prodshow') {$emailfr = 0;}

if (($showxl) || ($emailfr)) {

     print '<div style="width:' . $imgwidth . 'px">' . $eol;

     if ($showxl) {print $xlimgtag;}

     if ($emailfr) {

          $link_emailf = $this->link_namespace($app,'emailfriend',array('ref' => $proddisp['id']));

          print '<p><a href="' . $link_emailf . '" title="Email a Friend" ';
          print 'class="khxc_hrefbutton">Email This Item to a Friend</a></p>';

     } // End of if statement.

     print '</div>' . $eol;

} // End of if statement.

?>

</td><td class="khxc_ghost">

<p><strong><?php print $prodname; ?></strong></p>

<?php print $proddesc; ?>

<?php $this->include_file($app,'pricedisp.php'); ?>

<p>
  <?php 

// +--
// | Print the product options if we can add the item to the 
// | shopping cart or wish list and we're on the prodshow
// | namespace.
// +--

$add_ok = 1;

if (($proddisp['useinv']) && (!($proddisp['invlevel'] > 0))) {$add_ok = 0;}
if ($proddisp['pricestatus'] == 'D') {$add_ok = 0;}

if (($ns == 'prodshow') && ($add_ok)) {

     $this->include_namespace($app,'prodshowopt',array());

} // End of if statement.

?>
</p></td></tr>

</table>

</td></tr></table>

Try comparing the original code with this one, you may see where the change was. If you want it explaining then be sure to ask smile


K.R.
Kids & Co. Wholesale

Offline

 

#3 08-09-2007 16:35:53

rvr84
Member
Registered: 05-13-2006
Posts: 80

Re: Product Detail Display

Thanks,

I'm not sure if i explained myself very well though.

I would like to include the quantity field and add to basket button in the product detail display, instead of underneath it. 

I'm not sure which files produce these elements and calls them.  If i knew this then maybe i could add a php include into the product detail display so that they are called within the display, instead of underneath the image and description.

I think that's more clear :-)

Offline

 

#4 08-13-2007 05:04:20

kidsandco
Member
Registered: 02-12-2005
Posts: 264
Website

Re: Product Detail Display

When you say "in the product details display", you mean with the description of the product etc.

The code i posted does actually place the quantity and add to cart button to the right of the image under the description, rather than underneath

Maybe you read my explanation without trying the code?

I have tested it and i think it works as you are describing


K.R.
Kids & Co. Wholesale

Offline

 

#5 08-15-2007 09:41:38

ttrove
Member
Registered: 08-15-2007
Posts: 18

Re: Product Detail Display

I am wishing to do the same thing but am not familar with the PHP. Where is this code located?

Thanks
Ted

Offline

 

#6 08-18-2007 12:26:15

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Product Detail Display

This code is located here:

Home > ClickCartPro > Displays: Skins, Menus, XHTML Includes and Messages > Manage Catalog Product Displays: Detail View


Nick Hendler

Offline

 

#7 01-12-2008 21:30:48

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: Product Detail Display

I'm trying to figure out where "Item Options" (the title of the section) is found so I can change it to 'Gift Options'.  in detail view, it CALLS the namespace 'prodshowopt', and I checked the routine in CCP_Prod but there's no reference to the title and where to change it.  Anyone have any idea?

James...

Offline

 

#8 01-12-2008 21:58:08

slydog
Member
Registered: 05-21-2006
Posts: 694

Re: Product Detail Display

Location: Home > ClickCartPro > Settings: Application Settings Menu > Language Strings

Offline

 

#9 01-12-2008 22:03:15

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: Product Detail Display

damn, it was SO OBVIOUS, how did i not figure THAT out.

<i should have checked the MANUAL :>

Thanks Slydog!

Offline

 

Board footer