Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Hi. is have the sppc ut and working, but one smal problem.

 

I set a product to Special price tro Special, to the retail group.

 

Is there any way to get the prices in all the other sppc groups to check the specials in the retail group? Something like this

 

if specials < sppc_group_prise show specials if not show sppc_group_price?

Link to comment
Share on other sites

Hi. is have the sppc ut and working, but one smal problem.

 

I set a product to Special price tro Special, to the retail group.

 

Is there any way to get the prices in all the other sppc groups to check the specials in the retail group? Something like this

 

if specials < sppc_group_prise show specials if not show sppc_group_price?

 

 

Hi, I am strying to combine sppc for attributes with option_type_feature, whilst i can get them both working seperatly I cant for the hell of me get it to work for both.

 

at the moment i am trying just to get the product_info.php file correct. This the code of my current product_info file which lets the product_type_feature work, the sppc for the product price but not the attribute price.

 

If anyone can help I would be grateful.

<?php
/*
 $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
 /*** Begin Quotes ***/
 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.quotes_expire < now() and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);

 $customer_query = tep_db_query("select customers_id, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
 $customer = tep_db_fetch_array($customer_query);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);

 $cust_id_query = tep_db_query("select quotes_email_address, products_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$_GET['products_id'] );
 $cust_id = tep_db_fetch_array($cust_id_query);

 if (empty($cust_id['quotes_email_address'])) {
   $invalidCust = 'false';
 }
 else if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
   if ($cust_id['quotes_email_address'] == $customer['customers_email_address'] || $customer['customers_email_address'] == STORE_OWNER_EMAIL_ADDRESS)
     $invalidCust = 'false';
   else
$invalidCust = 'true';
 } else {

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);
// BOF Separate Pricing per Customer
 if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
   $customer_group_id = $_SESSION['sppc_customer_group_id'];
 } else {
   $customer_group_id = '0';
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

 }
 }
// EOF Separate Pricing per Customer
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script type="text/javascript" src="includes/js/prototype.js"></script>
<script type="text/javascript" src="includes/js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="includes/js/lightbox.js"></script>
<script type= "text/javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}


