Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Mark,

According to this post of RobinsonDixon it appears to be doable. I haven't seen any instructions on it. The admin/categories.php must be an absolute horror I assume  :(

I appreciate your reply, Jan.

 

However, RobinsonDixon's reply is useless. He just says: "i have a bit more then that installed... but it is possible!" Thanks alot, RD.

 

I tried to do it myself by manually adding the Master Products code. Everywhere there was an SPPC conditional, I inserted the statements inside of it. Sad to say, it didn't work. The problem appeared to be in product_info.php because that page came up blank. Of course, there could have been problems elsewhere and that was just where they manifested themselves.

 

Anyway, I gave it a shot hoping I'd get lucky, and since I'm not enough of a programmer to debug it, I gave up. I'm going to try to use attributes to achieve my goal by using a multiplier (instead of the +/-) to change the price.

 

Thanks again.

Link to comment
Share on other sites

These are the fields:

 

Tax  Price (ex)  Price (inc)  Total (ex) 

 

And this is where they're coming from from invoice.php. Question is why were they not showing up earlier prior to SPPC?

They must have been there but you didn't notice is my guess. SPPC can't have anything to do with this. The code in invoice.php is not touched by it, neither the class order.php (in the admin side), nor the table orders. Perhaps after specifying a tax, but not setting a number it changed from NULL in the table orders to 0 when an order is made.
Link to comment
Share on other sites

Mark,

However, RobinsonDixon's reply is useless.
True, but that does not mean you cannot contact him directly?
The problem appeared to be in product_info.php because that page came up blank. Of course, there could have been problems elsewhere and that was just where they manifested themselves.
That is a page where you would seem to have least of a problem, since Master Products only changes a few things (I use Master Products, but not SPPC).

 

Anyway, I gave it a shot hoping I'd get lucky, and since I'm not enough of a programmer to debug it, I gave up. I'm going to try to use attributes to achieve my goal by using a multiplier (instead of the +/-) to change the price.

Not an easy one either I'm afraid.

 

I haven't looked at the contribution, but since there is an Advanced Categories Admin module (ACA) for SPPC and one for Master Products that might solve the admin/categories.php nightmare that you would have with the two combined.

Link to comment
Share on other sites

Hi JanZ

 

Is SPPC compatible with Points/Rewards? I can't seem to get them to work together. They share some of the same files and I'm having trouble with the admin/includes/boxes/customers.php page. The code I need to add for PR is inside of your code:

 

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .

 

... and add after.....

 

