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 01-06-2011 08:17:17

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

move add to basket and wish list to next to product pic

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


It's what's inside that counts...

Offline

 

#2 01-10-2011 10:13:46

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

Re: move add to basket and wish list to next to product pic

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 smile

thanks!


It's what's inside that counts...

Offline

 

#3 01-10-2011 11:51:19

nigel
Member
From: Peterborough, UK
Registered: 04-27-2008
Posts: 418
Website

Re: move add to basket and wish list to next to product pic

Offline

 

#4 01-10-2011 19:41:18

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: move add to basket and wish list to next to product pic

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

 

#5 08-13-2011 10:23:33

jojo
Member
Registered: 05-02-2011
Posts: 25

Re: move add to basket and wish list to next to product pic

Nigel

I would like to know how you did that

Thanks

Offline

 

#6 08-15-2011 07:53:55

nigel
Member
From: Peterborough, UK
Registered: 04-27-2008
Posts: 418
Website

Re: move add to basket and wish list to next to product pic

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&nbsp;&nbsp;&nbsp' . $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

 

#7 08-15-2011 07:55:45

jojo
Member
Registered: 05-02-2011
Posts: 25

Re: move add to basket and wish list to next to product pic

Thanks Nigel, much appreciated.

I'll play around with it and see how it turns out

Offline

 

#8 08-17-2011 14:03:40

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

Re: move add to basket and wish list to next to product pic

Cheers very much or all this, the Tyre & Inner Tube Set link was great just what i am looking for!

cheers again


It's what's inside that counts...

Offline

 

Board footer