Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

If anyone else is having the same trouble I was with making product listings into columns, then here is a contribution that I put together (and thats ALL I did).

 

http://www.oscommerce.com/community/contributions,3007

 

-btw- JanZ, teach yourself php in 24 hours (3rd ed.) is FANTASTIC, I'm seeing all sorts of stuff I just now understand throughout osc. (I'm on hour 13). THANKS for the recommendation.

Link to comment
Share on other sites

I would like to thank Jan Z very much for this contribution, it works great!

 

I would also like to know if anyone has worked with the 'Quantity Price Breaks Per Product' contribution and SPPC. I know this contribution changes how product prices are calculated and displayed, but I think it could be very useful.

 

Maybe you can take a look at it Jan?

 

Here is the link to the contribution:

http://www.oscommerce.com/community/contributions,1242

 

Thanks!

 

Mike

Link to comment
Share on other sites

big brown eyes,

 

What modifications may I have to do to have SPPC work with Optimize tep_get_tax_rate() method contribution?
As far as I can see Chemo's great contribution for slashing the large number of queries used by that method only needs a small modification. This worked for me (compare with the file tax.php to see where to put it):

         $tax_rate = ($tax_multiplier - 1.0) * 100;
       } else {
         $tax_rate = 0;
       }
// BOF Separate Pricing Per Customer, tax exempt modification
   global $sppc_customer_group_tax_exempt;
   
    if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) { 
    $customer_group_tax_exempt = '0';
    } else {
    $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;
    }
   
    if ($customer_group_tax_exempt == '1') {
     $tax_rate = 0;
    }
// EOF Separate Pricing Per Customer, tax exempt modification
       $this->tax_rates[$class_id][$country_id][$zone_id]['rate'] = $tax_rate;
     }

     return $this->tax_rates[$class_id][$country_id][$zone_id]['rate'];
   }

Link to comment
Share on other sites

big brown eyes,

 

As far as I can see Chemo's great contribution for slashing the large number of queries used by that method only needs a small modification. This worked for me (compare with the file tax.php to see where to put it):

         $tax_rate = ($tax_multiplier - 1.0) * 100;
       } else {
         $tax_rate = 0;
       }
// BOF Separate Pricing Per Customer, tax exempt modification
   global $sppc_customer_group_tax_exempt;
   
    if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) { 
    $customer_group_tax_exempt = '0';
    } else {
    $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;
    }
   
    if ($customer_group_tax_exempt == '1') {
     $tax_rate = 0;
    }
// EOF Separate Pricing Per Customer, tax exempt modification
       $this->tax_rates[$class_id][$country_id][$zone_id]['rate'] = $tax_rate;
     }

     return $this->tax_rates[$class_id][$country_id][$zone_id]['rate'];
   }

Thanks Jan for this piece of code that is a precious one for me. I do appreciate your help and will keep in mind!

Link to comment
Share on other sites

Hello Janz.

 

Is it feasible to have shipping and payment modules displayed on a group basis?

 

I'm thinking along the lines of having separate shipping table rates for the Retail group to that for the Wholesale group.

 

It would also be nice to have some different payment options for each group as well.

For example Wholesale customers may have an "account" established with the store so they could be offered a modified payment module for that. But the retail customers would not get that option.

 

The modified payment module would be my responsibility of course - I'd just like the option of choosing which groups could use it.

 

Dave.

Link to comment
Share on other sites

Hello Janz.

 

Is it feasible to have shipping and payment modules displayed on a group basis?

 

I'm thinking along the lines of having separate shipping table rates for the Retail group to that for the Wholesale group.

 

It would also be nice to have some different payment options for each group as well.

For example Wholesale customers may have an "account" established with the store so they could be offered a modified payment module for that. But the retail customers would not get that option.

 

The modified payment module would be my responsibility of course - I'd just like the option of choosing which groups could use it.

 

Dave.

 

Booster,

 

Not to take any of JanZ's glory, and just to kind of help out I will answer that; Jan is working on developing exactly what you've requested. I have it on a very high autorithy that the next SPPC might include the option of selecting shipping and payment modules per customer group and per customer. I know personally this development has been in the "works" for a while now (since pre SPPC v.4 release) and I would not rush the final testing/tweaking elements.

 

Nate

 