// BOF Product Type Feature
/* DDB - 041031 - Form Field Progress Bar */
/***********************************************
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/
* Modified by Dynamic Drive for minor changes
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com
* Please keep this notice intact
***********************************************/
function textCounter(field,counter,maxlimit,linecounter) {
// text width//
var fieldWidth =  parseInt(field.offsetWidth);
var charcnt = field.value.length;        
// trim the extra text
if (charcnt > maxlimit) { 
	field.value = field.value.substring(0, maxlimit);
} else { 
// progress bar percentage
var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
// color correction on style from CCFFF -> CC0000
setcolor(document.getElementById(counter),percentage,"background-color");
}
}
function setcolor(obj,percentage,prop){
obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
// EOF Product Type Feature
//--></script>



</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php /*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
<?php /*** End Header Tags SEO ***/ ?>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 /*** Begin Quotes ***/
 if ($invalidCust == 'true') {
?>
      <tr>
       <td><h1><?php echo HEADING_INVALID_CUSTOMER; ?></h1></td>
		</tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><?php echo TEXT_INVALID_CUSTOMER; ?></td>
		</tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
} else {
/*** End Quotes ***/
 if ($product_check['total'] < 1) {
?>
     <tr>
       <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
// BOF: More Pics 6  Added: , p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6
   $product_info_query = tep_db_query("select p.products_id, pd.products_name, p.quotes_email_address, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, pd.products_url,p.products_msrp, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
// EOF: More Pics 6
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
   // see if rp product
   $rp_has_trial = false;
   if($product_info['products_type'] == 'recurring'){
       // recurring product
     $rp_array = array();
     $rp_product_query = tep_db_query('SELECT billingPeriod, billingFrequency, totalBillingCycles, trialBillingPeriod, trialBillingFrequency, trialTotalBillingCycles, trialAmt FROM ' . TABLE_RP_PAYPAL_PRODUCT_PROFILE . ' WHERE products_id=' . (int)$HTTP_GET_VARS['products_id']);
     if($rp_product = tep_db_fetch_array($rp_product_query)){
       // recurring data
        $rp_array = $rp_product;
        if(strlen($rp_product['trialBillingPeriod'])>0){
            $rp_has_trial = true;
        }
     }
   }
///

///
   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
// BOF Separate Pricing per Customer
     if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
       $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
         $product_info['products_price']= $scustomer_group_price['customers_group_price'];
      }
     } // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
// BOF Separate Pricing per Customer
     if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
       $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
       $product_info['products_price']= $scustomer_group_price['customers_group_price'];
    }
   } // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }
   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }

   $products_price = '<table class="" align="right" border="0" width="100%" cellspacing="0" cellpadding="0">';
           $new_price = tep_get_products_special_price($product_info['products_id']);
           if ($product_info['products_msrp'] > $product_info['products_price'])

           $products_price .= '<tr class="PriceListBIG"><td align="right">' . TEXT_PRODUCTS_MSRP  . $currencies->display_price($product_info['products_msrp'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';
           if ($new_price != '')
           $products_price .= '<tr class="usualpriceBIG"><td align="right">'. TEXT_PRODUCTS_USUALPRICE . '';
            else
           $products_price .= '<tr class="pricenowBIG"><td align="right">'. TEXT_PRODUCTS_OUR_PRICE .   '';

           $products_price .=  $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';

           if ($new_price != '')
              {$products_price .= '<tr class="pricenowBIG"><td align="right">' . TEXT_PRODUCTS_PRICENOW .  $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';}
           if ($product_info['products_msrp'] > $product_info['products_price'])
             {if ($new_price != '')
               {$products_price .= '<tr class="savingBIG"><td align="right" >' . TEXT_PRODUCTS_SAVINGS_RRP .  $currencies->display_price(($product_info['products_msrp'] -  $new_price), tep_get_tax_rate($product_info['products_tax_class_id'])) .' ('. number_format(100 - (($new_price / $product_info['products_msrp']) * 100)) . '%)</td></tr>';}
             else
               {$products_price .= '<tr class="savingBIG"><td align ="right" >' . TEXT_PRODUCTS_SAVINGS_RRP . $currencies->display_price(($product_info['products_msrp'] -  $product_info['products_price']), tep_get_tax_rate($product_info['products_tax_class_id'])) . ' ('. number_format(100 - (($product_info['products_price'] / $product_info['products_msrp']) * 100)) . '%)</td></tr>';}}
           else
             {if ($new_price != '')
               {$products_price .= '<tr class="savingBIG"><td align="right" >' . TEXT_PRODUCTS_SAVINGS_RRP .  $currencies->display_price(($product_info['products_price'] -  $new_price), tep_get_tax_rate($product_info['products_tax_class_id'])) . ' ('. number_format(100 - (($new_price / $product_info['products_price']) * 100)) . '%)</td></tr>';}}
           $products_price .= '</table>';

   }
   if (tep_not_null($product_info['products_model'])) {
$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }
        // rp addition here
   if(count($rp_array)>0){
        include_once(DIR_WS_CLASSES . '/paypal_rp_product_info.php');
        $rpPinfo = new paypal_rp_product_info($product_info, $rp_array, $products_price);
        $rpPinfoHeaderArr = $rpPinfo->getProductInfoHeader();
        $rpPInfoArr = $rpPinfo->getProductInfoFull();
   }
// BOF: More Pics 6
   $mopics_image_width = (MOPICS_RESTRICT_IMAGE_SIZE=='true'?SMALL_IMAGE_WIDTH:'');
   $mopics_image_height = (MOPICS_RESTRICT_IMAGE_SIZE=='true'?SMALL_IMAGE_HEIGHT:'');
   if (MOPICS_SHOW_ALL_ON_PRODUCT_INFO=='true') {
     $mopics_output = '';
     $mo_row = 1;
     $mo_col = 1;
     $mopics_images = array();
     if (tep_not_null($product_info['products_image']) && MOPICS_GROUP_WITH_PARENT == 'true') { $mopics_images[] = $product_info['products_image']; }
     for ( $mo_item=1; $mo_item<7; $mo_item++ ) {
       if (tep_not_null($product_info['products_subimage'.$mo_item])) { $mopics_images[] = $product_info['products_subimage'.$mo_item]; }
     }
     $mopics_count = sizeof($mopics_images);
     if ($mopics_count > 0) { 
    $mopics_output .= '<table border="0" cellspacing="0" cellpadding="6" align="'.MOPICS_TABLE_ALIGNMENT.'">';
       for ( $mo_item=0; $mo_item<$mopics_count; $mo_item++ ) {
         if ($mo_row<(MOPICS_NUMBER_OF_ROWS+1)) {
   	    if ($mo_col==1) {$mopics_output.='<tr>'."\n";}
           $mopics_output .= '              <td align="center" class="smallText"><script type= "text/javascript"><!--
               document.write(\'<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'].'&invis='.(MOPICS_GROUP_WITH_PARENT=='true'?$mo_item:($mo_item+1))).'\\\')">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], addslashes($product_info['products_name']), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_width), (MOPICS_RESTRICT_PARENT=='false'&&$mo_item==0&&MOPICS_GROUP_WITH_PARENT=='true'?'':$mopics_image_height), 'hspace="5" vspace="5"') . '<br><img src="images/zoom.gif" alt="zoom"><\/a>\');
               //--></script><noscript>
                 <a href="' . tep_href_link(DIR_WS_IMAGES . $mopics_images[$mo_item]) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], $product_info['products_name'], $mopics_image_width, $mopics_image_height, 'hspace="5" vspace="5"') . '<br><img  src="images/zoom.gif" alt="zoom"></a>
                 </noscript></td>'."\n";
   	    if ($mo_col==MOPICS_NUMBER_OF_COLS) { $mo_col=1; $mo_row++; $mopics_output.='</tr>'."\n"; } else { $mo_col++; }
         }
       }
       if ($mo_col!=1){ while (($mo_col++)<(MOPICS_NUMBER_OF_COLS+1)) { $mopics_output.='<td> </td>'; } $mopics_output.='</tr>'."\n"; }
       $mopics_output .= '</table>'."\n"; 
  }
   }
// EOF: More Pics 6
//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED
if(tep_session_is_registered('wishlist_id')) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
           <?php
           if(count($rp_array)>0 and $rp_has_trial){
           // rp with trial
           ?>
           <td class="pageHeading" align="right" valign="top"><?php echo $rpPinfoHeaderArr['trial']; ?><br><?php print $rpPinfoHeaderArr['normal'];?></td>
           <?php
           // rp no trial
           }elseif (count($rp_array)>0){
           ?>
           <td class="pageHeading" align="right" valign="top"><?php print $rpPinfoHeaderArr['normal']; ?></td>
           <?php
           }else{
           // standard product
           ?>
            <td align="right" valign="top" width="10%"><?php echo $products_price; ?></td>

           <?php

           }

           ?>
         </tr>
  <tr>
	<td class="messageStackSuccess"><?php echo PRODUCT_ADDED_TO_WISHLIST; ?></td>
  </tr>

?>

<?php
	tep_session_unregister('wishlist_id');
}
//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <?php /*** Begin Header Tags SEO ***/ ?>
           <td valign="top"><h1><?php echo $products_name; ?></h1></td>
           <td align="right" valign="top"><?php echo $products_price; ?></td>
           <?php /*** End Header Tags SEO ***/ ?></tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main">
