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-22-2007 08:22:48

bill99
Member
Registered: 01-22-2007
Posts: 130

where can I modify the add to cart / wish list form?

Hi All

I'm sure I saw it somewhere on the forum but I just can't find it now. It doesn't appear to be an XHTML include or maybe I'm just missing it.

So, can anyone tell me where I go to edit the "add to you shopping cart or wish list" ( and also the two buttons that accompany this form).

I basically want to replace the table and seperate buttons design that is currently used with a single line similar to:

Qty: [  1] - add to cart image button | add to wish list image button

Thanks,

Bill

Offline

 

#2 02-22-2007 12:48:33

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: where can I modify the add to cart / wish list form?

The shopping cart display is in the front end management in "Displays: Skins, Menus, XHTML Includes and Messages > Manage XHTML Includes>Shopping Cart/Wish List Display.

John

Offline

 

#3 02-22-2007 12:56:53

bill99
Member
Registered: 01-22-2007
Posts: 130

Re: where can I modify the add to cart / wish list form?

Thanks for the reply Jon. What I'm looking for though isn't the actual shopping cart though.

I want to modify the section of the product detail display where the Quantity, add to ccart, add to wish list buttons are displayed. If you happen to know where that can be modified I'd be keen to know!

Best,

Bill

Offline

 

#4 02-22-2007 14:06:40

grcauto
Member
From: Bloomsburg, PA
Registered: 09-11-2006
Posts: 128
Website

Re: where can I modify the add to cart / wish list form?

Use the code below to replace. It's XHTML strict compliant.
To see what it'll look like  and add a product to the cart.

Code:

<?php 

$app      = $this->globals('khxc_display.app');
$eol      = $this->globals('khxc.eol');
$type     = $this->globals('ecom.cart_display');
$cart     = $this->globals('ecom.cart_contents');
$imgwidth = $this->globals('khxc_settings.' . $app . '.imgsizeprodcart');
$imgpath  = $this->globals('khxc.path_public') . '/media/' . $app . '/prodsm/';

$formid  = $this->xhtml_encode($this->globals('khxc_display.quickform_id'));
          $link_shop = $this->link_namespace($app,'splash',array());
          $link_checkout = $this->link_namespace($app,'checkout',array());

$showprodnums = 0;

if ($this->globals('khxc_settings.' . $app . '.dispprodnums')) {
     $showprodnums = 1;
}

if ($type != 'WISHLIST') {$type = 'CART';}

// +--
// | Print the appropriate header.
// +--

if ($type == 'WISHLIST') {

     print '<div class="khxc_storehead">Wish List</div>' . $eol . $eol;

} else {

     print '<div class="khxc_storehead">Shopping Cart</div>' . $eol . $eol;

} // End of if statement.

// +--
// | Figure out if we have any items to display.
// +--

$found = 0;

if (!(empty($cart))) {

     foreach ($cart as $num => $cartdata) {

          if ($cartdata['savetype'] == $type) {$found++;}

     } // End of foreach statement.

} // End of if statement.

// +--
// | Handle where we have no items to display.
// +--

if ((empty($found)) && ($type == 'WISHLIST')) {

     print '<p class="khxc_ultablei">Your wish list is currently empty.  
            A wish list is used to store items that you are interested in, but 
            may not be quite ready to purchase.  You can add items to your wish 
            list anywhere you see an \'Add to Wish List\' button in our online 
            store.</p>' . $eol . $eol;

     print '<p class="khxc_ultablesp">&nbsp;</p>' . $eol . $eol;

} elseif (empty($found)) {

     print '<p class="khxc_ultablei">Your shopping cart is currently empty.  
            If you would like to make a purchase today, add items to your shopping 
            cart.</p>' . $eol . $eol;

     print '<p class="khxc_ultablesp">&nbsp;</p>' . $eol . $eol;

} // End of if statement.

// +--
// | Now handle the real display.
// +--

