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.
Pages: 1
... ProdLG?
I changed the code for System Dashboard > Store > Store Displays > Product List Displays to the following:
<?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
Looks like you've got it. Are you seeing it wrong?
Offline
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
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
That sounds painful.
Thanks!
Offline
It isn't at all. Just 2 additional statements is all that is needed.
Offline
Pages: 1