Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

I may have asked this question before but I know I never got an answer....

 

The idea I had was to make the Admin/Customers page a little more user-friendly. When you are editing a customer's info/price level, there is a text list of the existing levels. You have to exactly type in one of those strings to change the active user's pricing. It would be much better if, instead of a text list, it was a dropdown menu where you could just select a value and hit UPDATE.

 

I tried writing the code myself and got close, but could never get it to work right updating the database. Anyone care to take a stab at this??!!

 

Thanks,

Aaron

Link to comment
Share on other sites

Does anybody know what this proplem is casused by or how to fix it:

 

Warning: reset(): Passed variable is not an array or object in /home/sac9829/sacotech-www/catalog/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/sac9829/sacotech-www/catalog/admin/includes/classes/object_info.php on line 18

 

 

It happens when Im working in the admin section to allow a retail customer to become a wholesale customer. It also resets all the customers information.

Hi there,

 

I am having exactly the same problem with this module and can't seem to get it working. When I click on customers, it clears their details and gives the errors:

 

Warning: reset(): Passed variable is not an array or object in /home/creation/public_html/shop/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/creation/public_html/shop/admin/includes/classes/object_info.php on line 18

 

 

Any help would be greatly appreciated, thanks.

Link to comment
Share on other sites

The file object_info.php was untouched and the code for it is as follows:

 