if (!(empty($found))) {

     // +--
     // | Print the form header.
     // +--

     $formid   = $app . '--' . $type . '--updatecart';
     $typeid   = $app . '--updatecart--type';

     $this->xhtml_quickform_header($formid,$app,'updatecart',array($typeid => $type));

     // +--
     // | Define our names and links.
     // +--

     $delete_name = 'Delete Item';

     if ($type == 'WISHLIST') {

          $update_name = 'Update Wish List';
          $move_name   = 'Move to Cart';
          $move_ns     = 'carttowl';

     } else {

          $update_name = 'Update Shopping Cart';
          $move_name   = 'Move to Wish List';
          $move_ns     = 'wltocart';

     } // End of if statement.

     // +--
     // | Figure out whether we need to display images or recurring  
     // | charges.
     // +--

     $show_recur = 0;
     $show_imgs  = 0;

     foreach ($cart as $num => $cartdata) {

          if ($cartdata['savetype'] == $type) {

               if ((!(empty($cartdata['imgsm']))) && ($cartdata['imgsm'] != 'none.png')) {

                    if (!(file_exists($imgpath . $cartdata['imgsm']))) {

                         $cart[$num]['imgsm'] = 'none.png';

                    } // End of if statement.

               } // End of if statement.

          } // End of if statement.

     } // End of foreach statement.

     foreach ($cart as $num => $cartdata) {

          if ($cartdata['savetype'] == $type) {

               if ($cartdata['subtotalrec'] > 0) {$show_recur = 1;}
               if ((!(empty($cartdata['imgsm']))) && ($cartdata['imgsm'] != 'none.png')) {$show_imgs = 1;}

          } // End of if statement.

     } // End of foreach statement.

     if (!($this->globals('khxc_settings.' . $app . '.cartdispimg'))) {$show_imgs = 0;}

     // +--
     // | Print the table opener and the th tags.
     // +--

     print '<table id="' . $type . '" class="khxc_sorttable">' . $eol;

     print '<tr class="khxc_sorttable">' . $eol;

     if ($show_imgs) {

          print '<th class="khxc_sorttable" style="width: 10%">Image</th>' . $eol;

     } // End of if statement.

     print '<th class="khxc_sorttable">Item</th>' . $eol;

     if ($show_recur) {

          print '<th class="khxc_sorttable" style="width: 10%">Price</th>' . $eol;
          print '<th class="khxc_sorttable" style="width: 10%">Recurring Charge</th>' . $eol;

     } else {

          print '<th class="khxc_sorttable" style="width: 10%">Price</th>' . $eol;

     } // End of if statement.

     print '<th class="khxc_sorttable" style="width: 10%">Quantity</th>' . $eol;
     print '<th class="khxc_sorttable" style="width: 10%">Actions</th>' . $eol;

     print '</tr>' . $eol;

     // +--
     // | Create total vars.
     // +--

     $total_amount    = 0;
     $total_amountrec = 0;

     // +--
     // | Loop through the cart contents and print items.
     // +--

     foreach ($cart as $num => $cartdata) {

          if ($cartdata['savetype'] == $type) {

               // +--
               // | Add the product number to the name if we're supposed to
               // | display it.
               // +--

               if ($showprodnums) {$cartdata['name'] = $cartdata['number'] . ' - ' . $cartdata['name'];}

               // +--
               // | Define prices.
               // +--

               $price = $this->include_namespace($app,'getprice',$cartdata['subtotal']);
               $price = $this->xhtml_encode($price);

               $total_amount = $total_amount + $cartdata['subtotal'];

               if ($show_recur) {

                    $pricerec = $this->include_namespace($app,'getprice',$cartdata['subtotalrec']);
                    $pricerec = $this->xhtml_encode($pricerec);

                    $total_amountrec = $total_amountrec + $cartdata['subtotalrec'];

               } // End of if statement.

               // +--
               // | Define the link URL.
               // +--

               $link = $cartdata['url'];

               if ($link == 'INTERNAL') {

                    $link = $this->link_namespace($app,'prodshow',array('ref' => $cartdata['id']));

               } elseif ($link == 'REMOTE') {

                    $link = '';

               } // End of if statement.

               // +--
               // | Define the images tag.
               // +--

               if ($show_imgs) {

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

                    if ($imgname == 'none.png') {

                          $imgtag = '&nbsp;';

                    } else {

                          $imgurl   = 'media/' . $app . '/prodsm/' . $imgname;

                          $imgtag   = '<img src="' . $imgurl . '" ';
                          if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';}
                          $imgtag  .= 'alt="' . $this->xhtml_encode($cartdata['name']) . '" />';

                    } // End of if statement.

               } // End of if statement.

               // +--
               // | Define the product display variable.
               // +--

               $proddisp = $this->xhtml_encode($cartdata['name']);

               if (!(empty($link))) {

                    $proddisp = '<a href="' . $link . '" title="' . $proddisp . '">' . $proddisp . '</a>';

                    if (!(empty($cartdata['optdisp']))) {

                         $xodisp = '';

                         foreach ($cartdata['optdisp'] as $oname => $ovalue) {

                              if (!(empty($ovalue))) {

                                    $xodisp .= $oname . ': ' . $ovalue . '; ';

                              } // End of if statement.

                         } // End of foreach statement.

                         if (preg_match('/\; $/',$xodisp)) {$xodisp = rtrim($xodisp,'; ');}

                         if (!(empty($xodisp))) {

                              $proddisp .= '<p>';
                              $proddisp .= $this->xhtml_encode($xodisp);
                              $proddisp .= '</p>';

                         } // End of if statement.

                    } // End of if statement.

               } // End of if statement.

               // +--
               // | Print the table cell.
               // +--

               print '<tr class="khxc_sorttable">' . $eol;

               if ($show_imgs) {

                    print '<td class="khxc_sorttable">' . $imgtag . '</td>' . $eol;

               } // End of if statement.

               print '<td class="khxc_sorttable">' . $proddisp . '</td>' . $eol;

               if ($show_recur) {

                    print '<td class="khxc_sorttable">' . $price . '</td>' . $eol;
                    print '<td class="khxc_sorttable">' . $pricerec . '</td>' . $eol;

               } else {

                    print '<td class="khxc_sorttable">' . $price . '</td>' . $eol;

               } // End of if statement.

               print '<td class="khxc_sorttable">';
               print '<p class="hidden"><label for="' . $app . '--updatecart--quantity--';
               print $cartdata['randid'] . '">Quantity</label></p>' . $eol;
               print '<input class="khxc_quickfield" type="text" name="';
               print $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" id="' . $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" value="' . $cartdata['quantity'] . '" size="5" maxlength="5" />' . $eol;
               print '</td>' . $eol;

               $delete_link = $this->link_namespace($app,'deletecart',array('ref' => $cartdata['randid']));
               $move_link   = $this->link_namespace($app,'movecart',array('ref' => $cartdata['randid']));

               print '<td class="khxc_sorttable">';

               print '<a class="khxc_cartbutton" href="' . $delete_link . '" title="';
               print 'Delete Item">' . $delete_name . '</a>' . $eol;

               print '<a class="khxc_cartbutton" href="' . $move_link . '" title="';
               print 'Delete Item">' . $move_name . '</a>' . $eol;

               print '</td>' . $eol;

               print '</tr>' . $eol;

          } // End of if statement.

     } // End of foreach statement.

     // +--
     // | Print totals.
     // +--

     print '<tr class="khxc_sorttable">' . $eol;

     if ($show_imgs) {

          print '<td class="khxc_sorttable" colspan="2"><strong>Total</strong></td>' . $eol;

     } else {

          print '<td class="khxc_sorttable"><strong>Total</strong></td>' . $eol;

     } // End of if statement.

     if ($show_recur) {

          $total_amount    = $this->include_namespace($app,'getprice',$total_amount);
          $total_amountrec = $this->include_namespace($app,'getprice',$total_amountrec);

          print '<td class="khxc_sorttable"><strong>' . $this->xhtml_encode($total_amount) . '</strong></td>' . $eol;
          print '<td class="khxc_sorttable"><strong>' . $this->xhtml_encode($total_amountrec) . '</strong></td>' . $eol;

     } else {

          $total_amount    = $this->include_namespace($app,'getprice',$total_amount);

          print '<td class="khxc_sorttable"><strong>' . $this->xhtml_encode($total_amount) . '</strong></td>' . $eol;

     } // End of if statement.

     // +--
     // | Print the form closure.
     // +--

if ($type == 'WISHLIST') {

 print '<td class="khxc_sorttable" align="right" colspan="2">'; 

print '<p class="khxc_quickform"><input class="khxc_quickbutton" type="submit" ';
print 'name="SUBMIT" id="' . $formid . '--SUBMIT" value="Update Wishlist';
print '" onclick="return DisableSubmit(\'' . $formid . '\');" /></p>';

print '</td>' . $eol;

 } // end of if statement.

if ($type == 'CART') {

     print '<td class="khxc_sorttable" align="right" colspan="2">'; 

print '<p class="khxc_quickform"><input class="khxc_quickbutton" type="submit" ';
print 'name="SUBMIT" id="' . $formid . '--SUBMIT" value="Update Shopping Cart';
print '" onclick="return DisableSubmit(\'' . $formid . '\');" /></p>';

print '</td>' . $eol;

} // end of if.

     print '</tr>' . $eol;

     // +--
     // | Print the table closure.
     // +--

     print '</table>' . $eol;
    
     // +--
     // | Print continue shopping and checkout links if this is
     // | a cart display.
     // +--

   if ($type == 'CART') { 


print '</form>' . $eol .$eol;

print '</div>' . $eol;

print '<div>' . $eol;

print '<table>' . $eol;

print '<tr>' . $eol;

print '<td style="width: 80%">&nbsp;</td>' . $eol; // added to right justfy buttons

print '<td valign="top">' . $eol;

print '<form action="' . $link_shop . '" method="post" id="ccp0--splash"><p class="khxc_quickform"><input class="khxc_quickbutton" type="submit" name="SUBMIT" id="ccp0--splash--SUBMIT" value="Continue Shopping" /></p>';

print '</form>' . $eol;

print '</td>' . $eol;

print '<td valign="top">' . $eol;

print '<form action="' . $link_checkout . '" method="post" id="ccp0--checkout"><p class="khxc_quickform"><input class="khxc_quickbutton" type="submit" name="SUBMIT" id="ccp0--checkout--SUBMIT" value="Checkout" /></p>';

print '</form>'  . $eol . $eol;

print '</td>' . $eol;

print '</tr>' . $eol;

print '</table>' . $eol;

    } // End of if statement.

if ($type == 'WISHLIST') {

print '</form>' . $eol .$eol;

} // end of if statement.

 } // End of if statement.

