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
Hi how do I move the add to basket so it is next to the product pic and people dont need to scroll down? Iam sorry if this has been posted before, i have had a look around the forum tho? thanks
Offline
Hi,
Does anyone have any ideas on this?
my current scrpit is:
<?php
// +--
// | Get variables we need to draw this display.
// +--
$ns = $this->globals('core.namespace');
$eol = $this->globals('core.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['core.priceinfo']);
// +--
// | Create the product name and description.
// +--
$prodname = $this->xhtml_encode($proddisp['name']);
$proddesc = $proddisp['desclong'];
$desc_has_tags = $this->has_tags($proddesc);
if (empty($proddesc)) {
$proddesc = $proddisp['descshort'];
$desc_has_tags = 0;
} // End of if statement.
if (empty($desc_has_tags)) {$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('core_settings.ecom.imgsizeprodlg');
$imgtag = '';
if (empty($imgwidth)) {$imgwidth = 200;}
foreach ($imglist as $num => $img) {
$imgurl = 'media/ecom/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('core.load_slimbox',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('core.url_nonssl');
$xlurl .= '/media/ecom/prodxl/' . $img;
if ($xlcount == 1) {
$xlimgtag .= '<p><a href="' . $xlurl . '" rel="slimbox[prodgroup]" title="';
$xlimgtag .= $prodname . '" class="hrefbutton">' . $text . '</a></p>';
} else {
$xlimgtag .= '<p class="hidden"><a href="' . $xlurl . '" rel="slimbox[prodgroup]" title="';
$xlimgtag .= $prodname . '" class="hrefbutton">' . $text . '</a></p>';
} // End of if statement.
} // End of foreach statement.
} // End of if statement.
// +--
// | Print the display.
// +--
?>
<div style="width: <?php print $imgwidth; ?>px; float: left; margin: 0px 10px 0px 10px;">
<?php print $imgtag; ?>
<?php
// +--
// | Handle the extra large image tag and email a friend link.
// +--
$emailfr = $this->globals('core_settings.ecom.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('ecom','emailfriend',array('ref' => $proddisp['id']));
print '<p><a href="' . $link_emailf . '" title="Email a Friend" ';
print 'class="hrefbutton">Drop a hint! Email This to a Friend</a></p>';
} // End of if statement.
print '</div>' . $eol;
} // End of if statement.
?>
</div>
<p><strong><?php print $prodname; ?></strong></p>
<?php print $proddesc; ?>
<?php $this->include_file('ecom','pricedisp.php'); ?>
<?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('ecom','prodshowopt',array());
} // End of if statement.
if (($ns == 'prodshow') && ($add_ok)) {
$this->globals('xmodshipestimator_prodid',$xid);
$this->include_namespace('ecom','xmodshipestimator');
} // End of if statement.
?>
I copied this off another post on here as my product descriptions look better underneath the pic but I would like to to the add to cart to the top next to my product picture
thanks!
Offline
Hi,
is this what you want?
http://www.oybcycles.com/prodshow/Chunk … igh_2.html
Nigel
Offline
I posted something on this for CCP 6.0, - it should not be too difficult to modify it for CCP 7.0, as much of the codebase is the same.
The link is: https://forum.kryptronic.com/viewtopic. … 37#p131737
Last edited by Design_Wholesale (01-10-2011 20:23:49)
Offline
Nigel
I would like to know how you did that
Thanks
Offline
I am using the XCS version of CCP so you would need to mess around with the code but it should give you a few guidelines. The product description to the right of the image is "$proddesc = $proddisp['desclong'];" and the description below is "$proddescext = $proddisp['descext'];" so you would need to add a new "columndef" called "descext" if you wanted the extended product description. I also created a new price display called "pricedisp2".
Let me know if you need any help with this, but please bear in mind that I am not a qualified "coder".
Nigel
<?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);
$usethumb = $this->globals('khxc_settings.' . $app . '.imguseprodthumb');
$imgwidthth = $this->globals('khxc_settings.' . $app . '.imgsizeprodlgth');
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']);
$proddue = $proddisp['due'];
$proddesc = $proddisp['desclong'];
$proddescext = $proddisp['descext'];
$desc_has_tags = $this->has_tags($proddesc);
if (empty($proddesc)) {
$proddesc = $proddisp['descshort'];
$desc_has_tags = 0;
} // End of if statement.
if (empty($desc_has_tags)) {$proddesc = '<p>' . $this->xhtml_encode($proddesc) . '</p>';}
// +--
// | Create the image tag(s).
// +--
$imglistlg = $proddisp['imglg'];
if (empty($imglistlg)) {$imglist = 'none.png';}
$imglistlg = $this->make_list($imglistlg);
$imgwidth = $this->globals('khxc_settings.' . $app . '.imgsizeprodlg');
$imgtag = '';
if (empty($imgwidth)) {$imgwidth = 200;}
$count = 0;
$multilg = 0;
foreach ($imglistlg as $num => $name) {
if ($count == 0) { $lgimname = $name; }
$count++;
} // End of foreach statement.
if ($count > 1) {
// We have multi large images.
$multilg = 1;
} // End of if statement.
if (($multilg) && ($usethumb)) {
$imgtag .= '<script type="text/javascript">' . $eol;
$imgtag .= '<!--' . $eol;
$imgtag .= 'if(document.images) { // create an array of prodImages' . $eol;
$imgtag .= 'document.prodImages = new Array();' . $eol;
}
foreach ($imglistlg as $num => $img) {
if (($multilg) && ($usethumb)) {
$imgurl = 'media/' . $app . '/prodlg/' . $img;
$imgtag .= 'document.prodImages[' . $num . '] = new Image();' . $eol;
$imgtag .= 'document.prodImages[' . $num . '].src = "' . $imgurl . '";' . $eol;
$imgtag .= 'document.prodImages[' . $num . '].pop = "' . $imgurl . '";' . $eol;
} else {
$imgurl = 'media/' . $app . '/prodlg/' . $img;
$imgtag .= '<img src="' . $imgurl . '" ';
if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';}
$imgtag .= 'alt="' . $prodname . '" />';
} // End of if statement.
} // End of foreach statement.
if (($multilg) && ($usethumb)) {
$imgtag .= '//-->' . $eol;
$imgtag .= '}' . $eol;
$imgtag .= '</script>' . $eol;
$imgurl = 'media/' . $app . '/prodlg/' . $lgimname;
$imgtag .= '<img src="' . $imgurl . '" ';
if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';}
$imgtag .= 'alt="' . $prodname . '" id="prodImage" />';
} // End of if statement.
// +--
// | Handle extra large image.
// +--
$showxl = 0;
$imglistxlg = $proddisp['imgxl'];
if (empty($imglistxlg)) {$imglistxlg = 'none.png';}
if (($imglistxlg) && ($imglistxlg != 'none.png') && ($ns == 'prodshow')) {
$this->globals('khxc.load_lightbox',1);
$showxl = 1;
$xlcount = 0;
$xlimgtag = '';
$zlcount = count($imglistxlg);
$imglistxlg = $this->make_list($imglistxlg);
if (count($imglistxlg) == 1) {$text = 'View Larger Image';}
else {$text = 'View Larger Image Slideshow';}
foreach ($imglistxlg 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.
if (($multilg) && ($usethumb)) {
$imgtag .= '<p>';
foreach ($imglistlg as $num => $name) {
$imgurl = 'media/' . $app . '/prodlg/' . $name;
$imgtag .= '<img src=\'' . $imgurl . '\' onmouseover="var x=document.getElementById(\'prodImage\'); x.src=document.prodImages[' . $num . '].src;" width="' . $imgwidthth . '" alt="' . $prodname . '" />';
} // End of foreach statement.
$imgtag .= '</p>';
} // 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,'pricedisp2.php'); ?>
<?php $this->include_file($app,'rewarddisp.php'); ?>
<?php $this->include_namespace($app,'prodreviewsmallview'); ?>
<?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,'prodshowoptlite',array());
} // End of if statement.
?>
<?php
if (($proddisp['useinv']) && (!($proddisp['invlevel'] > 0))) {
print '<div class="khxc_pricediv"><p class="khxc_outstock">This item is currently out of stock.</p>' . $eol . $eol;
print '<p class="khxc_instock">' . $eol . $eol;
print 'Estimated Arrival Date  ' . $eol . $eol;
$due = $proddisp['due'];
print $due;
print '</p>' . $eol . $eol;
print '</div>' . $eol . $eol;
} // End of if statement.
?>
</td></tr>
</table>
</td></tr></table>
<table id="proddetail--<?php print $id; ?>" class="khxc_cptbl_det">
<tr class="khxc_cptbl_det"><td class="khxc_cptbl_det">
<p><b>Full Description:</b></p>
<?php print $proddescext; ?>
</tr>
</table>
Offline
Thanks Nigel, much appreciated.
I'll play around with it and see how it turns out
Offline
Cheers very much or all this, the Tyre & Inner Tube Set link was great just what i am looking for!
cheers again
Offline
Pages: 1