PS: Jan, do you know if any quantity price break contributions will work with SPPC at all? See storm force's post above-- I too think this could be useful.

Link to comment
Share on other sites

Nate, booster, Storm Force,

Jan, do you know if any quantity price break contributions will work with SPPC at all?
I don't know. I promise I will take a look at it, but I cannot foresee if it is do-able. The groups might complicate the needed queries so much, that it might be overwhelming.

 

the next SPPC might include the option of selecting shipping and payment modules per customer group and per customer.
It will and I don't think you will have to wait long for it anymore.
Link to comment
Share on other sites

I just installed SPPC 4.0 and I have a few questions.

 

1. I have a heavily modded and customized site, and on the product_info.php page I would like to display the List Price along with the logged in user's price separately. Can anyone take a look at this code and tell me how to achieve this? Thanks!!

 

<?php
/*
 $Id: logoff.php,v 1.13 2003/06/05 23:28:24 hpdl Exp $
 adapted for Separate Pricing Per Customer v4.0 2005/01/26
 osCommerce, Open Source E-Commerce Solutions
 [url=http://www.oscommerce.com]http://www.oscommerce.com[/url]

 Copyright ? 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
 
// bof recently viewed contribution  
$visitors_id = $HTTP_COOKIE_VARS['prod_view'];

tep_session_register('visitors_id');
if (isset($prod_view)) {

 @tep_db_query("insert into recently_viewed_more (visitors_id, time) values ('" . $visitors_id . "', '" . time() . "')");

}

$dup_check = tep_db_query("select * from recently_viewed where visitors_id = '" . $visitors_id . "' and products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

if(tep_db_num_rows($dup_check)) {

 tep_db_query("update recently_viewed set time = '" . time() . "' where visitors_id = '" . $visitors_id . "' and products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

} else {

 tep_db_query("insert into recently_viewed (visitors_id, products_id, time) values ('" . $visitors_id . "', '" . $HTTP_GET_VARS['products_id'] . "', '" . time() . "')");

}
// eof recently viewed contribution


 $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);
?>

<!-- begin dynamic meta tags query -->

<?php

$the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, 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_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and pd.language_id ='" .  (int)$languages_id . "'"); 

   $the_product_info = tep_db_fetch_array($the_product_info_query);

$the_product_name = strip_tags ($the_product_info['products_name'], "");

$the_product_description = strip_tags ($the_product_info['products_description'], "");

$the_product_model = strip_tags ($the_product_info['products_model'], "");

?>

<?php

$the_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); 

$the_manufacturers = tep_db_fetch_array($the_manufacturer_query);

?>

<!-- end dynamic meta tags query -->

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
//begin dynamic meta tags query -->
?>

<title><?php echo TITLE; ?> : <?php echo $the_product_name; ?></title>

<meta name="keywords" content="<?php echo TITLE ?>, <?php echo $the_product_name; ?>, <?php echo $the_product_model; ?>, <?php echo $the_manufacturers['manufacturers_name']; ?>">

<meta name="description" content="<?php echo $the_product_name; ?>, or <?php echo $the_product_model; ?>, is manufactured by <?php echo $the_manufacturers['manufacturers_name']; ?>">

<?php
//end dynamic meta tags query -->
?>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=no,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=100,lef
t=100')
}
//--></script>


<script LANGUAGE="JavaScript">
function newWindow(mypage,myname,w,h,features) {
 if(screen.width){
 var winl = (screen.width-w)/2;
 var wint = (screen.height-h)/2;
 }else{winl = 0;wint =0;}
 if (winl < 0) winl = 0;
 if (wint < 0) wint = 0;
 var settings = 'height=' + h + ',';
 settings += 'width=' + w + ',';
 settings += 'top=' + wint + ',';
 settings += 'left=' + winl + ',';
 settings += features;
 win = window.open(mypage,myname,settings);
 win.window.focus();
}


function newImage(arg) {
if (document.images) {
 rslt = new Image();
 rslt.src = arg;
 return rslt;
}
}
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- 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">
<table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php
 if ($product_check['total'] < 1) {
  // BOF Separate Price per Customer
    if(!tep_session_is_registered('sppc_customer_group_id')) { 
    $customer_group_id = '0';
    } else {
     $customer_group_id = $sppc_customer_group_id;
    }
  // EOF Separate Price per Customer
?>
    <tr> 
           <td class="main"><br> <?php echo TEXT_PRODUCT_NOT_FOUND; ?></td>
         </tr>
         <tr> 
           <td align="left"><br> <a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
         </tr>
         <?php
 } else {
 
 $product_info_query = tep_db_query("select p.products_id, p.products_weight, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, 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 . "'");
   $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 = '" . $HTTP_GET_VARS['products_id'] . "' and language_id = '" . $languages_id . "'");


   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
// BOF Separate Price per Customer

       $scustomer_group_price_query = tep_db_query("select customers_group_price, products_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'];
}
// EOF Separate Price 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 Price per Customer
       $scustomer_group_price_query = tep_db_query("select customers_group_price, products_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'];
}
// EOF Separate Price per Customer

     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   $products_attributes = tep_db_query("select popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");
   if (tep_db_num_rows($products_attributes)) {
     $products_attributes = '1';
   } else {
     $products_attributes = '0';
   }
?>
       <tr> 
         <td>
    <table border="0" width="100%" cellspacing="0" cellpadding="1" class="main">
             <tr> 
               <td colspan="2" valign="top" class="pageHeading"><?php echo $product_info['products_name']; ?></td>
             </tr>
<?php
   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
             <tr> 
               <td colspan="2" valign="top" class="messageStackWarning"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
             </tr>
<?php
}
?>



<script language=Javascript> 
function quickPopUp( url, name, width, height, scrollbars ) { 
var top  = "50"; 
var left = "50"; 

if( scrollbars == null ) scrollbars = "1"; 

str  = ""; 
str += "resizable=0,titlebar=0,menubar=0,"; 
str += "toolbar=0,location=0,directories=0,status=0,"; 
str += "scrollbars=" + scrollbars + ","; 
str += "width=" + width + ","; 
str += "height=" + height + ","; 
str += "top=" + top + ","; 
str += "left=" + left; 

window.open( url, name, str ); 
} 
</script>
             <tr> 
               <td colspan="2" valign="top" class="pageHeading"> </td>
             </tr>
             <tr> 
               <td colspan="2" valign="middle" class="smallText"> <a href="request_more_info.php?products_id=<?php echo $product_info['products_id']; ?>" onmouseover="return escape('Request More Info')"><img src="images/icons/icon_more_info.gif" border="0" title="<?php echo TEXT_REQUEST_MORE_INFO; ?>"></a> 
                   <a href="javascript:quickPopUp( 'product_info_pf.php?products_id=<?php echo $product_info['products_id']; ?>', 'PFdata', 544, 394 )" onmouseover="return escape('Printer Friendly')"><img src="images/icons/icon_printer.gif" border="0" title="<?php echo TEXT_PRINTER_FRIENDLY; ?>"></a> 
                   <a href="tell_a_friend.php?products_id=<?php echo $product_info['products_id']; ?>" onmouseover="return escape('Tell A Friend')"><img src="images/icons/icon_tell_friend.gif" border="0" title="<?php echo TEXT_SEND_LINK_TEXT; ?>"></a> 

      

<?php $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
 $check = tep_db_fetch_array($check_query);

 if ($check['count'] > 0) {
 
   $notif_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', 'NONSSL') . '" onmouseover="return escape('.'Undo Notfication'.')"><img src="images/icons/icon_notifications.gif" border="0" title="Undo Notification"></a>';
   
} else {

   $notif_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', 'NONSSL') . '" onmouseover="return escape('.'Set Notfication'.')"><img src="images/icons/icon_notifications.gif" border="0" title="Set Notification"></a>';
 }

         echo $notif_text ?>
         
                 <?php if (tep_session_is_registered('customer_id')) { ?>
                  
     <a href="<?php echo tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist'); ?>" onmouseover="return escape('Add To Wishlist')"><img src="images/icons/icon_wishlist.gif" border="0" title="<?php echo TEXT_PRODUCT_ADD_TO_WISHLIST; ?>"></a> 
                 <?php
 }
?>
               </td>
             </tr>
    <tr> 
               <td colspan="2" valign="top" class="pageHeading"> </td>
             </tr>
             <tr> 
               <td width="90%" align="center" valign="middle" class="smallText">
<script language="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']), PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT,'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a><br>'; ?>');
</script>
                 <noscript>
                 <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> 
                 </noscript> <br> <table border=0 cellpadding=2 cellspacing=0>
                   <tr>
<?php	
$rowcount_value=2;	
$rowcount=1;   	 
$products_extra_images_query = tep_db_query("SELECT products_extra_image, products_extra_images_id FROM " . TABLE_PRODUCTS_EXTRA_IMAGES . " WHERE products_id='" . $product_info['products_id'] . "'");
while ($extra_images = tep_db_fetch_array($products_extra_images_query)) {
?>
                     <td class="smallText" align="center" width="<?php echo SMALL_IMAGE_WIDTH; ?>" valign="top"> 
                       <script language="javascript">
 document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_EXTRA_IMAGES, 'peiID=' . $extra_images['products_extra_images_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $extra_images['products_extra_image'], addslashes($product_info['products_name']),SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
 </script> <noscript>
 
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $extra_images['products_extra_image']) . '">' . tep_image(DIR_WS_IMAGES . $extra_images['products_extra_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> 
                       </noscript>
     
      </td>
<?php
if ($rowcount == $rowcount_value) {
echo '</tr><tr>'; $rowcount=1;
} else { 
$rowcount=$rowcount+1;
 }
}
?>
                   </tr>
                 </table>
                 <br>
                 <?php echo $lc_text = '' . picto_qty($product_info['products_quantity']) . ''; ?> 
               </td>
               <td align="center" valign="top">
<table width="100%" border="0" cellpadding="3" cellspacing="1">
                               
         <?php
         if ($product_info['products_price'] > 0) {
         ?>
         
         <tr valign="middle"> 
                                   <td align="right" class="productInfo" nowrap><?php echo TEXT_PRODUCT_LIST_PRICE; ?></td>
                                   <td class="productInfoData" nowrap><?php echo $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); ?></td>
                                 </tr>
         
         <?php
         }
         ?>
         <tr valign="middle"> 
                                   <td align="right" class="productInfo" nowrap><?php echo TEXT_PRODUCT_YOUR_PRICE; ?></td>
                                   <td class="productInfoData" nowrap><font color="#CC0033"><b><?php echo $products_price; ?></b></font></td>
                                 </tr>
                                 <tr valign="middle"> 
                                   <td align="right" class="productInfo" nowrap><?php echo TEXT_PRODUCT_WEIGHT; ?></td>
                                   <td class="productInfoData" nowrap><?php echo $product_info['products_weight']; ?> lbs.</td>
                                 </tr>
         <tr valign="middle"> 
                                   <td align="right" class="productInfo" nowrap><?php echo TEXT_PRODUCT_QUANTITY; ?></td>
                                   <td class="productInfoData" nowrap><?php echo $product_info['products_quantity']; ?>
      	 </td>
                                 </tr>
         <?php
   $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);
$reviews_query_average = tep_db_query("select (avg(reviews_rating)) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

   $reviews_average = tep_db_fetch_array($reviews_query_average);
$reveiws_stars = $reviews_average['average_rating'];
$reveiws_rating = number_format($reveiws_stars,0);

?>
                                 
         <?php if ($reviews['count'] < 1) {
          ?>
          <tr valign="top"> 
                                   <td align="right" class="productInfo" nowrap><?php echo TEXT_CURRENT_REVIEWS_AVERAGE; ?></td>
                                   <td class="productInfoData">
           <a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()); ?>"><?php echo TEXT_FIRST_TO_WRITE_REVIEW; ?></a>
      	 </td>
                                 </tr>
                                 <?php
         } else {
                               ?>
          <tr valign="middle"> 
                                   <td align="right" class="productInfo" nowrap><?php echo TEXT_CURRENT_REVIEWS_AVERAGE; ?></td>
                                   <td class="productInfoData">
           <a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()); ?>"><?php echo tep_image(DIR_WS_IMAGES . 'stars_' . $reveiws_rating . '.gif'); ?></a>
      	 </td>
                                 </tr>
          <?php
          }
          ?>
         

	 <form name="cart_quantity" method="post" action="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product', 'NONSSL'); ?>">
         
  <?php
   $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 . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
  ?>
         
           <tr>
             <td valign="top" align="right" class="productInfo" nowrap><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
    <td valign="top" class="productInfoData" nowrap>
<?php
//++++ QT Pro: Begin Changed code
     $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']); 
     require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
     $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
     $pad = new $class($products_id);
     echo $pad->draw();
//++++ QT Pro: End Changed Code
?>

              </td>
            </tr>

<?php
}
?>
            <tr valign="top"> 
              <td align="right" class="productInfo" nowrap><?php echo TEXT_PRODUCT_ADD; ?></td>
              <td class="productInfoData">
     <input type="hidden" name="products_id" value="<?php echo $product_info['products_id']; ?>"> 
              <input type="text" name="quantity" value="1" maxlength="5" size="5"><br> 
              <?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
            </tr>
   
   </form>
                   
</table>
               </td>
             </tr>
   <tr> 
          <td colspan="2" valign="top" class="pageHeading"> </td>
         </tr>
   <tr> 
          <td colspan="2" valign="top" class="main"><?php echo nl2br(stripslashes($product_info['products_description'])); ?></td>
         </tr>
   <tr> 
          <td colspan="2" valign="top" class="pageHeading"><br><br></td>
         </tr>
<?php
 $reviews_query_raw = "select r.reviews_id, rd.reviews_text as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id desc";
 $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

 if ($reviews_split->number_of_rows > 0) {
   if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
?>
   <tr> 
          <td colspan="2" valign="top" class="main">
    <?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?><br>
    <?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?>
    </td>
         </tr>
   <tr>
   <td class="pageHeading"><br></td>
   <td class="pageHeading"><br></td>
   </tr>
<?php
   }

   $reviews_query = tep_db_query($reviews_split->sql_query);
   while ($reviews = tep_db_fetch_array($reviews_query)) {
?>
   <tr> 
          <td colspan="2" valign="top" class="pageHeading">
    <!-- Begin Reviews -->
           <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 valign="top" class="smallText">
         <?php echo '<i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i><br><b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</b></a><br>'; ?>
         <?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_short($reviews['date_added'])); ?>
         </td>
                                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                               </tr>
                               <tr> 
                                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                                 <td valign="top" class="main"><?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br>') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br>'; ?></td>
                                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                               </tr>
                             </table>
        <br>
	 <!-- End Reviews -->
    </td>
         </tr>
<?php
   }
  }
?>
   <tr> 
          <td colspan="2" valign="top" class="pageHeading"><br><br></td>
         </tr>
   <tr> 
          <td colspan="2" valign="top" class="pageHeading">
<?php
//added for X-sell
  if ( (USE_CACHE == 'true') && !SID) { 
   echo tep_cache_also_purchased(3600);
  include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);  
  } else {
     include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);  
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
  }
?>
    </td>
         </tr>
           </table>
   </td>
 </tr>
<?php
}
?>  
   </table>
  </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>
<script language="JavaScript" type="text/javascript" src="includes/javascript/wz_tooltip.js"></script>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by royalfunk
Link to comment
Share on other sites

I like the idea of this mod. How would I change it so that a user can enter a customer code into the tax id field instead of the tax id?

 

I guess the quickest and eaisest is to replace the tax id wording with customer number. Where exactly would I replace this as I'm sure it's in several locations?

 

Thanks

Link to comment
Share on other sites

Aaron,

Also, when I set pricing for a product level in admin, the database table PRODUCTS_GROUPS updates with the proper customer group price, but it does not enter a value for the products_price field.

There is no products_price field in that table:

 

From the install sql:

DROP TABLE IF EXISTS products_groups;
CREATE TABLE products_groups (
 customers_group_id smallint UNSIGNED NOT NULL default '0',
 customers_group_price decimal(15,4) NOT NULL default '0.0000',
 products_id int(11) NOT NULL default '0',
 PRIMARY KEY  (customers_group_id, products_id)
);

 

But if you upgraded from sppc3.5, which you didn't mention, you should have read changelog_v4.txt:

Apart from the new table customers_groups, specials_retail_prices, products_group_prices_cg_# the existing table products_groups was changed also. It no longer needs the entry for products_price. Since the products price is already in the table products it was a. redundant information and b. it turned out it wasn't used either. The code in the admin section that filled that column was taken out of course.
Link to comment
Share on other sites

How would I change it so that a user can enter a customer code into the tax id field instead of the tax id?

 

I guess the quickest and eaisest is to replace the tax id wording with customer number. Where exactly would I replace this as I'm sure it's in several locations?

There is no checking on what the customer types in that field, so it can be anything.

 

The wording in the form (search for ENTRY_COMPANY_TAX_ID ) is found in includes/languages/english.php, but since this was designed for entering a tax id number, it is in the same box as for entering a company name. That might be ackward. If you want to change that, it is a matter of changing the HTML in create_account and one or more of the address_book pages.

Link to comment
Share on other sites

But if you upgraded from sppc3.5, which you didn't mention, you should have read changelog_v4.txt:

 

So then how can I display a line in the product_info.php file that shows what the List Price is? I want to show "List Price" and "Your Price". I had this set up from SPPC 3.5 but of course now it doesn't work. That is the main thing I am looking for. Thanks!

 

 

-Aaron

Link to comment
Share on other sites

So then how can I display a line in the product_info.php file that shows what the List Price is?
Add another field to the relevant query/queries: ", p.products_price as list_price " and then you can echo that on the place where you want to show the retail price.
Link to comment
Share on other sites

Nate, booster, Storm Force,

I don't know. I promise I will take a look at it, but I cannot foresee if it is do-able. The groups might complicate the needed queries so much, that it might be overwhelming.

 

It will and I don't think you will have to wait long for it anymore.

 

I appreciate the queries will be a huge task but the end result would be well worth it.

It's a fundemental flaw in all the "B2B like" contributions that there isn't one (or a workable combination of several) that provides the full range of features that you would expect from that type of package.

Perhaps there are others who can help JanZ out here with ideas on integrating price breaks into the code?

 

As for the shipping and payment support - that's great news! :thumbsup:

Link to comment
Share on other sites

I appreciate the queries will be a huge task
Regarding price-break-1.11.3 (I don't know if there are others with better functionality...) I can tell you that it seems to work on the catalog side now. So actually it looks like I "only" need to integrate the admin/categories pages of the two contributions. This might turn out to be the show stopper but I can't judge that before I tried...
Link to comment
Share on other sites

Regarding price-break-1.11.3 (I don't know if there are others with better functionality...) I can tell you that it seems to work on the catalog side now. So actually it looks like I "only" need to integrate the admin/categories pages of the two contributions. This might turn out to be the show stopper but I can't judge that before I tried...

 

Heres hoping for good news...

 

One thing though, would the price breaks be configurable on a group basis?

Just like the original idea behind the SPPC contribution.

 

B)

Link to comment
Share on other sites

One thing though, would the price breaks be configurable on a group basis?

Just like the original idea behind the SPPC contribution.

That is the whole idea of course, and what makes the whole thing complicated ;)
Link to comment
Share on other sites

I'm a newbie... :(....

 

I have a fresh install and want to add this mod for seperate pricing.

 

My question is if I install this mod and then want to use an excel import mod should as excel or populate. Will I be able to import the additional pricing that this mod uses? If not, how do I import from excel (csv) so that I don't have to manually enter the 2nd price?

 

Thanks

Link to comment
Share on other sites

Is it feasible to have shipping and payment modules displayed on a group basis?

 

Jan completed this very option for the 4.1 release of Separate Pricing :D

I'm working on the documentation/release package for it right now so it should be out shortly (a few days at most).

 

In it you can define applicable payment & shipping methods per group or even at the individual customer level.

 

The 4.1 release will also contain a roll-up of bug fixes found since the 4.0 release and will include both the complete install (for new users who aren't running Separate Price) as well as an easy upgrade path for existing 4.0 users.

 

I just tested out the upgrade docs by doing a manual install (text editor) and it took very little time and worked perfectly so it should be out soon... :thumbsup:

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

Do you have access to phpMyAdmin? That would be the easiest way to upload excel files to your store's database.

 

-Aaron

 

Yes, I do.... I would be intersted in knowing how I would do this though.. However, the problem is that the person working on the shop won't have access.

 

Another question I do have for anyone who can help:

 

I have dealer pricing and retail pricing. When a user places text into the TAX ID field which I have changed the words to dealer number on the html side. I need to be able for an authorized admin to go in and change the access level to dealer pricing. However, the way it is working now.. everyone signs up and the admin would have to go through each record to see who filled in the dealer (TAX ID) field to give them access. How can something be done so that that field is tagged and only those records would wait in a que for approval?

 

Thanks

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...