<?php
/*
 $Id: object_info.php,v 1.6 2003/06/20 16:23:08 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class objectInfo {

// class constructor
   function objectInfo($object_array) {
     reset($object_array);
     while (list($key, $value) = each($object_array)) {
       $this->$key = tep_db_prepare_input($value);
     }
   }
 }
?>

Link to comment
Share on other sites

  • 2 weeks later...

Does anyone have the file admin/specials.php working with full edit fuctions?

 

Right now all I get is a blank screen when I click on the edit button.

 

I would really appreciate it if someone would spend a couple mins to post the code of the working admin specials script.

 

Thanks.

Link to comment
Share on other sites

Does anyone have the file admin/specials.php working with full edit fuctions?

 

Right now all I get is a blank screen when I click on the edit button.

 

I would really appreciate it if someone would spend a couple mins to post the code of the working admin specials script.

 

Thanks.

Anyone? I really need this fix so I can go live.

 

Please take a few min to help out if you can.

 

Thanks.

Link to comment
Share on other sites

I was also thinking of installing this, but I won't if it is not working..  :(

Most of the system works but I cant edit specials, only create and delete old ones.

 

I really wish I could get a fix for the admin specials.php file. :/

 

---

 

Just dont expect to get any support if you cant firgure somthing out.

Edited by Gold!
Link to comment
Share on other sites

  • 2 weeks later...

After installing the latest version of this mod over a fresh install of MS2.2 I was getting an error on line 211 of specials.php, I fixed it by just adding a closing bracket "}" on line 211 before the else.

 

Hope this helps someone!

Link to comment
Share on other sites

Also was able to fix the two object_info.php errors on the customers page. Basically there is a problem with that test account they added, the "jane doe" one.

 

Just manually go into the database, go to the customers table and delete the jane doe account, once you've done that you shouldn't get any errors and can create other accounts.

Link to comment
Share on other sites

I still have two questions that I've never seen addressed....

 

1) Is there a way to have all of the available customer pricing levels show up at the bottm in the Admin Edit Account page other than having to create a fake customer that has each level? In other words, if I want "Wholesale" to show up in the customer price levels list at the bottom of this page, I have to create a fake customer with "Wholesale" pricing. I don't like that at all.

 

2) Has anyone figured out yet how to make this list of price levels a pull down menu instead of just a text list that you have to exactly copy and paste from?

 

-Aaron

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys...i installed this contrib and it is working expcept for one error....

 

eg..

Item 1

Retail Price: $10

Wholesale: $5

 

if im logged in as a wholesale acount it shows item 1 as the proper pricing...the shopping_cart box on the right column shows the proper total price..but when i go into my shoppingcart..and from then on (shipping_confirmation) it shows retail price as item price...i dont know what error has been made...

 

plz help..in which file would this function for calling the total place reside?

Link to comment
Share on other sites

  • 2 weeks later...

Hello, i installled v3.5 earlier and i received this message whenever a new customer registered.

 

1062 - Duplicate entry '9' for key 1

 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('9', '0', now())

 

I also received this message when i tried to set wholesale and vip prices for more than one product in the same category. That is only one product can be set a special wholesale and vip.

 

1062 - Duplicate entry '1' for key 1

 

insert into products_groups (products_id, products_price, customers_group_id, customers_group_price) values ('58', '15.0000', '1', '11.25')

 

[TEP STOP]

 

I also got an error when i run this script, "customers_group_name" already exist.

ALTER TABLE `customers` ADD `customers_group_name` CHAR( 27 ) DEFAULT 'Retail' NOT NULL ,

 

ADD `customers_group_id` INT( 11 ) DEFAULT '0' NOT NULL;

 

 

 

CREATE TABLE `products_groups` (

 

`customers_group_id` INT( 11 ) NOT NULL ,

 

`customers_group_price` DECIMAL( 15, 4 ) NOT NULL ,

 

`products_id` INT( 11 ) NOT NULL ,

 

`products_price` DECIMAL( 15, 4 ) NOT NULL

 

);

 

I would appreicate any tips to fix this, thanks in advance. :D

Link to comment
Share on other sites

hello, I still get this error when i try to set wholesale and vip for prices for the products.

 

1062 - Duplicate entry '1' for key 1

 

insert into products_groups (products_id, products_price, customers_group_id, customers_group_price) values ('58', '15.0000', '1', '11.25')

 

[TEP STOP]

 

Isn't it there can only be one product set with a different wholesale and vip price?

 

Therefore i can't do this?

 

white shirt $10(retail) $5(wholesale) $2.5(vip) <----works perfectly

black shirt $10(retail) $5(wholesale) $2.5(vip) <----error

 

 

Thanks for any help.

Link to comment
Share on other sites

Hi, All who has probs with admin/specials.php

I also could not edit the special, after 1 week of waiting solutions, i dare to look into it by myself.. and found it is extremely easy..

I just added a "}" after

 ? ?if(isset($HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!=0){
? ? ? ?$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $sInfo->products_id . "' and customers_group_id = ?'" . $sInfo->customers_group_id . "'");
? ? ? ? ?if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
? ? ? ? ? ?$sInfo->products_price = $customer_group_price['customers_group_price'];
? ? ? ? ?}
? ?}

Looks like:

 

 ? ?$specials_array = array();
? ?$specials_query = tep_db_query("select p.products_id, s.customers_group_id from " . ?TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
? ?while ($specials = tep_db_fetch_array($specials_query)) {
? ? ? $specials_array[] = (int)$specials['products_id'].":".(int)$specials['customers_group_id'];
? ?}

? ?$customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");
? ?$input_groups=array();
? ?$all_groups=array();
? ?while ($existing_groups = ?tep_db_fetch_array($customers_groups_query)) {
? ? ? ?$input_groups[$sde++]=array("id"=>$existing_groups['customers_group_id'], "text"=> $existing_groups['customers_group_name']);
? ? ? ?$all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
? ?}

? ?if(isset($HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!=0){
? ? ? ?$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $sInfo->products_id . "' and customers_group_id = ?'" . $sInfo->customers_group_id . "'");
? ? ? ? ?if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
? ? ? ? ? ?$sInfo->products_price = $customer_group_price['customers_group_price'];
? ? ? ? ?}
? ?}
} //###################### This is the thing added###
// EOF - Separate_Pricing_Per_Customer_v3.5
?>
? ? ?<tr><form name="new_special" <?php echo 'action="' . tep_href_link(FILENAME_SPECIALS, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('specials_id', $HTTP_GET_VARS['sID']); ?>
? ? ? ?<td><br><table border="0" cellspacing="0" cellpadding="2">
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_PRODUCT; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>
? ? ? ? ?</tr>
<!-- // BOF - Separate_Pricing_Per_Customer_v3.5 -->
? ? ? ? ? <tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_GROUPS; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_pull_down_menu('customers_group', $input_groups, (isset($sInfo->customers_group_id)?$sInfo->customers_group_id:''));?> </td>
? ? ? ? ?</tr>
<!-- EOF - Separate_Pricing_Per_Customer_v3.5 -->
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price : '')); ?></td>
? ? ? ? ?</tr>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE; ?> </td>
? ? ? ? ? ?<td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>
? ? ? ? ?</tr>
? ? ? ?</table></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>
? ? ? ? ? ?<td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
? ? ? ? ?</tr>
? ? ? ?</table></td>
? ? ?</form></tr>
<?php
?} else { //############# Check the code here, make sure no change
?>
? ? ?<tr>
? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
? ? ? ? ?<tr>
? ? ? ? ? ?<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
? ? ? ? ? ? ?<tr class="dataTableHeadingRow">
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
? ? ? ? ? ? ? ?<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
? ? ? ? ? ? ?</tr>

Edited by yongxin
Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I installed the latest version of this contrib and everyth9ing seems to be working fine... although the specials.phph file is not working. When trying to access it is days:

 

Parse error: parse error, unexpected $ in /home2/shopott/public_html/specials.php on line 138

 

The problem is there is no line 138

 

There is no blank lines after the ?> and no spaces.

 

What could be the problem?

 

Thanks

Link to comment
Share on other sites

Somehow, the install instructions are not correct for this MOD as I setup a NEW FRESH OSC install, and copied all the files over the original ones, and the specials is still having issues.

 

Is there a new Version of this mod?

 

Hello,

 

I installed the latest version of this contrib and everyth9ing seems to be working fine... although the specials.phph file is not working. When trying to access it is days:

 

Parse error: parse error, unexpected $ in /home2/shopott/public_html/specials.php on line 138

 

The problem is there is no line 138

 

There is no blank lines after the ?> and no spaces.

 

What could be the problem?

 

Thanks

Link to comment
Share on other sites

Ok, Here are both my specials.php files for catalog and catalog/admin that are working!

 

/catalog/specials.php

<?php
/*
 $Id: specials.php,v 1.49 2003/06/09 22:35:33 hpdl Exp $

 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_SPECIALS);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SPECIALS));
?>
<!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">
</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">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
// BOF Seperate Customer Pricing
// Next line was original code
//  $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC";
 $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . "        where customers_id =  '" . $customer_id . "'");
 $customer_group = tep_db_fetch_array($customer_group_query);
 $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = ". (int)$customer_group['customers_group_id']." order by s.specials_date_added DESC";
// EOF Seperate Customer Pricing
 $specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);

 if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
<?php
   $row = 0;
   $specials_query = tep_db_query($specials_split->sql_query);
   while ($specials = tep_db_fetch_array($specials_query)) {
     $row++;
// BOF Seperate Customer Pricing
         $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . "        where customers_id =  '" . $customer_id . "'");
         $customer_group = tep_db_fetch_array($customer_group_query);

   $row = 0;
   $specials_query = tep_db_query($specials_split->sql_query);
   while ($specials = tep_db_fetch_array($specials_query)) {
     $row++;

         $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $specials['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");
         if ( $customer_group['customers_group_id'] != 0)
           if ($customer_group_price = tep_db_fetch_array($customer_group_price_query))
               $specials['products_price']= $customer_group_price['customers_group_price'];
// EOF Seperate Customer Pricing
     echo '            <td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></td>' . "\n";
}
     if ((($row / 3) == floor($row / 3))) {
?>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
<?php
     }
   }
?>
         </tr>
       </table></td>
     </tr>
<?php
 if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
     <tr>
       <td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="smallText"><?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>
           <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></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>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

Here is the /catalog/admin/specials.php

<?php
/*
 $Id: specials.php,v 1.41 2003/06/29 22:50:52 hpdl Exp $

 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_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
   switch ($action) {
     case 'setflag':
       tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);

       tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'], 'NONSSL'));
       break;
     case 'insert':
       $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
       $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
       $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
       $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
       $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
       $year = tep_db_prepare_input($HTTP_POST_VARS['year']);
// BOF Seperate Customer Pricing
       $customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);
       $price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS. " WHERE products_id = ".(int)$products_id . " AND customers_group_id  = ".(int)$customers_group);
       while ($gprices =  tep_db_fetch_array($price_query)) {
           $products_price=$gprices['customers_group_price'];
       }
// EOF Seperate Customer Pricing

       if (substr($specials_price, -1) == '%') {
         $new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
         $new_special_insert = tep_db_fetch_array($new_special_insert_query);

         $products_price = $new_special_insert['products_price'];
         $specials_price = ($products_price - (($specials_price / 100) * $products_price));
       }

       $expires_date = '';
       if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
         $expires_date = $year;
         $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
         $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
       }
// BOF Seperate Customer Pricing
//        tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1')");
       tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status, customers_group_id) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1', ".(int)$customers_group.")");
// BOF Seperate Customer Pricing
       tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
       break;
     case 'update':
       $specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']);
       $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
       $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
       $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
       $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
       $year = tep_db_prepare_input($HTTP_POST_VARS['year']);

       if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));

       $expires_date = '';
       if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
         $expires_date = $year;
         $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
         $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
       }

       tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id . "'");

       tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id));
       break;
     case 'deleteconfirm':
       $specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);

       tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'");

       tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
       break;
   }
 }
?>
<!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>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<?php
 if ( ($action == 'new') || ($action == 'edit') ) {
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
<?php
 }
?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="popupcalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- 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="2">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
 if ( ($action == 'new') || ($action == 'edit') ) {
   $form_action = 'insert';
   if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
     $form_action = 'update';

     $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");
     $product = tep_db_fetch_array($product_query);

     $sInfo = new objectInfo($product);
   } else {
     $sInfo = new objectInfo(array());

// create an array of products on special, which will be excluded from the pull down menu of products
// (when creating a new product on special)
// BOF Seperate customer pricing
//      $specials_array = array();
//      $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
//      while ($specials = tep_db_fetch_array($specials_query)) {
//        $specials_array[] = $specials['products_id'];
//      }
//    }
   $specials_array = array();
   $specials_query = tep_db_query("select p.products_id, s.customers_group_id from " .  TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
   while ($specials = tep_db_fetch_array($specials_query)) {
      $specials_array[] = (int)$specials['products_id'].":".(int)$specials['customers_group_id'];
   }

   $customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");
   $input_groups=array();
   $all_groups=array();
   while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
       $input_groups[$sde++]=array("id"=>$existing_groups['customers_group_id'], "text"=> $existing_groups['customers_group_name']);
       $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
   }

   if(isset($HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!=0){
       $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $sInfo->products_id . "' and customers_group_id =  '" . $sInfo->customers_group_id . "'");
         if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
           $sInfo->products_price = $customer_group_price['customers_group_price'];
         }
   }
  }
// EOF Seperate customer pricing
?>
     <tr><form name="new_special" <?php echo 'action="' . tep_href_link(FILENAME_SPECIALS, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('specials_id', $HTTP_GET_VARS['sID']); ?>
       <td><br><table border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_PRODUCT; ?> </td>
           <td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>
         </tr>
<!-- BOF Seperate customer pricing  -->
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_GROUPS; ?> </td>
           <td class="main"><?php echo tep_draw_pull_down_menu('customers_group', $input_groups, (isset($sInfo->customers_group_id)?$sInfo->customers_group_id:''));?> </td>
         </tr>
<!-- EOF Seperate customer pricing  -->
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?> </td>
           <td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price : '')); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE; ?> </td>
           <td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>
           <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
         </tr>
       </table></td>
     </form></tr>
<?php
 } else {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr class="dataTableHeadingRow">
               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
             </tr>
<?php
// BOF Seperate Customer Pricing
//    $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";
   $all_groups=array();
   $customers_groups_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id ");
   while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
     $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
   }
   $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.customers_group_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";
// EOF Seperate Customer Pricing
   $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);
   $specials_query = tep_db_query($specials_query_raw);
   while ($specials = tep_db_fetch_array($specials_query)) {
     if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
       $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");
       $products = tep_db_fetch_array($products_query);
       $sInfo_array = array_merge($specials, $products);
       $sInfo = new objectInfo($sInfo_array);
     }

     if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) {
       echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n";
     } else {
       echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n";
     }
// BOF Seperate Customer Pricing
     $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $specials['products_id']. "' and customers_group_id =  '" . $sInfo->customers_group_id . "'");
     if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query))
         $sInfo->products_price=$specials['products_price']=$scustomer_group_price['customers_group_price'];
// EOF Seperate Customer Pricing
?>
               <td  class="dataTableContent"><?php echo $specials['products_name']; ?></td>
<!-- BOF Seperate Customer Pricing //-->
<!--                <td  class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price']); ?></span></td> //-->
               <td  class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price'])." (".$all_groups[$specials['customers_group_id']].")"; ?></span></td>
<!-- EOF Seperate Customer Pricing //-->                
               <td  class="dataTableContent" align="right">
<?php
     if ($specials['status'] == '1') {
       echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=0&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
     } else {
       echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=1&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
     }
?></td>
               <td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
     </tr>
<?php
   }
?>
             <tr>
               <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
                 <tr>
                   <td class="smallText" valign="top"><?php echo $specials_split->display_count($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>
                   <td class="smallText" align="right"><?php echo $specials_split->display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
                 </tr>
<?php
 if (empty($action)) {
?>
                 <tr>
                   <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
                 </tr>
<?php
 }
?>
               </table></td>
             </tr>
           </table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
   case 'delete':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SPECIALS . '</b>');

     $contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm'));
     $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
     $contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
   default:
     if (is_object($sInfo)) {
       $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');

       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
       $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->specials_date_added));
       $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->specials_last_modified));
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
       $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($sInfo->products_price));
       $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));
       $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');

       $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');
       $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));
     }
     break;
 }
 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
   echo '            <td width="25%" valign="top">' . "\n";

   $box = new box;
   echo $box->infoBox($heading, $contents);

   echo '            </td>' . "\n";
 }
}
?>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

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

 

Hope this helps!

Link to comment
Share on other sites

1062 - Duplicate entry '9' for key 1

 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('9', '0', now())

 

[TEP STOP]

 

I get this message after you fill in the application form after a purchase, please could someone tell me how to resolve this.

 

Extremely greatfull for any advice.

 

Mark :'(

Edited by MarkR
Link to comment
Share on other sites

Is there anyone that is supporting this application?

 

I get :

1062 - Duplicate entry '1' for key 1

insert into products_groups (products_id, products_price, customers_group_id, customers_group_price) values ('877', '799.9900', '1', '450.00')

[TEP STOP]

 

When trying to add a Dealer Price to a product..... !

Link to comment
Share on other sites

Hi! First off this contribution is awesome. I have a question that hopefully one of you php savvy users could help me with.

 

We offer free shipping to retail customers, and we don't want to offer it to our dealers. I want to make a comment that says "Dealers do not get free shipping, and shipping charges will be added when order is processed". However I only want this message to show on the checkout page when a dealer is logged in, and not shown to retail. Is this possible? Thanks!

Link to comment
Share on other sites

Hello People,

 

Regarding this contribution, it is very cool and helpful.

 

I just have a minor problem which is not working correctly. It has to do with the taxes. Say for example I want to add a product and the retail has the taxes. How would I do it so the the taxes are not displayed on the Wholesale or VIP ?? It tends to still show taxes for those groups.

Link to comment
Share on other sites

Is there anyone that is supporting this application?

 

I get :

1062 - Duplicate entry '1' for key 1

insert into products_groups (products_id, products_price, customers_group_id, customers_group_price) values ('877', '799.9900', '1', '450.00')

[TEP STOP]

 

When trying to add a Dealer Price to a product..... !

 

 

I really wish someone would answer this. I have the same problem. What's the deal?!?

Link to comment
Share on other sites

I'm also having a minor usability issues with this contribution - it's probably pretty simple.

 

I installed the mod on milestone 2.0 and there are no errors present that I can see in the store functionality.

 

In the admin I can edit people and I do see their Customer Group option.

There are two problems I'm having;

 

How do I make a new Customer Group (such as wholesale)?

Also, when I edit a product there is no list of current customer groups.

 

Can anyone help?

 

Update: I've got it working now. It seems you just add any named group to the user account and then you can edit the product's price. Thanks!

Edited by Marvin Miller

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

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