<?php
         // BOF: More Pics 6
         if (MOPICS_TABLE_LOCATION=='above' && !empty($mopics_output)) {
           echo '          <table width="100%" border="0" cellspacing="0" cellpadding="0">
           <tr>
           <td align="center" class="smallText">'.$mopics_output.'</td>
           </tr>
           </table>
            <br>'."\n";
         } else if (MOPICS_TABLE_LOCATION=='sides' && !empty($mopics_output)) {
           echo $mopics_output;
         }
         // EOF: More Pics 6
// BOF: More Pics 6    ADDED to if statement:  && MOPICS_GROUP_WITH_PARENT == 'false'
   if (tep_not_null($product_info['products_image']) && MOPICS_GROUP_WITH_PARENT == 'false') {
?>
         <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">
<script type= "text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img  src="images/zoom.gif" alt="zoom"><\/a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img src="images/zoom.gif" alt="zoom"></a>'; ?>
<?php // EOF: More Pics 6 ?>
</noscript>
<br><br>
 <?php
//affiliate build a link begin
	if (tep_session_is_registered('affiliate_id')) {
		?>
     <?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('includes/languages/english/images/buttons/button_affiliate_build_a_link.gif', 'Make a link') . ' </a>'; ?><?php
	}
//affiliate build a link begin
     ?>
             </td>
           </tr>
         </table>
<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?>
<?php
         // rp check for rp data
         if(count($rp_array)>0){
             print '<p>';
             if(array_key_exists('trial', $rpPInfoArr)){
                 print $rpPInfoArr['trial'] . "<br>\n";
             }
             print $rpPInfoArr['normal'];
         }
// BOF SPPC Hide attributes from customer groups
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 ");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
         <table border="0" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     // BOF Option Type Feature
     //$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     //while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
			//clr 030714 add case statement to check option type
       switch ($products_options_name['products_options_type']) {
         case PRODUCTS_OPTIONS_TYPE_TEXT:
           //CLR 030714 Add logic for text option
           $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
           $products_attribs_array = tep_db_fetch_array($products_attribs_query);
           $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'">  ' . $products_options_name['products_options_comment'] ;
           if ($products_attribs_array['options_values_price'] != '0') {
             $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')';
           }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo $tmp_html;  ?></td>
           </tr>
<?php
           break;

         case PRODUCTS_OPTIONS_TYPE_TEXTAREA:
           //CLR 030714 Add logic for text option
           $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
           $products_attribs_array = tep_db_fetch_array($products_attribs_query);
	$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   wrap="soft" 
							   name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   rows=5 
							   id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>
					<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>
					<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?>	<!-- DDB - 041031 - Form Field Progress Bar //-->
           <tr>
<?php
           if ($products_attribs_array['options_values_price'] != '0') {
?>
             <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td>
<?php       } else {
?>
             <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td>
<?php        }
?>
             <td class="main"><?php echo $tmp_html;  ?></td>
           </tr>
<?php
           break;

case PRODUCTS_OPTIONS_TYPE_RADIO:
	//CLR 030714 Add logic for radio buttons
	$tmp_html = '<table>';
	$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");
	//$checked=true;
	// START vEDIT
	if(!isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])){
		$no_value = true;
	}
	// END vEDIT
	while ($products_options_array = tep_db_fetch_array($products_options_query)) {
		// START vEDIT
		if ($products_options_array['products_options_values_id'] == $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']] || $no_value) {
			$checked = true;
			$no_value = false;
		} else {
			$checked = false;
		}
		// END vEDIT
		$tmp_html .= '<tr><td class="main">';
		$tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);
		//$checked = false;
		$tmp_html .= $products_options_array['products_options_values_name'] ;
		$tmp_html .=$products_options_name['products_options_comment'] ;
		if ($products_options_array['options_values_price'] != '0') {
			$tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
		}
		$tmp_html .= '</tr></td>';
	}
	$tmp_html .= '</table>';
	?>
	<tr>
	<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
	<td class="main"><?php echo $tmp_html;  ?></td>
	</tr>
	<?php
