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 02-14-2011 18:31:27

jensme
Member
Registered: 04-29-2010
Posts: 392

Change the root folder for ProdSM so Product List Display pulles from

... ProdLG?

I changed the code for System Dashboard > Store > Store Displays > Product List Displays to the following:

Code:

<?php 

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

$eol      = $this->globals('core.eol');
$proddisp = $this->globals('ecom.prod_proddisp');

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

$proddesc  = $proddisp['descshort'];
$desc_has_tags = $this->has_tags($prodshort);
$prodlink  = $this->link_namespace('ecom','prodshow',$proddisp['id']);

$prodtype = $this->xhtml_encode($proddisp['prodtype']);
$prodnum = $this->xhtml_encode($proddisp['prodnum']);

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

$prodname  = $this->xhtml_encode($proddisp['name']);
$prodlink  = $this->link_namespace('ecom','prodshow',$proddisp['id']);

// +--
// | Create the image tag.
// +--

$imgname  = $proddisp['imglg'];
if (empty($imgname)) {$imgname = 'none.png';}

$imgwidth = $this->globals('core_settings.ecom.imgsizeprodsm');
$imgurl   = 'media/ecom/prodlg/' . $imgname;

$imgtag   = '<img src="' . $imgurl . '" width="210" alt="' . $prodname . '">';

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

?>

<div id="blockit" style="width: 210px; padding: 10px">

   <div style="text-align: left; font-weight: normal;">

      <a href="<?php print $prodlink; ?>"><?php print $imgtag; ?></a><br/><br/>

      <span style="font-size: 10px; color: #333333;"><?php print $prodtype; ?></span><br/>

      <a href="<?php print $prodlink; ?>" style="font-weight: normal;"><?php print $prodname; ?></a>
         </div>

</div>

Is there something more I have to do?

Offline

 

#2 02-15-2011 09:33:41

KryptoJim
Member
Registered: 07-08-2010
Posts: 455

Re: Change the root folder for ProdSM so Product List Display pulles from

Looks like you've got it.  Are you seeing it wrong?

Offline

 

#3 02-15-2011 10:12:04

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Change the root folder for ProdSM so Product List Display pulles from

Hm.  I guess the problem is actually that I have a list of products in ProdLG instead of just a single one - so the system gets confuzzled.  Is there a way to tell it to grab just the first one?

Offline

 

#4 02-15-2011 10:42:52

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Change the root folder for ProdSM so Product List Display pulles from

If you have more than one name in the large image field the value returned from this statement $imgname  = $proddisp['imglg']; will be a comma delimited list of the names. You'll need to explode $imgname on the comma and pick off the first entry of the resulting array to get just a single name which should allow the rest of the code to work.

Offline

 

#5 02-15-2011 10:44:49

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Change the root folder for ProdSM so Product List Display pulles from

That sounds painful. 

Thanks!

Offline

 

#6 02-15-2011 11:08:15

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Change the root folder for ProdSM so Product List Display pulles from

It isn't at all. Just 2 additional statements is all that is needed.

Offline

 

Board footer