Loaded Commerce Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.2

All times are UTC - 5 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: shopping cart info box link
PostPosted: Sat Jan 16, 2010 10:45 am 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
I am probably missing the obvious here but really need some help :(

All i am trying to is make the shopping cart info box header link to the shopping cart page....
Code:
$info_box_contents = array();
 
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" class="">' . BOX_HEADING_SHOPPING_CART . '</a><br>' );

  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));



  $cart_contents_string = '';



the link doesn't appear what am i doing wrong?

Thanks


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Sat Jan 16, 2010 1:30 pm 
Offline
CRE Addict
User avatar

Joined: Wed Sep 16, 2009 10:47 am
Posts: 219
Location: Indiana, USA
Modify in the relevant template folder the infoBoxHeading class in the boxes.tpl.php file.

Regards,

_________________
Jody
Easy Store Sites
Specializing in Affilate Marketing
& Drop Shipping Websites


Are you a Help Vampire? Learn how to tell...


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Sat Jan 16, 2010 4:48 pm 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
Thanks dsauthority,
I have been looking through the infoBoxHeading class and i am still lost, i am not sure what i need to edit.... I understand the text heading is defined in the admin, but I don't see where i need to edit??
I have posted the file content...
Code:

<?php
/*
  $Id: boxes.tpl.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  class tableBox {
    var $table_border = '0';
    var $table_width = '100%';
    var $table_cellspacing = '0';
    var $table_cellpadding = '2';
    var $table_parameters = '';
    var $table_row_parameters = '';
    var $table_data_parameters = '';

// class constructor
    function tableBox($contents, $direct_output = false) {
      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
      $tableBox_string .= '>' . "\n";

      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
        $tableBox_string .= '  <tr';
        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
        $tableBox_string .= '>' . "\n";

        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
              $tableBox_string .= '    <td';
              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
              } elseif (tep_not_null($this->table_data_parameters)) {
                $tableBox_string .= ' ' . $this->table_data_parameters;
              }
              $tableBox_string .= '>';
              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
              $tableBox_string .= $contents[$i][$x]['text'];
              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
              $tableBox_string .= '</td>' . "\n";
            }
          }
        } else {
          $tableBox_string .= '    <td';
          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
            $tableBox_string .= ' ' . $contents[$i]['params'];
          } elseif (tep_not_null($this->table_data_parameters)) {
            $tableBox_string .= ' ' . $this->table_data_parameters;
          }
          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
        }

        $tableBox_string .= '  </tr>' . "\n";
        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
      }

      $tableBox_string .= '</table>' . "\n";

      if ($direct_output == true) echo $tableBox_string;

      return $tableBox_string;
    }
  }

  class infoBox extends tableBox {
    function infoBox($contents) {
      $info_box_contents = array();
      $info_box_contents[] = array('params' => 'class="sidebox"','text' => $this->infoBoxContents($contents));
      $this->table_cellpadding = '0';
      $this->table_parameters = 'class=""';
      $this->tableBox($info_box_contents, true);
    
      $info_box_contents = array();
      $info_box_contents[] = array(array('params' => 'class="boxfooter"','text' => tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/infofooter_left.gif')),
                             array('params' => 'class="boxfooter" align="right"','text' => tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/infofooter_right.gif')),
                             );
      $this->tableBox($info_box_contents, true);
      $info_box_contents = array();
      $info_box_contents[] = array('text' => tep_draw_separator('pixel_trans.gif', '100%', '10'));
      $this->tableBox($info_box_contents, true);
    }

    function infoBoxContents($contents) {
      $this->table_cellpadding = '0';
      $this->table_parameters = 'class=""';
      $info_box_contents = array();
      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
                                           'params' => 'class="boxText"',
                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
      }
      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
      return $this->tableBox($info_box_contents);
    }
  }

  class infoBoxHeading extends tableBox {
    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
      $this->table_cellpadding = '0';

      $info_box_contents = array();
      $info_box_contents[] = array(array('params' => '',
                                         'text' => tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif')),
                                   array('params' => 'width="100%" class="infoBoxHeading"',
                                         'text' => strip_tags($contents[0]['text'])),
                                   array('params' => '',
                                         'text' => tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif')));

      $this->tableBox($info_box_contents, true);
    }
  }

  class infoboxFooter extends tableBox {
    function infoboxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
   return false;
      $this->table_cellpadding = '0';
      if ($left_corner) {
        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
      } else {
        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
      }
      if ($right_arrow) {
        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
      } else {
        $right_arrow = '';
      }
      if ($right_corner) {
        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
      } else {
        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
      }

      $info_box_contents = array();
      $info_box_contents[] = array(array('params' => ' class="infoBoxHeading"', 'text' => $left_corner),
                                   array('params' => ' width="100%" ', 'text' => $contents[0]['text']),
                  array('params' => ' class="infoBoxHeading" nowrap', 'text' => $right_corner));

      $this->tableBox($info_box_contents, true);
    }
  }

  class contentBox extends tableBox {
    function contentBox($contents) {
      $info_box_contents = array();
      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
      $this->table_cellpadding = '1';
     $this->table_cellspacing = '0';
      $this->table_parameters = 'class="infoBox"';
      $this->tableBox($info_box_contents, true);
    }

    function contentBoxContents($contents) {
      $this->table_cellpadding = '0';
     $this->table_cellspacing = '10';
      $this->table_parameters = 'class="infoBoxContents"';
      return $this->tableBox($contents);
    }
  }

  class contentBoxHeading extends tableBox {
    function contentBoxHeading($contents) {
      $this->table_width = '100%';
      $this->table_cellpadding = '0';

      $info_box_contents = array();
      $info_box_contents[] = array(array('params' => '',
                                         'text' => tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/content_left.gif')),
                                   array('params' => 'height="14" class="contentBoxHeading" width="100%"',
                                         'text' => strip_tags($contents[0]['text'])),
                                   array('params' => '',
                                         'text' => tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/content_right.gif')));

      $this->tableBox($info_box_contents, true);
    }
  }

  class errorBox extends tableBox {
    function errorBox($contents) {
      $this->table_data_parameters = 'class="errorBox"';
      $this->tableBox($contents, true);
    }
  }

  class productListingBox extends tableBox {
    function productListingBox($contents) {
      $this->table_parameters = 'class="productListing"';
      $this->tableBox($contents, true);
    }
  }
?>





Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Sun Jan 17, 2010 6:42 pm 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
I see I have missed a basic and vital point about the info box structure :oops:
I can't find any decent tutorials on this but I believe I need to copy boxes.tpl.php to my templates boxes directory, rename to shopping cart.tpl.php and then edit the file.
seems a lot of effort to make make a basic page link :(


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Tue Jan 19, 2010 7:09 pm 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
can anyone please give clear instructions on modifying boxes?
all i want to do is make the shopping cart header text link to the cart page?
but what if i wanted to also change the background colours etc???


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 1:30 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
OK , Peter..

Do not alter anything else other than the following file..

Now dependant on what template you are using, I'll assume its the standard one that comes with CRE..

goto templates/default/boxes/ and open the shopping_cart.php file..

Very near the top of the file you will see this

<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');
new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));

Change to this:



<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => '<font color="' . $font_color . '"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . BOX_HEADING_SHOPPING_CART . '</a></font>');
new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));


That's it, all you need to do...

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 1:56 pm 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
Thanks, I found the string with <a href"
and replaced the code this didn't work :( (the box displayed as normal as if no changes had been done i edited the box heading to confirm it is the correct file)


Code:
<?php

  $info_box_contents = array();
 
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" class="">' . BOX_HEADING_SHOPPING_CART . '</a><br>' );

  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));



Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 2:21 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
peter crane wrote:
Thanks, I found the string with <a href"


You shouldn't find any <a href Thats what you are adding??????

What version of CRE are you using??
Not that it should matter...

The code you posted above works fine.. well it does for me.. on all the CRE's Pro, B2B and 6.41 basic..

Post you complete shopping_cart.php file here and I'll take a look..

your Boxes/shopping_cart.php file ;)

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 2:31 pm 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
I'm using 6.2 b2b patch 11 (i know it needs updating) :wink:

Thanks for helping.......

Code:
<?php

/*

  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $





  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com



  Copyright (c) 2003 osCommerce



  CRE Loaded , Open Source E-Commerce Solutions

  http://www.creloaded.com



  Chain Reaction Works, Inc

  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.

   

   Last Modified by $Author$

   Last Modifed on : $Date$

   Latest Revision : $Revision: 1883 $





  Released under the GNU General Public License



*/

