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 10-28-2010 11:37:45

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

How Do I Change This Price Display In Prodmulti?

This is the code of the default CCP 6.0 :

Code:

<?php 

$app       = $this->globals('khxc_display.app');
$ns        = $this->globals('khxc.namespace');
$ref       = $this->globals('khxc.ref');
$eol       = $this->globals('khxc.eol');
$prodlist  = $this->globals('ecom.prod_prodlist');
$navarray  = $this->globals('ecom.prod_navarray');
$imgwidth  = $this->globals('khxc_settings.' . $app . '.imgsizeprodsm');
$disablewl = $this->globals('khxc_settings.' . $app . '.disablewishlist');

$supsort   = $this->globals('ecom.prod_suppress_sort');
$showsort  = $this->globals('khxc_settings.' . $app . '.showsortopts');
if (empty($showsort)) {$supsort = 1;}

$prodcount = count($prodlist);

// +--
// | In this step we determine whether we will be showing
// | images in this display.
// +--

$multi_images = 0;

foreach ($prodlist as $num => $prod) {

     if ((!(empty($prod['imgsm']))) && ($prod['imgsm'] != 'none.png')) {$multi_images = 1;}

} // End of foreach statement.

// +--
// | Define the header text.
// +--

$header   = $this->globals('ecom.prod_store_header');

if (empty($header)) {

     if ($ns == 'prodshow') {$header = 'Related Items';} else {$header = 'Items';}

} else {

     $header .= ' Featured Items';

} // End of if statement.

$header   = $this->xhtml_encode($header);

$random  = 'x' . $this->random_key(8);

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

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

// +--
// | Print sort options if we are not in the prodshow namespace and
// | we are viewing more than one product or we are within a product
// | result set.
// +--

if ((!($supsort)) && ($ns != 'prodshow') && (($prodcount > 1) || (!(empty($navarray))))) {

     $sortinfo  = $this->globals('khxc_session.prodsort');

     $link_default = $this->link_namespace($app,$ns,array('ref' => $ref,'prodsort' => 'DEFAULT'));
     $link_nameup  = $this->link_namespace($app,$ns,array('ref' => $ref,'prodsort' => 'NAMEUP'));
     $link_namedn  = $this->link_namespace($app,$ns,array('ref' => $ref,'prodsort' => 'NAMEDN'));
     $link_priceup = $this->link_namespace($app,$ns,array('ref' => $ref,'prodsort' => 'PRICEUP'));
     $link_pricedn = $this->link_namespace($app,$ns,array('ref' => $ref,'prodsort' => 'PRICEDN'));

     print '<div class="khxc_storelink">' . $eol . $eol;

     print '<p><strong>Sort by</strong>: ';

     print '<a href="' . $link_default . '" title="DEFAULT">Default</a> | ';
     print 'Name <a href="' . $link_nameup  . '" title="NAMEUP">[+]</a> ';
     print '<a href="' . $link_namedn  . '" title="NAMEDN">[-]</a> | ';
     print 'Price <a href="' . $link_priceup . '" title="PRICEUP">[+]</a> ';
     print '<a href="' . $link_pricedn . '" title="PRICEDN">[-]</a>';


     if     ($sortinfo == 'NAMEUP')  {print ' <strong>Current</strong>: Name [+]';}
     elseif ($sortinfo == 'NAMEDN')  {print ' <strong>Current</strong>: Name [-]';}
     elseif ($sortinfo == 'PRICEUP') {print ' <strong>Current</strong>: Price [+]';}
     elseif ($sortinfo == 'PRICEDN') {print ' <strong>Current</strong>: Price [-]';}
     else                            {print ' <strong>Current</strong>: Default';}

     print '</p>' . $eol;
     print '</div>' . $eol;

} // End of if statement.

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

$nsid     = 'ns';
$formid   = $app . '--prodaddtocartM';

$this->xhtml_quickform_header($formid,$app,'addcart',array($nsid => $ns));

// +--
// | Print multi-add table header.
// +--