'<a href="' . tep_href_link(FILENAME_CUSTOMERS_POINTS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_POINTS . '</a><br>' .// Points/Rewards Module V1.50

'<a href="' . tep_href_link(FILENAME_CUSTOMERS_POINTS_PENDING, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_POINTS_PENDING . '</a><br>' .// Points/Rewards Module V1.50

 

 

any suggestion on how to make this work? :'(

Thanks!

Clesha

Link to comment
Share on other sites

Is SPPC compatible with Points/Rewards?  I can't seem to get them to work together.  They share some of the same files and I'm having trouble with the admin/includes/boxes/customers.php page.
I have no idea, since I'm not familiar with that contribution.
any suggestion on how to make this work?

I think this should work in the SPPC modified file admin/includes/boxes/customers.php:

// BOF Separate Pricing Per Customer
 if ($selected_box == 'customers') {
   $contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .
                   '<a href="' . tep_href_link(FILENAME_CUSTOMERS_POINTS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_POINTS . '</a><br>' .// Points/Rewards Module V1.50
                   '<a href="' . tep_href_link(FILENAME_CUSTOMERS_POINTS_PENDING, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_POINTS_PENDING . '</a><br>' .// Points/Rewards Module V1.50
                   '<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a><br>' . 
                   '<a href="' . tep_href_link('customers_groups.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_GROUPS . '</a>');
 }
// EOF Separate Pricing Per Customer

Link to comment
Share on other sites

I have no idea, since I'm not familiar with that contribution.

 

I think this should work in the SPPC modified file admin/includes/boxes/customers.php:

// BOF Separate Pricing Per Customer
 if ($selected_box == 'customers') {
   $contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .
                   '<a href="' . tep_href_link(FILENAME_CUSTOMERS_POINTS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_POINTS . '</a><br>' .// Points/Rewards Module V1.50
                   '<a href="' . tep_href_link(FILENAME_CUSTOMERS_POINTS_PENDING, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_POINTS_PENDING . '</a><br>' .// Points/Rewards Module V1.50
                   '<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a><br>' . 
                   '<a href="' . tep_href_link('customers_groups.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_GROUPS . '</a>');
 }
// EOF Separate Pricing Per Customer

 

 

I added the code this way and it didn't seem to work right. Maybe I missed something. I'll add yours and see if it'll work. Thanks!

Thanks!

Clesha

Link to comment
Share on other sites

Mark,

According to this post of RobinsonDixon it appears to be doable. I haven't seen any instructions on it. The admin/categories.php must be an absolute horror I assume  :(

 

yes its possible, i have installed all the contributions first like

sppc, hide products from groups, quantity price breake!

i also have a second field for products description, ultra pics and a few extra fields like region and litle bits and bobs...

 

then install master products, basicly what i did was copy the complete

case 'insert_product':

case 'update_product':

and renamed all instances of insert an update to

insert_master

update_master

to recive the same field for the master as for the normal products,

also i dont have a extra button for adding a master, i just add a product and chose the checkbox master. cause case insert & case update are the same i still have all fields when i update the master! ussualy when you go back to edit the master you only have the code for the picture, the description, the model number and quantity and manufacture....

 

if anybody needs help please feel free to pm me ;) please be aware that i dont queck here so often so if you need help a litle quicker you can find my mail on the team site also please do not abuse :-"

 

also please do not forget a list of contribs you have installed as i dont have the time to check and guess what you have installed :thumbsup:

 

 

greetz john

Link to comment
Share on other sites

I appreciate your reply, Jan.

 

However, RobinsonDixon's reply is useless. He just says: "i have a bit more then that installed... but it is possible!" Thanks alot, RD.

 

I tried to do it myself by manually adding the Master Products code. Everywhere there was an SPPC conditional, I inserted the statements inside of it. Sad to say, it didn't work. The problem appeared to be in product_info.php because that page came up blank. Of course, there could have been problems elsewhere and that was just where they manifested themselves.

 

Anyway, I gave it a shot hoping I'd get lucky, and since I'm not enough of a programmer to debug it, I gave up. I'm going to try to use attributes to achieve my goal by using a multiplier (instead of the +/-) to change the price.

 

Thanks again.

 

of course my post is useless, but you can contact me :)

 

i will see if i can post a categories.php with just the sppc installed, also with the changes of the masterlisting needed in catalog directory...

 

greetz john

Link to comment
Share on other sites

of course my post is useless, but you can contact me  :)

 

i will see if i can post a categories.php with just the sppc installed, also with the changes of the masterlisting needed in catalog directory...

 

greetz john

Thanks for your response. I was not aware that I could contact people on this forum directly. My apologies if I seemed too...um...blunt.

 

Your post above appears to be more useful, except that it assumes I'm smarter than I actually am. I'm not really a programmer, but I am trying to stumble through this.

 

I'll try to install Master Products again after you post the files you mention above. I hope it works because I really want to use these contribs. A combined SPPC/Master Products would make a great new contrib.

 

Thanks again,

Mark

Link to comment
Share on other sites

I am wanting to disable enable catrgories with the SPPC mod. Is this possible? Im sure this has come up before but Icant find out how to do it.

 

Any help will be greatly appreciated.

I suppose you want something that disables a category for a customer group? No, that hasn't been made as far as I know.

There is Hide Products from customer groups for SPPC so you could hide all the products from a category and kind of get the same thing. The hiding of the link to the category (which would have no products to show) can be done (somewhere in this thread). You would need to hard code that somewhere.

Link to comment
Share on other sites

I suppose you want something that disables a category for a customer group? No, that hasn't been made as far as I know.

There is Hide Products from customer groups for SPPC so you could hide all the products from a category and kind of get the same thing. The hiding of the link to the category (which would have no products to show) can be done (somewhere in this thread). You would need to hard code that somewhere.

 

 

Thanks for your reply JanZ

 

However, I have 331 products in the category I want to disable so quite a laborious task to disable each item. I will search this thread for the solution unless someone is kind enough to tap it on the end.

Link to comment
Share on other sites

Just a quick question about this contribution: when a customer is a retail customer I don't want them to see the wholesale pricing. Is there a way to set the default to show normal pricing at all times unless I specifically put a customer in the wholesale group, then when they log in they view the wholesale pricing. I hope I've made sense.

Link to comment
Share on other sites

Just a quick question about this contribution: when a customer is a retail customer I don't want them to see the wholesale pricing. Is there a way to set the default to show normal pricing at all times unless I specifically put a customer in the wholesale group, then when they log in they view the wholesale pricing. I hope I've made sense.

 

That is actually the way it works by default.

Link to comment
Share on other sites

This is pointed on Pricebreaks per product for SPPC

 

I have done a little mod to get a grossprice and a pecentage field.

if the singleprice field is changed, all pricebreaks change automaticly according to the percentage.

 

I don't post the whole categories as it is 190k and i have added some more mods,

but if you are interessted, i can email it.

 

there have to be javascripts added before the line

<?php echo tep_draw_form('new_product', FILENAME_CATEGORIES:

 

<script language="javascript"><!--
var tax_rates = new Array();
<?php
   for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {
     if ($tax_class_array[$i]['id'] > 0) {
       echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";
     }
   }
?>

function doRound(x, places) {
 return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}

function getTaxRate() {
 var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;
 var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;

 if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
   return tax_rates[parameterVal];
 } else {
   return 0;
 }
}

 

This code is for the singleprice fields

function updateGross() {
 var taxRate = getTaxRate();
 var grossValue = document.forms["new_product"].products_price.value;

 if (taxRate > 0) {
   grossValue = grossValue * ((taxRate / 100) + 1);
 }

 document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
}

function updateNet() {
 var taxRate = getTaxRate();
 var netValue = document.forms["new_product"].products_price_gross.value;

 if (taxRate > 0) {
   netValue = netValue / ((taxRate / 100) + 1);
 }

 document.forms["new_product"].products_price.value = doRound(netValue, 4);
}

 

This code is for the retail pricebreaks:

function updateGross1() {
 var taxRate = getTaxRate();
 var grossValue1 = document.forms["new_product"].products_price1.value;
 var grossPercent1 = document.forms["new_product"].products_percent1.value;
 var grossValue = document.forms["new_product"].products_price.value;
 if (grossPercent1 > 0) {
    grossValue1 = grossValue - ((grossValue * grossPercent1) / 100);
    if (taxRate > 0) {
      grossValue1 = grossValue1 * ((taxRate / 100) + 1);
    }
 } else {
    if (taxRate > 0) {
      grossValue1 = grossValue1 * ((taxRate / 100) + 1);
    }
 }
 document.forms["new_product"].products_price1_gross.value = doRound(grossValue1, 4);
}

function updateNet1() {
 var taxRate = getTaxRate();
 var netValue1 = document.forms["new_product"].products_price1_gross.value;

 if (taxRate > 0) {
   netValue1 = netValue1 / ((taxRate / 100) + 1);
 }

 document.forms["new_product"].products_price1.value = doRound(netValue1, 4);
 }

function updatePercent1() {
 var percentgrossValue = document.forms["new_product"].products_price.value;
 var percentgrossValue1 =  document.forms["new_product"].products_price1.value;
 var percent1 = document.forms["new_product"].products_percent1.value;
 percent1 = ((percentgrossValue - percentgrossValue1) / (percentgrossValue / 100));
 document.forms["new_product"].products_percent1.value = doRound(percent1, 4);
}

 

This code is for the new defined customer groups single price fields:

function updateGrossSPPC(i) {
 var taxRate = getTaxRate();
 var grossValue = document.forms["new_product"].elements["sppcprice["+i+"]"].value;

 if (taxRate > 0) {
   grossValue = grossValue * ((taxRate / 100) + 1);
 }

 document.forms["new_product"].elements["sppc_cg_products_price_gross["+i+"]"].value = doRound(grossValue, 4);
}

function updateNetSPPC(i) {
 var taxRate = getTaxRate();
 var netValue = document.forms["new_product"].elements["sppc_cg_products_price_gross["+i+"]"].value;

 if (taxRate > 0) {
   netValue = netValue / ((taxRate / 100) + 1);
 }

 document.forms["new_product"].elements["sppcprice["+i+"]"].value = doRound(netValue, 4);
}

 

This code is for the new defined customer groups pricebreak fields:

function updateGrossSPPC1(i) {
 var taxRate = getTaxRate();
 var grossValueSPPC1 = document.forms["new_product"].elements["sppcproducts_price1["+i+"]"].value;
 var grossPercentSPPC1 = document.forms["new_product"].elements["sppc_cg_products_percent1["+i+"]"].value;
 var grossValue = document.forms["new_product"].elements["sppcprice["+i+"]"].value;
 if (grossPercentSPPC1 > 0) {
    grossValueSPPC1 = grossValue - ((grossValue * grossPercentSPPC1) / 100);
    if (taxRate > 0) {
      grossValueSPPC1 = grossValueSPPC1 * ((taxRate / 100) + 1);
    }
 } else {
 if (taxRate > 0) {
   grossValueSPPC1 = grossValueSPPC1 * ((taxRate / 100) + 1);
   }
 }
 document.forms["new_product"].elements["sppc_cg_products_price1_gross["+i+"]"].value = doRound(grossValueSPPC1, 4);
}

function updateNetSPPC1(i) {
 var taxRate = getTaxRate();
 var netValueSPPC1 = document.forms["new_product"].elements["sppc_cg_products_price1_gross["+i+"]"].value;

 if (taxRate > 0) {
   netValueSPPC1 = netValueSPPC1 / ((taxRate / 100) + 1);
 }

 document.forms["new_product"].elements["sppcproducts_price1["+i+"]"].value = doRound(netValueSPPC1, 4);
}

function updatePercentSPPC1(i) {
 var percentgrossValue = document.forms["new_product"].elements["sppcprice["+i+"]"].value;
 var percentgrossValueSPPC1 =  document.forms["new_product"].elements["sppcproducts_price1["+i+"]"].value;
 var percentSPPC1 = document.forms["new_product"].elements["sppc_cg_products_percent1["+i+"]"].value;
 percentSPPC1 = ((percentgrossValue - percentgrossValueSPPC1) / (percentgrossValue / 100));
 document.forms["new_product"].elements["sppc_cg_products_percent1["+i+"]"].value = doRound(percentSPPC1, 4);
}

 

This has to be done for each pricebreak, so you need up to 8 times this functions according to your installation.

 

 

The section with the inputfields look like this:

For the retail single prices

 

          <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross();updateGross1();updateNet1();updateGross2();updateNet2();updateGross3();updateNet3();updateGross4();updateNet4();updateGross5();updateNet5();updateGross6();updateNet6();updateGross7();updateNet7();updateGross8();updateNet8();"'); ?></td>
         </tr>
         <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet();updateGross1();updateNet1();updateGross2();updateNet2();updateGross3();updateNet3();updateGross4();updateNet4();updateGross5();updateNet5();updateGross6();updateNet6();updateGross7();updateNet7();updateGross8();updateNet8();"'); ?></td>
         </tr>

 

For the retail pricebreaks

          <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE1_NET; ?></td>
           <td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price1', $pInfo->products_price1, 'onKeyUp="updateGross1(); updatePercent1();"'); ?></td>
           <td class="main" align="right"><?php echo TEXT_PRODUCTS_PERCENT1; ?> </td>
           <td class="main" align="left"><?php echo tep_draw_input_field('products_percent1','0','size="7" OnKeyUp="updateGross1(); updateNet1();"'); ?></td>
           <td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE1_QTY; ?> </td>
           <td class="main" align="left"><?php echo tep_draw_input_field('products_price1_qty', $pInfo->products_price1_qty, 'size="10"'); ?></td>
           </tr></table></td>
         </tr>
         <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE1_GROSS; ?></td>
           <td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price1_gross', $pInfo->products_price1, 'OnKeyUp="updateNet1(); updatePercent1();"'); ?></td>
           </tr></table></td>
         </tr>

 

for the customer groups single price fields:

          <tr bgcolor="#CACAFF">
           <td class="main"><?php
             if (isset($pInfo->sppcoption)) {
               echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', (isset($pInfo->sppcoption[ $customers_group['customers_group_id']])) ? 1: 0);
             } else {
               echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . ' <strong>' . $customers_group['customers_group_name'] . '</strong>';
             }
?>
            </td>
           <td class="main">
<?php
             $customer_prices_set = false;
             $customer_prices_in_post = false;
             if ($attributes = tep_db_fetch_array($attributes_query)) {
               $customer_prices_set = true;
               echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_PRICE_NET . ' ' . tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $attributes['customers_group_price'], 'OnKeyUp="updateGrossSPPC(' . $customers_group['customers_group_id'] . ')"');
             } else {
               if (isset($pInfo->sppcprice[$customers_group['customers_group_id']])) { // when a preview was done and the back button used
                   $customer_prices_in_post = true;
                   $sppc_cg_price = $pInfo->sppcprice[$customers_group['customers_group_id']];
               } else { // nothing in the db, nothing in the post variables
                      $sppc_cg_price = '';
               }
               echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_PRICE_NET . ' ' . tep_draw_input_field('sppcprice[' . $customers_group['customers_group_id'] . ']', $sppc_cg_price, 'OnKeyUp="updateGrossSPPC(' . $customers_group['customers_group_id'] . ');updateGrossSPPC1(' . $customers_group['customers_group_id'] . ');updateNetSPPC1(' . $customers_group['customers_group_id'] . ');updateGrossSPPC2(' . $customers_group['customers_group_id'] . ');updateNetSPPC2(' . $customers_group['customers_group_id'] . ');updateGrossSPPC3(' . $customers_group['customers_group_id'] . ');updateNetSPPC3(' . $customers_group['customers_group_id'] . ');updateGrossSPPC4(' . $customers_group['customers_group_id'] . ');updateNetSPPC4(' . $customers_group['customers_group_id'] . ');updateGrossSPPC5(' . $customers_group['customers_group_id'] . ');updateNetSPPC5(' . $customers_group['customers_group_id'] . ');updateGrossSPPC6(' . $customers_group['customers_group_id'] . ');updateNetSPPC6(' . $customers_group['customers_group_id'] . ');updateGrossSPPC7(' . $customers_group['customers_group_id'] . ');updateNetSPPC7(' . $customers_group['customers_group_id'] . ');updateGrossSPPC8(' . $customers_group['customers_group_id'] . ');updateNetSPPC8(' . $customers_group['customers_group_id'] . ');"');
             } // end else
?>
           </td>
         </tr>
         <tr bgcolor="#CACAFF">
           <td class="main"></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_PRICE_GROSS . ' ' . tep_draw_input_field('sppc_cg_products_price_gross[' . $customers_group['customers_group_id'] . ']', 0, 'OnKeyUp="updateNetSPPC(' . $customers_group['customers_group_id'] . ');updateGrossSPPC1(' . $customers_group['customers_group_id'] . ');updateNetSPPC1(' . $customers_group['customers_group_id'] . ');updateGrossSPPC2(' . $customers_group['customers_group_id'] . ');updateNetSPPC2(' . $customers_group['customers_group_id'] . ');updateGrossSPPC3(' . $customers_group['customers_group_id'] . ');updateNetSPPC3(' . $customers_group['customers_group_id'] . ');updateGrossSPPC4(' . $customers_group['customers_group_id'] . ');updateNetSPPC4(' . $customers_group['customers_group_id'] . ');updateGrossSPPC5(' . $customers_group['customers_group_id'] . ');updateNetSPPC5(' . $customers_group['customers_group_id'] . ');updateGrossSPPC6(' . $customers_group['customers_group_id'] . ');updateNetSPPC6(' . $customers_group['customers_group_id'] . ');updateGrossSPPC7(' . $customers_group['customers_group_id'] . ');updateNetSPPC7(' . $customers_group['customers_group_id'] . ');updateGrossSPPC8(' . $customers_group['customers_group_id'] . ');updateNetSPPC8(' . $customers_group['customers_group_id'] . ');"'); ?></td>
         </tr>

<script language="javascript"><!--
updateGrossSPPC(<?php echo $customers_group['customers_group_id'] ?>);
//--></script>

 

for the customer group pricebreak fields

          <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE1_NET; ?></td>
           <td colspan="3" align="left" class="main"><table border="0" cellspacing="0" cellpadding="0" width="80%"><tr>
           <td class="main" align="left"><?php if ($customer_prices_set == true) {
           $sppc_cg_products_price1 = $attributes['products_price1'];
           } elseif ($customer_prices_in_post == true) {
                  $sppc_cg_products_price1 = $pInfo->sppcproducts_price1[$customers_group['customers_group_id']];
           } else {
                   $sppc_cg_products_price1 = '';
           }
           echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppcproducts_price1[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price1, 'onKeyUp="updateGrossSPPC1(' . $customers_group['customers_group_id'] . '); updatePercentSPPC1(' . $customers_group['customers_group_id'] . ');"'); ?></td>
           <td class="main" align="right"><?php echo TEXT_PRODUCTS_PERCENT1; ?> </td>
           <td class="main" align="left"><?php echo tep_draw_input_field('sppc_cg_products_percent1[' . $customers_group['customers_group_id'] . ']','0','size="7" OnKeyUp="updateGrossSPPC1(' . $customers_group['customers_group_id'] . '); updateNetSPPC1(' . $customers_group['customers_group_id'] . ');"'); ?></td>
           <td class="main" align="right"><?php echo TEXT_PRODUCTS_PRICE1_QTY; ?></td>
           <td class="main" align="left"><?php if ($customer_prices_set == true) {
           $sppc_cg_products_price1_qty = $attributes['products_price1_qty'];
           } elseif ($customer_prices_in_post == true) {
                  $sppc_cg_products_price1_qty = $pInfo->sppcproducts_price1_qty[$customers_group['customers_group_id']];
           } else {
                   $sppc_cg_products_price1_qty = '';
           }
           echo tep_draw_input_field('sppcproducts_price1_qty[' . $customers_group['customers_group_id'] . ']', $sppc_cg_products_price1_qty, 'size="10"'); ?></td>
           </tr></table></td>
         </tr>
         <tr bgcolor="#ebebff">
           <td class="main"><?php echo TEXT_PRODUCTS_PRICE1_GROSS; ?></td>
           <td colspan="3" align="left"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sppc_cg_products_price1_gross[' . $customers_group['customers_group_id'] . ']', 0, 'OnKeyUp="updateNetSPPC1(' . $customers_group['customers_group_id'] . '); updatePercentSPPC1(' . $customers_group['customers_group_id'] . ');"'); ?></td>
           </tr></table></td>
         </tr>

 

If someone wants the whole categories.php for merging, please pm me.

G?tz

Link to comment
Share on other sites

What is the latest version of these contributions? I checked the contribution pages and saw that 4.1 was removed. I want to set-up separate pricing for retailers based on previously negotiated pricing. Then have have retail or MSRP for the default pricing for visitors. Showing/Hiding categories or products sounds good too, if by default they are hidden.

 

Another question: Is there a contribution that would provide this scenario:

 

If you buy "x" amount of this product, you get these other products for free or at a deep discount.

 

If not, I may seek contract development for this. I am pretty good, but this is time sensitive.

· willross

··········

Link to comment
Share on other sites

What is the latest version of these contributions? I checked the contribution pages and saw that 4.1 was removed.
Latest version is 4.1.1. Version 4.1 was not removed, it never made it past the moderators in time for version 4.1.1. Since it was available on Marvin Miller's website, the HTML documentation from that version was uploaded separately later.
Then have have retail or MSRP for the default pricing for visitors.
Standard behaviour of SPPC.
Showing/Hiding categories or products sounds good too, if by default they are hidden.
Hide Products from customer groups for SPPC does that yes.

 

Another question: Is there a contribution that would provide this scenario:

 

If you buy "x" amount of this product, you get these other products for free or at a deep discount.

Doesn't sound familiar.
Link to comment
Share on other sites

i will see if i can post a categories.php with just the sppc installed, also with the changes of the masterlisting needed in catalog directory...

 

greetz john

Have you made any progress on this?

 

I'm having another go at it myself, but I'm not optimistic. I appreciate, and need, all the help I can get.

 

Thanx,

Mark

Link to comment
Share on other sites

Latest version is 4.1.1. Version 4.1 was not removed, it never made it past the moderators in time for version 4.1.1. Since it was available on Marvin Miller's website, the HTML documentation from that version was uploaded separately later.

Standard behaviour of SPPC.

Hide Products from customer groups for SPPC does that yes.

 

Doesn't sound familiar.

There is the Quantity Price Breaks for Separate Pricing Per Customer contribution:

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

 

here's the description from the original contribution:

This is useful if you need to give your customers different prices based on the quantity they order. (volume discounts)

 

The product information page will display a table of the price break prices if a product has been configured to use price breaks.

 

You can set up different price breaks for each customer group. The only downside that I have seen is that the price break values do not import through Easy Populate (if you're using it) for every customer group.

 

Hope this helps, DC

Link to comment
Share on other sites

JanZ,

 

There are a few small contributions out there that allow a user to enter a quantity directly in the product listing (and also in product description, etc.) before clicking on the buy button (which should then be changed to add to cart).

 

I have tried these contributions, but they never work. I have a strong suspicion it is because of SPPC and the fact that the data structure for pricing is more complex (two-dimensional array)?

 

Is there any change you can give me a hand with this? Or direct my to a contribution or code snippet that works with SPPC?

 

All I want is for the customer to be able to have a small textbox where they enter quantity, before hitting a buy/add button. I'd like this in product_listing.php, and in the product_info.php, and if possible in the popup_image.php as well.

 

Any tips are appreciated. This was a code fragment that did NOT work for me (I could click on it but then it went to a Product not found! page). It's from /catalog/includes/modules/product_listing.php:

 

/* THIS IS THE OLD CODE, WHICH DOESN'T ALLOW YOU TO ENTER QUANTITIES */

         case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
           break;

// Begin my new quantity box thingie
// but figure out how to make it work with my SPPC modifications. man this is complicated.


/*
  	 case 'PRODUCT_LIST_BUY_NOW':
  	 $lc_align = 'center';
  	 $lc_text = '<form name="cart_quantity" method="post" action="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product', 'NONSSL'). '"><input type="hidden" name="products_id" value="' . $listing['products_id'] . '"><input type="text" name="quantity" value="1" maxlength="5" size="5"><br>' . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</form>';
  	 break;

*/

// End my new quantity box thingie

 

I tried to use $listing[$x] instead of $listing, but it didn't work. Also, I am very concerned about that 'NONSSL' argument -- shouldn't osC be deciding whether to use SSL or not, based on current session?

Link to comment
Share on other sites

I have tried these contributions, but they never work. I have a strong suspicion it is because of SPPC and the fact that the data structure for pricing is more complex (two-dimensional array)?
Not really. The only change to the particular part of the product_listing is that you have to use $listing[$x]['db_field'] instead of $listing['db_field'] because the mysql fetch array has already been done and now a "for ($x = 0; $x < $no_of_listings; $x++)" is used.

 

Is there any change you can give me a hand with this? Or direct my to a contribution or code snippet that works with SPPC?
Apart from the [$x] there really shouldn't be anything different. I assume these contributions also make changes to application_top to catch the POST variable 'quantity'? Perhaps there is the problem.

Which contribution are you trying to use?

Also, I am very concerned about that 'NONSSL' argument -- shouldn't osC be deciding whether to use SSL or not, based on current session?

I think that part of the website is always NONSSL (only login and checkout pages being SSL protected) so it wouldn't hurt.
Link to comment
Share on other sites

Not really. The only change to the particular part of the product_listing is that you have to use $listing[$x]['db_field'] instead of $listing['db_field'] because the mysql fetch array has already been done and now a "for ($x = 0; $x < $no_of_listings; $x++)" is used.

 

Apart from the [$x] there really shouldn't be anything different. I assume these contributions also make changes to application_top to catch the POST variable 'quantity'? Perhaps there is the problem.

Which contribution are you trying to use?

I think that part of the website is always NONSSL (only login and checkout pages being SSL protected) so it wouldn't hurt.

 

I managed to fix it, using different code that I got from somewhere else. The problem, I think, was that there were two references to $listing and I had only changed one of them to $listing[$x].

 

In case anyone searching for this months or years later wants to know how to do it with SPPC, this worked for me:

 

/catalog/includes/modules/product_listing.php:

 

          case 'PRODUCT_LIST_BUY_NOW':
         $lc_align = 'center';
         $lc_text = tep_draw_form('buy_now' . $listing[$x]['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']), 'POST') . ' ' . tep_draw_input_field('list_quantity', '1', 'size=2') .'   '. tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</form> ';
         break;

 

/catalog/includes/application_top.php:

 

      case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {

                               if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+$list_quantity);
                               }
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;
                         

Link to comment
Share on other sites

What if almost every customer has "special pricing", at least for specific products? I can see the problem when a store has 100's or 1000's of products and 100's of customers, each with "special pricing".

 

If there is no answer out there, what if the customer db info carries the special pricing? For example: Customer A gets 5% OFF everything in the store, except product-202. There could be extra fields for each customer that would hold the info for $5.00 OFF, 5% OFF, excluded product id's, etc. then have a page where these conditions could be added to each customer from within the admin.

· willross

··········

Link to comment
Share on other sites

What if almost every customer has "special pricing", at least for specific products? I can see the problem when a store has 100's or 1000's of products and 100's of customers, each with "special pricing".
Good point.

 

If there is no answer out there, what if the customer db info carries the special pricing? For example: Customer A gets 5% OFF everything in the store, except product-202. There could be extra fields for each customer that would hold the info for $5.00 OFF, 5% OFF, excluded product id's, etc. then have a page where these conditions could be added to each customer from within the admin.

Sounds too complicated to me. What about a table with customer_id, products_id, customers_price. Then in a query for a price you could either do a left join with this table using products_id or after having collected all the products_id (as is done in product_listing e.g.) do an extra query in this table.

 

That sounds simple to implement, but coding the admin part would take a lot of time I think. Matching up/searching a product/product_id with a customer/customer_id.

Link to comment
Share on other sites

Hi,

Today I installed osc for the first time and added separate pricing per customer 411. Other than changing a few colours in the CSS and changing the currency to GBP I've done nothing else to it.

When I go to the reports I get the following error:

Best Viewed Products

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select p.products_id, pd.products_name, pd.products_viewed, l.name from products p, products_description pd, languages l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed DESC limit -20, 20

 

The other two reports give the same.

 

Obviously I have done something wrong when I followed the sppc_v41_install, I added the tables/fields manually exactly as per. But I'm afraid I am not familar with MySQL, today was the first time I'd looked at a MySQL database. So I'm really stuck on syntax errors.

 

I am hoping I've done something very simple wrong here, do I have to put \ in before ' or something like that?

 

I'd be extremely grateful for help.

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