if(!ereg('^22_',$HTTP_GET_VARS['cPath']) && !ereg('^22$',$HTTP_GET_VARS['cPath'])) {
?>

<!-- shopping_cart //-->

<script type="text/javascript"><!--

function couponpopupWindow(url) {

  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')

}

//--></script>



          <tr>

            <td>

<?php

  $info_box_contents = array();

$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');

  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));



  $cart_contents_string = '';

  if ($cart->count_contents() > 0) {

    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';

    $products = $cart->get_products();

    for ($i=0, $n=sizeof($products); $i<$n; $i++) {

      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';



      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

        $cart_contents_string .= '<span class="newItemInCart">';

      } else {

        $cart_contents_string .= '<span class="infoBoxContents">';

      }



///////////////////////////////////////////////////////////////////////////////////////////////////////

// MOD begin of sub product



   $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];

    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));

   if ((int)$products_parent_id['products_parent_id'] != 0) {

     $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';

   } else {

      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

   }



//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';



// MOD end of sub product

///////////////////////////////////////////////////////////////////////////////////////////////////////



      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

        $cart_contents_string .= '<span class="newItemInCart">';

      } else {

        $cart_contents_string .= '<span class="infoBoxContents">';

      }



      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';



      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

        tep_session_unregister('new_products_id_in_cart');

      }

    }

    $cart_contents_string .= '</table>';

  } else {

    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;

  }



  $info_box_contents = array();

  $info_box_contents[] = array('text' => '<table cellspacing="0" cellpadding="0" width="100%">
                                   <td width="100%">'.$cart_contents_string.'</td>
                                 <td valign="top"><a href="'.tep_href_link(FILENAME_SHOPPING_CART,'','SSL').'">'.tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/carticon.jpg').'</a></td>
                              </table>');



  if ($cart->count_contents() > 0) {

    // WebMakers.com Added: Shoppe Enhancement Controller

    // check for free order

    $final_total=$cart->show_total();

    if ($final_total==0) {

      $final_total='Free';

    } else {

      $final_total=$currencies->format($cart->show_total());

    }

    $info_box_contents[] = array('text' => tep_draw_separator());

    $info_box_contents[] = array('align' => 'right',

                                 'text' => $final_total);

  }