break;

case PRODUCTS_OPTIONS_TYPE_CHECKBOX:
	//CLR 030714 Add logic for checkboxes
	$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
	$products_attribs_array = tep_db_fetch_array($products_attribs_query);
	// START vFIX
	$boxchecked = false;
	if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {					
		$boxchecked = true;
	}else {
		$boxchecked = false;	
	}
	// END vFIX 
	echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">';
	// START vFIX 
	//echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);
	echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id'], $boxchecked);
	// END vFIX 
	echo $products_options_name['products_options_comment'] ;
	if ($products_attribs_array['options_values_price'] != '0') {
	echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	}
	echo '</td></tr>';
break;


         default:
           //clr 030714 default is select list
           //clr 030714 reset selected_attribute variable
           $selected_attribute = false;

     // EOF Option Type Feature 
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php 
               // BOF Option Type Feature
               //echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute);
               echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array,   $selected_attribute) . $products_options_name['products_options_comment'];
               // EOF Option Type Feature
               ?></td>
           </tr>
<?php
       // BOF Option Type Feature
       } // ends the switch clause
       // EOF Option Type Feature
     } 
  ?>
         </table>
<?php
   }
// BOF: More Pics 6
if (MOPICS_TABLE_LOCATION=='below' && !empty($mopics_output)) {
  echo ' <br>
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
           <tr>
             <td align="center" class="smallText">'.$mopics_output.'</td>
           </tr>
         </table>'."\n";
}
// EOF: More Pics 6
?>					
       </td>
     </tr>
         <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