if (empty($disablewl)) {

print '<p>Enter a quantity for each item you would like to add to your 
       shopping cart or wish list then click the \'Add To Cart\' 
       or \'Add To Wish List\' button at the bottom of the listing to 
            proceed. All required fields are marked with a star (*).</p>';

} else {

     print '<p>Enter a quantity for each item you would like to add to your 
            shopping cart then click the \'Add To Cart\' button at the bottom 
            of the listing to proceed. All required fields are marked with a star (*).</p>';

} // End of if statement.

print '<table id="khxc--cptbl--' . $random . '" class="khxc_sorttable">' . $eol . $eol;

$trclass = 'khxc_sorttable';
$tdclass = 'khxc_sorttable';

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

if ($multi_images) {

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

} else {

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

} // End of if statement.

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

// +--
// | Loop through the products.
// +--

foreach ($prodlist as $num => $prod) {

      // +--
      // | Print a table row opener.
      // +--

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

      // +--
      // | Print the tds and their content.
      // +--

      $prodname  = $this->xhtml_encode($prod['name']);
      $prodid    = $this->xhtml_encode($prod['id']);
      $prodlink  = $this->link_namespace($app,'prodshow',$prod['id']);
      $proddesc  = $this->xhtml_encode($prod['descshort']);
      $imgname   = $prod['imgsm'];

      $add_ok = 1;

      if (($prod['useinv']) && (!($prod['invlevel'] > 0))) {$add_ok = 0;}
      if ($prod['pricestatus'] == 'D') {$add_ok = 0;}

      $quandisp = 0;
      $quanform = $this->globals('khxc_cgi.' . $formid . '--' . $prodid . '--quantity');

      if (isset($quanform)) {$quandisp = $quanform;}

      if ($add_ok) {

           print '<td class="' . $tdclass . '">' . $eol . $eol;
           print '<label for="' . $formid . '--' . $prodid . '--quantity';
           print '" class="hidden">Quantity</label>' . $eol;
           print '<input class="khxc_formfield" type="text" name="';
           print $formid . '--' . $prodid . '--quantity';
           print '" id="' . $formid . '--' . $prodid . '--quantity';
           print '" value="' . $quandisp . '" size="5" maxlength="5" />' . $eol;
           print '</td>' . $eol . $eol;

      } else {

           print '<td class="' . $tdclass . '">&nbsp;' . $eol . $eol;
           print '<label for="' . $formid . '--' . $prodid . '--quantity';
           print '" class="hidden">Quantity</label>' . $eol;
           print '<p class="hidden"><input type="hidden" name="';
           print $formid . '--' . $prodid . '--quantity';
           print '" id="' . $formid . '--' . $prodid . '--quantity';
           print '" value="' . $quandisp . '" /></p>' . $eol;
           print '</td>' . $eol . $eol;

      } // End of if statement.
      $image_ok = 0;

      if ((!(empty($imgname))) && ($imgname != 'none.png')) {$image_ok = 1;}

      if ($image_ok) {

           $imgurl   = 'media/' . $app . '/prodsm/' . $imgname;
           $imgtag   = '<a href="' . $prodlink . '" title="' . $prodname . '">';
           $imgtag  .= '<img src="' . $imgurl . '" ';
           if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';}
           $imgtag  .= 'alt="' . $prodname . '" /></a>';

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

      } else {

          if ($multi_images) {

               print '<td class="' . $tdclass . '">&nbsp;</td>' . $eol . $eol;

          } // End of if statement.

      } // End of if statement.

      print '<td class="' . $tdclass . '">';

      print '<p><a href="' . $prodlink . '" title="' . $prodname . '">';
      print $prodname . '</a></p>' . $eol;

      if (!(empty($proddesc))) {print '<p>' . $proddesc . '</p>' . $eol;}

      $this->globals('ecom.prod_proddisp',$prod);
      $this->globals('ecom.prod_priceinfo',$prod['khxc.priceinfo']);
           
      $this->include_file($app,'pricedisp.php');

      if ($add_ok) {

            $this->include_namespace($app,'prodshowoptlite',array('form' => $formid . '--' . $prodid, 'showquan' => 0, 'headfoot' => 0));

      } // End of if statement.

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

      // +--
      // | Close the table row.
      // +--

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

} // End of foreach statement.

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

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

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