// ICW ADDED FOR CREDIT CLASS GV

  if (tep_session_is_registered('customer_id')) {

    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");

    $gv_result = tep_db_fetch_array($gv_query);

    if ($gv_result['amount'] > 0 ) {

      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');

      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');

    }

  }

  if (tep_session_is_registered('gv_id')) {

    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");

    $coupon = tep_db_fetch_array($gv_query);

    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');



  }

  if (tep_session_is_registered('cc_id') && $cc_id) {

    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');



  }



// ADDED FOR CREDIT CLASS GV END ADDITTION

  new infoBox($info_box_contents);

?>

            </td>

          </tr>

<!-- shopping_cart_eof //-->
<?
}
?>




Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 3:04 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
Thats even stranger.. youusing a template from someone??

This..
Code:
  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));


Should give you a little arrow (image) on the righthabd side of the box heading that links to the shopping cart if you click it?


Anyway.. if it's not there this should now link your title (Shopping Cart) in the box header to your Shopping Cart

Code:
<?php

/*

  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com
  Copyright (c) 2003 osCommerce
  CRE Loaded , Open Source E-Commerce Solutions
  http://www.creloaded.com
  Chain Reaction Works, Inc

  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
   Last Modified by $Author$

   Last Modifed on : $Date$

   Latest Revision : $Revision: 1883 $

  Released under the GNU General Public License
*/

if(!ereg('^22_',$HTTP_GET_VARS['cPath']) && !ereg('^22$',$HTTP_GET_VARS['cPath'])) {
?>
<!-- shopping_cart //-->
<script type="text/javascript"><!--
function couponpopupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')

}
//--></script>
          <tr>
            <td>
<?php
  $info_box_contents = array();