?>

Offline

 

#5 02-22-2007 20:49:00

grcauto
Member
From: Bloomsburg, PA
Registered: 09-11-2006
Posts: 128
Website

Re: where can I modify the add to cart / wish list form?

bill99 wrote:

Hi All

I'm sure I saw it somewhere on the forum but I just can't find it now. It doesn't appear to be an XHTML include or maybe I'm just missing it.

So, can anyone tell me where I go to edit the "add to you shopping cart or wish list" ( and also the two buttons that accompany this form).

I basically want to replace the table and seperate buttons design that is currently used with a single line similar to:

Qty: [  1] - add to cart image button | add to wish list image button

Thanks,

Bill

After re-reading this I have a question. Are you talking about the catagory display page that shows the products for that page?

Offline

 

#6 02-22-2007 22:31:56

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: where can I modify the add to cart / wish list form?

The buttons for the products is controled by the backend xhtml includes in "Form Footer" and possible "Quick Form Footer".

John

Offline

 

#7 04-15-2007 16:05:19

carasmo
Member
From: Florida
Registered: 10-07-2002
Posts: 147
Website

Re: where can I modify the add to cart / wish list form?

Huh?

On the [strong] detail display[/strong] -- not the shopping cart summary page -- I want to make the layout like this:


Quantity inputfield   |  Add to cart button

Add to wishlist

I looked the forums over for this and no joy.

Thanks!

Last edited by carasmo (04-15-2007 16:08:39)

Offline

 

#8 04-15-2007 16:33:07

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

Re: where can I modify the add to cart / wish list form?

This has been asked before and I researched it with the bottom line being that it's not feasible in the current code without a very significant hack (that I haven't tried).  It has to do with the way the product detail display is built up in the CCP_Prod code.  See my post near the bottom of  for some of the gory details.

Offline

 

#9 05-22-2007 07:00:14

JohnCarter
Member
Registered: 05-09-2007
Posts: 95

Re: where can I modify the add to cart / wish list form?

Hi is there a way to add an "email a friend" button INLINE with these two buttons?

Thanks.

Offline

 

#10 05-22-2007 10:08:14

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

Re: where can I modify the add to cart / wish list form?

The email a friend function was moved inline with the view larger image button in the latest update.  Check out the demo for an example:

https://kryptronic.com/demo/ccp0-prodsh … P1001.html

I recommend applying the update.  Info here:

https://forum.kryptronic.com/viewtopic.php?id=16986


Nick Hendler

Offline

 

Board footer