$this->xhtml_quickform_footer($formid,'Add To Cart',1);

// +--
// | Print navigation links if we have any.
// +--

if (!(empty($navarray))) {

     $this->include_file($app,'prodnav.php');

} // End of if statement.

?>

...and this is the section of code I need to modify:


Code:

      $this->globals('ecom.prod_proddisp',$prod);
      $this->globals('ecom.prod_priceinfo',$prod['khxc.priceinfo']);
           
      $this->include_file($app,'pricedisp.php');

The question is how?  ...in order to allow the price to display as follows:





I already have a statement or two in place in my  file that do the job for items when viewed in the  namespace, but those statements don't work in the  area (probably because of the order in which things are being called), so I need some way of altering the above code.

I have already tried using  and , neither of which worked.

Can anyone help with this, please?

Last edited by Design_Wholesale (10-28-2010 11:40:18)

Offline

 

#2 10-28-2010 11:44:12

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

Re: How Do I Change This Price Display In Prodmulti?

You would need to make the changes in the Product Price Display script, where your looking in the prodmulti script is just setting globals and calling the price script display. Go into the price display script and create a check for the namespace "prodmulti" and set if statements to act on that namespace (as well as a preg_replace statement to insert your message).

John

Offline

 

#3 10-28-2010 15:25:37

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

Re: How Do I Change This Price Display In Prodmulti?

Thanks, John - I now have it working.

To modify the display in the , , and  namespaces you will need to use the following in :


Code:

$proddisp  = $this->globals('ecom.prod_proddisp');

This can then be used to modify the code block for regular pricing to something like this:

Code:

     // +--
     // | Display regular prices.
     // +--

     } elseif ($priceinfo['type'] == 'R') {

          if (($eutax_text['displayboth']) && ($eutax_text['zero']) && ($priceinfo['displayb'] == $priceinfo['displaybeutax'])) {

               print '<div class="khxc_pricediv"><p class="inline">Price: </p>';
               print '<p class="khxc_price">' . $this->xhtml_encode($priceinfo['displayb']) . $this->xhtml_encode($eutax_text['zerotext']);
               print '</p></div>' . $eol . $eol;
              
          } else {

               if (preg_match('/Kraft_Strung_Bags/',$prodid)) {

               print '<div class="khxc_pricediv"><p class="inline" style="color: black;"><strong>&pound;</strong> <i>(per 100 bags)</i>: </p>';
               print '<p class="khxc_price">' . $this->xhtml_encode($priceinfo['displayb']) . $this->xhtml_encode($eutax_text['first']);
               print '</p></div>' . $eol . $eol;

               } elseif ($prodnum == 'LDW_Cable_Clips') {

               print '<div class="khxc_pricediv"><p class="inline" style="color: black;"><strong>&pound;</strong> <i>(per box of 100)</i>: </p>';
               print '<p class="khxc_price">' . $this->xhtml_encode($priceinfo['displayb']) . $this->xhtml_encode($eutax_text['first']);
               print '</p></div>' . $eol . $eol;

...

...with variables like so (some of which are specific to our webstore, and which won't be required in your setup):


Code:

$ns         = $this->globals('khxc.namespace');
$app        = $this->globals('khxc_display.app');
$eol        = $this->globals('khxc.eol');

$priceinfo  = $this->globals('ecom.prod_priceinfo');
$proddisp   = $this->globals('ecom.prod_proddisp');
$eutax_text = $this->globals('eutax_text');
$prodnum    = $proddisp['prodnum'];

$catshow    = $this->globals('ecom.cat_catshow');
$catline    = $catshow['ctag'];
$catid      = $catshow['id'];

Last edited by Design_Wholesale (11-27-2010 22:49:56)

Offline

 

Board footer