$info_box_contents[] = array('text'  => '<font color="' . $font_color . '"><a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL') . '">' . BOX_HEADING_SHOPPING_CART . '</a></font>');

  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));

  $cart_contents_string = '';
  if ($cart->count_contents() > 0) {
    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
    $products = $cart->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
        $cart_contents_string .= '<span class="newItemInCart">';
      } else {
        $cart_contents_string .= '<span class="infoBoxContents">';
      }
///////////////////////////////////////////////////////////////////////////////////////////////////////

// MOD begin of sub product
   $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
   if ((int)$products_parent_id['products_parent_id'] != 0) {
     $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';
   } else {
      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
   }

//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

// MOD end of sub product

///////////////////////////////////////////////////////////////////////////////////////////////////////

      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
        $cart_contents_string .= '<span class="newItemInCart">';
      } else {
        $cart_contents_string .= '<span class="infoBoxContents">';
      }

      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';

      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
        tep_session_unregister('new_products_id_in_cart');
      }
    }
    $cart_contents_string .= '</table>';
  } else {
    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
  }

  $info_box_contents = array();
  $info_box_contents[] = array('text' => '<table cellspacing="0" cellpadding="0" width="100%">
                                   <td width="100%">'.$cart_contents_string.'</td>
                                 <td valign="top"><a href="'.tep_href_link(FILENAME_SHOPPING_CART,'','SSL').'">'.tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/carticon.jpg').'</a></td>
                              </table>');

  if ($cart->count_contents() > 0) {
    // WebMakers.com Added: Shoppe Enhancement Controller
    // check for free order
    $final_total=$cart->show_total();
    if ($final_total==0) {
      $final_total='Free';
    } else {
      $final_total=$currencies->format($cart->show_total());
    }
    $info_box_contents[] = array('text' => tep_draw_separator());
    $info_box_contents[] = array('align' => 'right',
                                 'text' => $final_total);
  }

// ICW ADDED FOR CREDIT CLASS GV
  if (tep_session_is_registered('customer_id')) {
    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
    $gv_result = tep_db_fetch_array($gv_query);
    if ($gv_result['amount'] > 0 ) {
      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');

      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
    }
  }
  if (tep_session_is_registered('gv_id')) {
    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
    $coupon = tep_db_fetch_array($gv_query);
    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');

  }

  if (tep_session_is_registered('cc_id') && $cc_id) {
    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
  }

// ADDED FOR CREDIT CLASS GV END ADDITTION

  new infoBox($info_box_contents);
?>
            </td>
          </tr>
<!-- shopping_cart_eof //-->
<?
}
?>

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 4:05 pm 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
that didn't work either, the box displays correctly just link.
if you notice in the code an image that has href. that works, if i remove the image link and test the link doesn't work as i would expect.

If alter the box heading text the change is also reflected.

I know this isn't normal could a link be placed in the file where the box header is defined?


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 6:04 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
Sorry Peter, but you've lost me now..

I cant see how its not possible for that link not to work..

If you put your mouse over the title "shopping Cart" it doesn't link to the main shopping cart page???

have you got a link to your site to see??

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 6:10 pm 
Offline
CRE Newbie

Joined: Thu Dec 24, 2009 4:21 pm
Posts: 23
this has me puzzled to :(


Last edited by peter crane on Thu Jan 21, 2010 2:34 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 8:17 pm 
Offline
CRE Addict
User avatar

Joined: Wed Sep 16, 2009 10:47 am
Posts: 219
Location: Indiana, USA
Why are you guys modifying the cart contents class when you want to modify the infoboxheading? That is where the shopping cart text is.

Regards,

_________________
Jody
Easy Store Sites
Specializing in Affilate Marketing
& Drop Shipping Websites


Are you a Help Vampire? Learn how to tell...


Top
 Profile  
 
 Post subject: Re: shopping cart info box link
PostPosted: Wed Jan 20, 2010 9:34 pm 
Offline
CRE Addict
User avatar

Joined: Wed Sep 16, 2009 10:47 am
Posts: 219
Location: Indiana, USA
I just took a few minutes to do this locally. I'm sure our files aren't the same so I'll post some code for you to reference.

In boxes.tpl.php in template folder find

Code:
class infoBoxHeading extends tableBox {
    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false, $css_suffix = '') {
      $this->table_cellpadding = '0';

      if ($right_arrow == true) {
        $right_arrow = '&nbsp;<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
      } else {
        $right_arrow = '';
      }
      $info_box_contents = array();
      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeadingLcorner' . $css_suffix .'"',
                                         'text' => ' '),
                                   array('params' => 'height="14" class="infoBoxHeading' . $css_suffix .'" nowrap',
                                         'text' => $contents[0]['text'].$right_arrow),
                                   array('params' => 'height="14" class="infoBoxHeadingRcorner' . $css_suffix .'"',
                                         'text' => ' '));

      $this->tableBox($info_box_contents, true);
    }
  }