/*** Begin Quotes ***/
if (! tep_not_null($customers['customers_email_address'])) {
/*** Begin Quotes ***/
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>
     <tr>
       <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }
/*** Begin Quotes ***/
}
/*** End Quotes ***/
   if (tep_not_null($product_info['products_url'])) {
?>
     <tr>
       <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }
/*** Begin Quotes ***/
if (! tep_not_null($customers['customers_email_address'])) {
/*** End Quotes ***/
   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
     </tr>
<?php
   } else {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
     </tr>
<?php
   }
   /*** Begin Quotes ***/
}
/*** End Quotes ***/
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <?php
               /*** Begin Quotes ***/
                if (! tep_not_null($customers['customers_email_address'])) {
               ?>
               <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
              <?php
                }
               /*** End Quotes ***/
               ?><td align="center"><?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></td>
               <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr> <!--- BEGIN Header Tags SEO Social Bookmarks -->
     <?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true')
      include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php');
     ?>
     <!--- END Header Tags SEO Social Bookmarks -->
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<?php
//added for cross -sell
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_xsell_products(3600); //added for Xsell
     echo tep_cache_also_purchased(3600);
   } else {
     include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); //added for Xsell
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }

?>
       </td>
     </tr>
 </table></form></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

Thanks for answer, have gone away from the options, and is now trying to set up the Quantity Price Breaks for Separate Pricing Per Customer.

 

http://addons.oscommerce.com/info/3039

 

Edit: Think i was answering the wrong post here.

 

Im still looking for a way to get the specials to show in all customer groups.

Edited by stClem
Link to comment
Share on other sites

Hi, i installed SPPC 4.2.2 and i have a problem whit a tax.

When i login i have price whitout tax and when logout the tax is back.

 

I have used display price whit tax on true in admin panel.

 

I will be greatfull :)

Link to comment
Share on other sites

Hi, i installed SPPC 4.2.2 and i have a problem whit a tax.

When i login i have price whitout tax and when logout the tax is back.

 

I have used display price whit tax on true in admin panel.

So what is wrong here?

Link to comment
Share on other sites

Some uptade:

 

I installed clear version Osc2.2 and sppc4.2.

 

evry thing works fine and i see product tax when i`m login or logout but when i edit any of product who is in clear version and aplly changes tax is disappear if im login.

 

In clear version in product like mice above intup price is tax rate and its set to none, why ? Tax is showing on in this option but if i edit this problem is back :/

 

Any solution of this problem ? I think that this is better contribution then b2b but this tax is horrible ;/

 

I will be greatfull :)

Link to comment
Share on other sites

Any solution of this problem ? I think that this is better contribution then b2b but this tax is horrible ;/

You should check the settings for that particular customer group in the admin. Tax with or without price can be set for each customer group too.

Link to comment
Share on other sites

I am trying to figure out how to display some prices but have run into a snag. I am building a site that is to be used as a catalog only, no checkout. The store has lots of products that have several sizes such as Small, Medium, Large, etc. and all the different sizes have different prices for Retail and Wholesale groups. I am looking for ideas on how to display the different prices on the product pages so the correct prices show up for each of the groups.

 

Thanks,

Link to comment
Share on other sites

all the different sizes have different prices for Retail and Wholesale groups. I am looking for ideas on how to display the different prices on the product pages so the correct prices show up for each of the groups.

SPPC does offer that out of the box, however in the same format as standard osC. So a price and attribute prices in the dropdown menu.

 

Or does your question is how to show both retail prices and wholesale prices on the product page when logged-in as a wholesale customer?

Link to comment
Share on other sites

SPPC does offer that out of the box, however in the same format as standard osC. So a price and attribute prices in the dropdown menu.

 

Or does your question is how to show both retail prices and wholesale prices on the product page when logged-in as a wholesale customer?

 

 

Hi Jan,

 

After looking at several solutions I really just needed to display the attribute prices differently. I installed a contribution that shows the actual product price in the attribute price dropdown which solved half the problem. I then created a new way to list items instead of the traditional dropdown, checkbox, etc. I just made one that used the input type "hidden" to show just a list of the attributes.

 

Added to functions/html_output.php

 

// Output a form list menu for product info page
 function tep_draw_list_menu($name, $values, $default = '', $parameters = '', $required = false) {
$field ='';   
if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

   for ($i=0, $n=sizeof($values); $i<$n; $i++) {
  $value = tep_output_string($values[$i]['id']);
     $field .= '<input type="hidden" name="' . $name . '" value="' . $value . '"';
       $field .= ' ';

     $field .= '>' . tep_output_string($values[$i]['text'], array('"' => ' '')) . '<br>';
   }
   $field .= '';

   return $field;
 }

 

 

Then changed the lines in product_info.php to

 

              <td class="main" valign="top" style="padding-right:10px; font-weight:bold"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_list_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

 

 

That displayed the actual product prices for each attribute in a list form and takes away the option of selecting an option which I did not need for just a catalog (no shopping).

Link to comment
Share on other sites

Hi, have installed SPPC and Price Break for SPPC. All works nice, but i want the Quantity Block to be the same as the retail group has if i dont set it to anything else. Today it automaticly set to 1 in each SPPC group. This even if the Retail group has quantity block to etc 12.

 

if i set the value to 12 in the retail group in one item, the value in all the other groups are still 1. Is to make all the other groups to have the same value as retail group if there is no value in the other group.

 

this is one example.

 

Item called GPS.

SPPC grpups: Retial (The standard one) and sppcgroupeone.

 

If i in Retail group set Quantity Block to 12, the customers in retail group only can buy 12 or 24 or 36 etc of the item GPS.

But the customers in sppcgroupeone still can buy 1 or 2 or 3 etc of the item GPS.

 

Is there any place in the codes to change the to something like this:

 

IF SPPC group Quantity Block is 0 then use group Retail Quantity Block number.

Of course it have to be 0 as default in QB on all groups, not 1 as today.

Link to comment
Share on other sites

When you select a product block quantity in categories administration(For example: HP 5110 you must buy 2, 4, 6...). If you buy 3, the cart shows 3. You must refresh the cart, then the cart quantity changes to 4. But if you don't refresh it, your order have 3 pieces of he product.

Is it a bug or is my error? Because I don't find the error.

Thanks again, kind regards

Daniel

 

I have this problem. Someone who has a answer?

Link to comment
Share on other sites

I have found out that this problem, in post above, only is for retail users. Other users have the shopping cart updatet correct. Cant find out why, and wold be gratful for help.

Can't replicate that error (as a visitor).

 

Is this for a logged-in retail customer or a visitor (considered to be retail in the code)? And where do you add the product to the cart? From product_info.php?

Link to comment
Share on other sites

both.

 

But have installed an early backup, with only osC and SPPC + Price Breake installed, there it works.

 

I have tryed it out and now it seems like there is an error in the sql db, becouse when i add the data from the online shop, it wont work again. Have to take a new look on it and come back to you if i cant get it to work.

 

If you can take a look on my other problem, i be very happy.

http://www.oscommerce.com/forums/topic/53436-seperate-pricing-per-customer-v35/page__view__findpost__p__1496065

 

I have found it some where in the classes folder in PriceFormatterStore.php file.

Link to comment
Share on other sites

both.

 

But have installed an early backup, with only osC and SPPC + Price Breake installed, there it works.

Possibly some interference from code by another contribution then. Good chance this is in the class shopping_cart.php, function add_cart().

 

If you can take a look on my other problem, i be very happy.

That is not a problem with the contribution but you who don't want to type in those numbers in the admin.

 

I assume you can code that because both in PriceFormatter.php and PriceFormatterStore.php the quantity blocks are reset to not carry the value for the retail customer over to other customers groups. For example:

 

 if ($this->cg_id != '0') {
 // re-set qty blocks and min order qty to 1: do not use values for retail customers
     $product_info['qtyBlocks'] = 1;
     $product_info['products_min_order_qty'] = 1;

 

However, if you have added a price for a group (goes in products_groups) automatically a default value of 1 is added for the quantity blocks and min order quantity.

Link to comment
Share on other sites

Yeah, have tried to remove it, and it seems to work a litle.

 

On the product screen it say i can buy 1 item, and when i put it in shopin cart it allows one items, but when i update the sopping cart, it change to the retail qty.

 

So i need to find where to change it in all the places.

 

Its more important to me to have posibility to set one qty block for all then for different customers. So if it is any easy way to make the retail qty block become standard it would help me much.

Link to comment
Share on other sites

In both PriceFormatterStore.php and PriceFormatter.php

 

By removing

if ($this->cg_id != '0') {
 // re-set qty blocks and min order qty to 1: do not use values for retail customers
     $product_info['qtyBlocks'] = 1;
     $product_info['products_min_order_qty'] = 1;

and changing this

// qty blocks already re-set to 1 above
                  if ((int)$new_prices[$i]['qtyBlocks'] > 1 ) {
                    $product_info[$x]['qtyBlocks'] = $new_prices[$i]['qtyBlocks'];
                   }
// min order qty already re-set to 1 above
                  if ((int)$new_prices[$i]['products_min_order_qty'] > 1 ) {
                    $product_info[$x]['products_min_order_qty'] = $new_prices[$i]['products_min_order_qty'];
                   }

to

// qty blocks already re-set to 1 above
                  if ((int)$new_prices[$i]['qtyBlocks'] > 1 ) {
                    $product_info[$x]['qtyBlocks'] = $pg_array['qtyBlocks'];
                   }
// min order qty already re-set to 1 above
                  if ((int)$new_prices[$i]['products_min_order_qty'] > 1 ) {
                    $product_info[$x]['products_min_order_qty'] = $pg_array['products_min_order_qty'];
                   }

 

It works. Only thing who is not working now, is the line in shoping cart, who is telling me that it only can be ordered in 0, even if the cart is updating to 4.

 

Matrox G200 MMS can only by ordered in multiples of 0. Your cart has been updated to reflect this.

Link to comment
Share on other sites

Matrox G200 MMS can only by ordered in multiples of 0. Your cart has been updated to reflect this.

Actually, that is done in includes/header.php (added to an object called $messageStack and then either echo'ed on shopping_cart.php - see line 184-192 of the included file) or echo'ed at the top of the page using header.php when the redirect is not to shopping_cart.php after adding something to the cart.

 

In header.php there is one query, depending on customer group for this. You would need to do two: one for retail and then another one to just get the quantity blocks for the group. If it is 1 or null or 0 (if you made the default in the MySQL table for product groups 0 instead of 1, haven't tested this) you would use the quantity blocks for retail.

Link to comment
Share on other sites

Thanks, it seems to be an easy solution for this then.

 

in header.php replaced

$product_names_query = tep_db_query("select pd.products_id, pd.products_name, pg.products_min_order_qty, pg.products_qty_blocks from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join (select products_id, products_min_order_qty, products_qty_blocks from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customer_group_id . "' and products_id in (" . implode(',', $moq_qtb_pids) . ")) pg on pd.products_id = pg.products_id where pd.products_id in (" . implode(',', $moq_qtb_pids) . ") and pd.language_id = '" . (int)$languages_id . "'");

 

with

      $product_names_query = tep_db_query("select p.products_id, pd.products_name, p.products_min_order_qty, p.products_qty_blocks from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id in (" . implode(',', $moq_qtb_pids) . ") and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

And now it works.

 

I cant have different qty blocks for each user now if i want to, but the posibility is there, just have to make some if variables. But have to wait, need to get the site up and working first.

 

Thanks for all help so far.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...