Build a custom class for your link like this and insert it below the code listed above after the second bracket. Don't paste this code as it's written for my custom template - alter your code to look similar.

Code:
//Build Custom Class for Shopping Cart Link BOM
  class infoBoxCustom extends tableBox {
    function infoBoxCustom($contents, $left_corner = true, $right_corner = true, $right_arrow = false, $css_suffix = '') {
      $this->table_cellpadding = '0';

      if ($right_arrow == true) {
        $right_arrow = '&nbsp;<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
      } else {
        $right_arrow = '';
      }
      $info_box_contents = array();
      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxCustomLcorner' . $css_suffix .'"',
                                         'text' => ' '),
                                   array('params' => 'height="14" class="infoBoxCustom' . $css_suffix .'" nowrap',
                                         'text' => '<a class="infoBoxCustom" href="' .tep_href_link(FILENAME_SHOPPING_CART) . '">'.$contents[0]['text']),
//                                         'text' => '<a href="' .$contents[0]['text']),
                                   array('params' => 'height="14" class="infoBoxCustomRcorner' . $css_suffix .'"',
                                         'text' => ' '));

      $this->tableBox($info_box_contents, true);
    }
  }
//Build Custom Class for Shopping Cart Link EOM   


I named the new class infoBoxCustom

Now in your template/boxes folder find shopping_cart.php find infoBoxHeading and change to infoBoxCustom

Upload both files (backup originals) and you're done. However you'll notice the link has inherited the link properties from the stylesheet. If that's a problem you'll need to make some custom entries into your stylesheet. Here is a sample:

Code:
.infoBoxCustom {
}
TD.infoBoxCustom, TD.infoBoxCustomCenter {
  font-family: Helvetica;
  font-size: 11px;
  font-weight: bold;
  color: #3B3B3B;
  text-align: left;
  padding-left: 15px;
}
TD.infoBoxCustomLeft, TD.infoBoxCustomRight, TD.infoBoxCustomSearch, TD.infoBoxCustomInformation {
  font-family: Arial;
  font-size: 11px;
  font-weight: bold;
  color: #000066;
  text-align: left;
  padding-left: 15px;
}
TD.infoBoxCustomLcornerLeft, TD.infoBoxCustomLcornerRight {
   background-image: url(images/az_leftbox1_top_l.gif);
   background-repeat:  no-repeat;
   width: 9px;
   height: 24px;
}
TD.infoBoxCustomLeft, TD.infoBoxCustomRight {
   background-image: url(images/az_leftbox1_top_m.gif);
   background-repeat:  repeat-x;
   height: 24px;
}
TD.infoBoxCustomRcornerLeft, TD.infoBoxCustomRcornerRight {
   background-image: url(images/az_leftbox1_top_r.gif);
   background-repeat: no-repeat;
   width: 6px;
   height: 24px;
}
  a.infoBoxCustom:link {font-family: Tahoma; font-size: 11px; color: yellow; font-weight: bold; text-decoration: none;}
  a.infoBoxCustom:visited {font-family: Tahoma; font-size: 11px; color: red; font-weight: bold; text-decoration: none;}
  a.infoBoxCustom:hover {font-family: Tahoma; font-size: 11px; color: orange; font-weight: bold; text-decoration: underline;}
  a.infoBoxCustom:active {font-family: Tahoma; font-size: 11px; color: purple; font-weight: bold;}


Yours will vary because we run different templates. You should be able to figure out the rest.

Best regards,

_________________
Jody
Easy Store Sites
Specializing in Affilate Marketing
& Drop Shipping Websites


Are you a Help Vampire? Learn how to tell...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

Board index » CRE Loaded Support » CRE Loaded 6.2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
It is currently Mon May 21, 2012 6:17 pm
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy