Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

have some question here :

 

1. if no have customer_group table in data base , then install -----Version 1.02, additional instructions for price break per category------ have some problem right?

 

2. if i don't wanted Creative a Customer_group, but also wanted install Version 1.02, additional instructions for price break per category ---how to do , can JZ post a guide here ?

 

3.Or post here if we need install Version 1.02, additional instructions for price break per category. the database need which table inside !

 

BR

 

many thanks !

 

 

Denis

Share this post


Link to post
Share on other sites

Denis,

1. if no have customer_group table in data base , then install -----Version 1.02, additional instructions for price break per category------ have some problem right?
Yes, then all of SPPC will not work properly I suppose. Especially the admin section.
2. if i don't wanted Creative a Customer_group, but also wanted install Version 1.02, additional instructions for price break per category ---how to do ?
I'm not sure I understand you correctly. You don't want to use SPPC but you do want to use the price break per category modification of the Price Break for SPPC contribution?

 

3.Or post here if we need install Version 1.02, additional instructions for price break per category. the database need which table inside !

If the sql changes were not complete because you had an error (you had that problem, yes?) then you have to see what caused the problem, fix that, check which things were changed (the error might have caused the changes half way down) and then do those again.

Share this post


Link to post
Share on other sites

i only wanted that show in product.php like this: (Quantity and Pricing )

 

1 unit price 229

2 unit price ...

3 unit price ...

http://cn.i-phone.org/main/product.php?&pr...43f5a48133ff8bb

 

can shear this code here? that also need creatived a new database table ?

also here have too when u add something in ship_card .

 

http://cn.i-phone.org/main/cart.php?PHPSES...43f5a48133ff8bb

 

realy this website total code very good, possible if somebody can made that i will order !

 

 

 

BR.,

 

Denis

Share this post


Link to post
Share on other sites

i only wanted that show in product.php like this: (Quantity and Pricing )

 

1 unit price 229

2 unit price ...

3 unit price ...

http://cn.i-phone.org/main/product.php?&pr...43f5a48133ff8bb

 

can shear this code here? that also need creatived a new database table ?

also here have too when u add something in ship_card .

 

http://cn.i-phone.org/main/cart.php?PHPSES...43f5a48133ff8bb

 

realy this website total code very good, possible if somebody can made this website total code i will order !

 

 

 

BR.,

 

Denis

Share this post


Link to post
Share on other sites
i only wanted that show in product.php like this: (Quantity and Pricing )

 

1 unit price 229

2 unit price ...

3 unit price ...

Then you don't need SPPC, but the "regular" Quantity Price Breaks Per Product. The drop-down menu isn't a standard feature though.

 

The website you linked to is not an osCommerce website unless I'm very much mistaken.

Share this post


Link to post
Share on other sites

realy thanks JZ bro here !

 

did the website is not a OSC ver. ?

 

but i saw many function same OSC system !

 

and the drop_menu , u mean the Quantity Price Breaks Per Product can do this or not ?

 

thanks for reply !

 

BR.,

 

Denis

Share this post


Link to post
Share on other sites

Adding in Hiding Product from Cust Groups today.. All went well for the most part, the search is giving me a hard time though

 

http://www.eznails.com/ezshop

 

I have purchased a template from http://www.algozone.com and successfully integrated SPPC

 

After adding in Hide Prod from CG I have this issue:

 

Entering the catalog as a guest with retail pricing or signed in with a retail users account..

 

When using either the standard search or the advanced search (search for dappen) it shows the hidden product priced at $0.00. When the product is clicked then I am told no product exists -- INCORRECT result of this MOD

 

If I navigate to the category (Enhancements ? Acrylic Accessories) or to the MFG pages (NSI is the mfg) I do not see the product - correct result of this MOD

 

 

There are no other MODS installed (yet!).. just these 2..


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites

As the catalog/advanced_search.php will also load the categorieslist by this function, it is recommended to replace the code.

 

 

Hiding Categories for SPPC

 

 

change the function tep_get_categories in catalog/includes/functions/general.php

 

REPLACE the function WITH

  function tep_get_categories($categories_array = '', $parent_id = '0', $indent = '') {
   global $languages_id;
   global $sppc_customer_group_id;
   if (!tep_session_is_registered('sppc_customer_group_id')) {
     $customer_group_id = '0';
   } else {
     $customer_group_id = $sppc_customer_group_id;
   }

   if ($customer_group_id == '0') {
     $additional_constraint = " and c.categories_id NOT IN (" . HIDING_CATEGORIES . ") ";
   } else {
     $additional_constraint = '';
   }

   if (!is_array($categories_array)) $categories_array = array();

   $categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id ."' " . $additional_constraint . " order by sort_order, cd.categories_name");
   while ($categories = tep_db_fetch_array($categories_query)) {
     $categories_array[] = array('id' => $categories['categories_id'],
                                 'text' => $indent . $categories['categories_name']);

     if ($categories['categories_id'] != $parent_id) {
       $categories_array = tep_get_categories($categories_array, $categories['categories_id'], $indent . '  ');
     }
   }

   return $categories_array;
 }

 

 

 

Best regards

G?tz

Share this post


Link to post
Share on other sites
As the catalog/advanced_search.php will also load the categorieslist by this function, it is recommended to replace the code.

Best regards

G?tz

 

Thanks I changed that code and am in the cart now as a guest and the search for "dappen" still gives me the product

 

I have just added in the QTY box MOD and that is working right.. and when I did the search now (dappen) and clicked on the buy now button it sent me to the home page asking if I'd like to log in.. progress.. but the retail people should not see this product at all. Navigating to NSI or Enhancements->Acrylic Accessories shows no products which is correct


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites
Thanks I changed that code and am in the cart now as a guest and the search for "dappen" still gives me the product

 

Debbie,

 

My post was actually not mentioned on your specific problem but on my posting a few post earlier.

 

Please see my post for your understanding.

 

Best regards

G?tz

Share this post


Link to post
Share on other sites
Debbie,

 

My post was actually not mentioned on your specific problem but on my posting a few post earlier.

 

Please see my post for your understanding.

 

Best regards

G?tz

 

 

hehehe OK then that wasn't addressing my issue :) OK thanks

 

any ideas why I am having this problem with the search then??


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites
hehehe OK then that wasn't addressing my issue :) OK thanks

 

any ideas why I am having this problem with the search then??

Sorry, no :( , it works fine in my shop as in the SPPC contribution.

 

Best regards

G?tz

Share this post


Link to post
Share on other sites
Debbie,

I see what goes wrong here: that particular field is indeed not found in the table address book, but is only found in the table customers. It needs a separate database update e.g. like this:

$old_customers_group_id = $_POST['old_customers_group_id'];
if ($old_customers_group_id <= 2 && $customers_group_id >= 3) {
    $sql_data_array_cg_ra = array('customers_group_ra' => '0'); //trying to turn off RA light
           tep_db_perform(TABLE_CUSTOMERS, $sql_data_array_cg_ra, 'update', "customers_id = '" . (int)$customers_id . "'");
} // end if ($old_customers_group_id <= 2 && $customers_group_id >= 3)

      tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");

 

Jan,

 

I've been following the thread between you and Debbie with regards to an e-Mail being sent to customers after their wholesale account has been activated. Unfortunately I'm having probs getting to grips with it and in view of the fact that our site is now live am a bit hesitant. Could you give us a walk-through of that files need changing and the amendments required please?

 

Thanks,

Steve

Share this post


Link to post
Share on other sites
as i get a lot of mail (keep it comming) and i dont know who i answerd and who not... cant keep track sorry  :-"  here is the complete master_listing including sppc / pricebreak to show the right price ;)

 

<?php
/*
?$Id: master_listing.php

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

?Copyright (c) 2003 osCommerce
?
?Master Products MS2 ?- JOHNSON - 05/07/2003 matti@suomedia.com

?Copyright (c) 2003 Suomedia - Dynamic Content Management

?Released under the GNU General Public License
? ?
*/

?$listing_split = new splitPageResults($master_sql, MAX_DISPLAY_SEARCH_RESULTS, 'products_master');
? 
?if ( ($listing_split->number_of_rows > 0) && ( (MASTER_PREV_NEXT_BAR_LOCATION == '1') || (MASTER_PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
?<tr>
? ?<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
? ?<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
?</tr>
</table>
<?php
?}
?
?$list_box_contents = array();

?for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
? ?switch ($column_list[$col]) {
? ? ?case 'MASTER_LIST_MODEL':
? ? ? ?$lc_text = TABLE_HEADING_MODEL;
? ? ? ?$lc_align = '';
? ? ? ?break;
? ? ?case 'MASTER_LIST_NAME':
? ? ? ?$lc_text = TABLE_HEADING_PRODUCTS;
? ? ? ?$lc_align = '';
? ? ? ?break;
? ? ?case 'MASTER_LIST_DESCRIPTION':
? ? ? ?$lc_text = TABLE_HEADING_DESCRIPTION;
? ? ? ?$lc_align = 'center';
? ? ? ?break;
? ? ?case 'MASTER_LIST_ATTRIBUTES':
? ? ? ?$lc_text = TABLE_HEADING_ATTRIBUTES;
? ? ? ?$lc_align = 'center';
? ? ? ?break; ? ? ? ? ? ? ? ?
? ? ?case 'MASTER_LIST_MANUFACTURER':
? ? ? ?$lc_text = TABLE_HEADING_MANUFACTURER;
? ? ? ?$lc_align = '';
? ? ? ?break;
? ? ?case 'MASTER_LIST_PRICE':
? ? ? ?$lc_text = TABLE_HEADING_PRICE;
? ? ? ?$lc_align = 'right';
? ? ? ?break;
? ? ?case 'MASTER_LIST_QUANTITY':
? ? ? ?$lc_text = TABLE_HEADING_QUANTITY;
? ? ? ?$lc_align = 'right';
? ? ? ?break;
? ? ?case 'MASTER_LIST_WEIGHT':
? ? ? ?$lc_text = TABLE_HEADING_WEIGHT;
? ? ? ?$lc_align = 'right';
? ? ? ?break;
? ? ?case 'MASTER_LIST_IMAGE':
? ? ? ?$lc_text = TABLE_HEADING_IMAGE;
? ? ? ?$lc_align = 'center';
? ? ? ?break;
? ? ?case 'MASTER_LIST_BUY_NOW':
? ? ? ?$lc_text = TABLE_HEADING_BUY_NOW;
? ? ? ?$lc_align = 'center';
? ? ? ?break;
? ?}

? ?if ( ($column_list[$col] != 'MASTER_LIST_BUY_NOW') && ($column_list[$col] != 'MASTER_LIST_IMAGE' && ($column_list[$col] != 'MASTER_LIST_MULTIPLE' && ($column_list[$col] != 'MASTER_LIST_DESCRIPTION'))) ) {
? ? ?$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
? ?}

? ?$list_box_contents[0][] = array('align' => $lc_align,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'params' => 'class="productListing-heading"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'text' => ' ' . $lc_text . ' ');
?}

?if ($listing_split->number_of_rows > 0) {
? ?$rows = 0;
? ?$listing_query = tep_db_query($listing_split->sql_query);
// BOF Separate Pricing per Customer, Price Break 1.11.3 modification
? ?$no_of_listings = tep_db_num_rows($listing_query);
// global variable (session) $sppc_customer_group_id -> local variable customer_group_id

?if(!tep_session_is_registered('sppc_customer_group_id')) { 
?$customer_group_id = '0';
?} else {
? $customer_group_id = $sppc_customer_group_id;
?}
?
?$default_settings = array('products_price1' => '0.0000', 'products_price2' => '0.0000', 'products_price3' => '0.0000',
'products_price4' => '0.0000', 'products_price5' => '0.0000', 'products_price6' => '0.0000', 'products_price7' => '0.0000', 'products_price8' => '0.0000', 'products_price1_qty' => '0', 'products_price2_qty' => '0', 'products_price3_qty' => '0', 'products_price4_qty' => '0', 'products_price5_qty' => '0', 'products_price6_qty' => '0', 'products_price7_qty' => '0', 'products_price8_qty' => '0', 'products_qty_blocks' => '1');

while ($_listing = tep_db_fetch_array($listing_query)) {
// let's start with default settings, you never know
$_new_listing =	array_merge($_listing , $default_settings);
$listing[] = $_new_listing;
$list_of_prdct_ids[] = $_listing['products_id'];
} 
// next part is a debug feature, when uncommented it will print the info that this module receives

/* ? echo '<pre>';
? print_r($listing);
? echo '</pre>'; */
?
?$select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
?if ($no_of_listings > 1) {
? for ($n = 1; $n < count($list_of_prdct_ids); $n++) {
? $select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' "; 
? }
}
// to avoid messing with index.php, which is complicated of itself already
// we add another query here to get the price break variables for retail customers
// for other groups we change the $pg_query from the one in SPPC4

? if ($customer_group_id == '0') {
$retail_price_break_query = tep_db_query("select p.products_id, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks from " . TABLE_PRODUCTS . " p where " . $select_list_of_prdct_ids . "");
while ($rp_break = tep_db_fetch_array($retail_price_break_query)) {
?for ($u = 0; $u < $no_of_listings; $u++) {
?	if ($rp_break['products_id'] == $listing[$u]['products_id']) {
? ?$listing[$u]['products_price1'] = $rp_break['products_price1'];
? ?$listing[$u]['products_price2'] = $rp_break['products_price2'];
? ?$listing[$u]['products_price3'] = $rp_break['products_price3'];
? ?$listing[$u]['products_price4'] = $rp_break['products_price4'];
? ?$listing[$u]['products_price5'] = $rp_break['products_price5'];
? ?$listing[$u]['products_price6'] = $rp_break['products_price6'];
? ?$listing[$u]['products_price7'] = $rp_break['products_price7'];
? ?$listing[$u]['products_price8'] = $rp_break['products_price8'];
? ?$listing[$u]['products_price1_qty'] = $rp_break['products_price1_qty'];
? ?$listing[$u]['products_price2_qty'] = $rp_break['products_price2_qty'];
? ?$listing[$u]['products_price3_qty'] = $rp_break['products_price3_qty'];
? ?$listing[$u]['products_price4_qty'] = $rp_break['products_price4_qty'];
? ?$listing[$u]['products_price5_qty'] = $rp_break['products_price5_qty'];
? ?$listing[$u]['products_price6_qty'] = $rp_break['products_price6_qty'];
? ?$listing[$u]['products_price7_qty'] = $rp_break['products_price7_qty'];
? ?$listing[$u]['products_price8_qty'] = $rp_break['products_price8_qty'];
? ?$listing[$u]['products_qty_blocks'] = $rp_break['products_qty_blocks'];
?	} // end if ($rp_break['products_id'] == $listing[$u]['products_id'])
} // end for ($u = 0; $u < $no_of_listings; $u++)
} // end while ($rp_break = tep_db_fetch_array($retail_price_break_query)
? } // end if ($customer_group_id == '0')
? 
// get all product prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
if ($customer_group_id != '0') {
?$pg_query = tep_db_query("select pg.products_id, customers_group_price as price, pg.products_price1, pg.products_price2, pg.products_price3, pg.products_price4, pg.products_price5, pg.products_price6, pg.products_price7, pg.products_price8, pg.products_price1_qty, pg.products_price2_qty, pg.products_price3_qty, pg.products_price4_qty, pg.products_price5_qty, pg.products_price6_qty, pg.products_price7_qty, pg.products_price8_qty, pg.products_qty_blocks from " . TABLE_PRODUCTS_GROUPS . " pg where (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."' ");
// ? $no_of_pg_products = tep_db_num_rows($pg_query);
while ($pg_array = tep_db_fetch_array($pg_query)) {
$new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '', 'final_price' => $pg_array['price'], 'products_price1' => $pg_array['products_price1'], 'products_price2' => $pg_array['products_price2'], 'products_price3' => $pg_array['products_price3'], 'products_price4' => $pg_array['products_price4'], 'products_price5' => $pg_array['products_price5'], 'products_price6' => $pg_array['products_price6'], 'products_price7' => $pg_array['products_price7'], 'products_price8' => $pg_array['products_price8'], 'products_price1_qty' => $pg_array['products_price1_qty'], 'products_price2_qty' => $pg_array['products_price2_qty'], 'products_price3_qty' => $pg_array['products_price3_qty'], 'products_price4_qty' => $pg_array['products_price4_qty'], 'products_price5_qty' => $pg_array['products_price5_qty'], 'products_price6_qty' => $pg_array['products_price6_qty'], 'products_price7_qty' => $pg_array['products_price7_qty'], 'products_price8_qty' => $pg_array['products_price8_qty'], 'products_qty_blocks' => $pg_array['products_qty_blocks']);
}
? for ($x = 0; $x < $no_of_listings; $x++) {
// replace products prices with those from customers_group table
? ? ?if(!empty($new_prices)) {
? ? ? ? for ($i = 0; $i < count($new_prices); $i++) {
? ? if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
?$listing[$x]['products_price'] = $new_prices[$i]['products_price'];
?$listing[$x]['final_price'] = $new_prices[$i]['final_price'];
?$listing[$x]['products_price1'] = $new_prices[$i]['products_price1'];
?$listing[$x]['products_price2'] = $new_prices[$i]['products_price2'];
?$listing[$x]['products_price3'] = $new_prices[$i]['products_price3'];
?$listing[$x]['products_price4'] = $new_prices[$i]['products_price4'];
?$listing[$x]['products_price5'] = $new_prices[$i]['products_price5'];
?$listing[$x]['products_price6'] = $new_prices[$i]['products_price6'];
?$listing[$x]['products_price7'] = $new_prices[$i]['products_price7'];
?$listing[$x]['products_price8'] = $new_prices[$i]['products_price8'];
?$listing[$x]['products_price1_qty'] = $new_prices[$i]['products_price1_qty'];
?$listing[$x]['products_price2_qty'] = $new_prices[$i]['products_price2_qty'];
?$listing[$x]['products_price3_qty'] = $new_prices[$i]['products_price3_qty'];
?$listing[$x]['products_price4_qty'] = $new_prices[$i]['products_price4_qty'];
?$listing[$x]['products_price5_qty'] = $new_prices[$i]['products_price5_qty'];
?$listing[$x]['products_price6_qty'] = $new_prices[$i]['products_price6_qty'];
?$listing[$x]['products_price7_qty'] = $new_prices[$i]['products_price7_qty'];
?$listing[$x]['products_price8_qty'] = $new_prices[$i]['products_price8_qty'];
?$listing[$x]['products_qty_blocks'] = $new_prices[$i]['products_qty_blocks'];
?}
? ? }
} // end if(!empty($new_prices)
$listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group
$listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price
? } // end for ($x = 0; $x < $no_of_listings; $x++)
} // end if ($customer_group_id != '0')

// an extra query is needed for all the specials

$specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "'");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']);
}

// add the correct specials_new_products_price and replace final_price
for ($x = 0; $x < $no_of_listings; $x++) {
? ? ?
? ? ? ?if(!empty($new_s_prices)) {
? ? for ($i = 0; $i < count($new_s_prices); $i++) {
? if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
? ? $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
? ? $listing[$x]['final_price'] = $new_s_prices[$i]['final_price'];
? }
? ? ? ?}
? ?} // end if(!empty($new_s_prices)
} // end for ($x = 0; $x < $no_of_listings; $x++)
? ?
// ? ?while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {

? ? ?$rows++;

? ? ?if (($rows/2) == floor($rows/2)) {
? ? ? ?$list_box_contents[] = array('params' => 'class="productListing-even"');
? ? ?} else {
? ? ? ?$list_box_contents[] = array('params' => 'class="productListing-odd"');
? ? ?}

? ? ?$cur_row = sizeof($list_box_contents) - 1;

? ? ?for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
? ? ? ?$lc_align = '';
? ? ? ?$lc_params = '';

? ? ? ?switch ($column_list[$col]) {
? ? ? ? ?case 'MASTER_LIST_MODEL':
? ? ? ? ? ?$lc_align = '';
? ? ? ? ? ?$lc_text = ' ' . $listing[$x]['products_model'] . ' ';
? ? ? ? ? ?break;
? ? ? ? ?case 'MASTER_LIST_NAME':
? ? ? ? ? ?$lc_align = '';
? ? ? ? ? ?if (isset($HTTP_GET_VARS['manufacturers_id'])) {
? ? ? ? ? ? ?$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$lc_text = ' ' . $listing[$x]['products_name'] . '</a> ';
? ? ? ? ? ?}
? ? ? ? ? ?break;
? ? ? ? ?case 'MASTER_LIST_DESCRIPTION':
? ? ? ? ? ?$lc_align = '';
? ? ? ? ? ?$lc_text = ' ' . osc_trunc_string(strip_tags($listing[$x]['products_description'], '<a><b><em><font><i><s><span><strong><sub><sup><u>'), MASTER_LIST_DESCRIPTION_LENGTH) . ' ';

? ? ? ? ? ?break; ? ? ? ? ? ?
? ? ? ? ?case 'MASTER_LIST_MANUFACTURER':
? ? ? ? ? ?$lc_align = '';
? ? ? ? ? ?$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a> ';
? ? ? ? ? ?break;
? ? ? ? ?case 'MASTER_LIST_PRICE':
? ? ? ? ? ?$lc_align = 'right';
/* ?removed for price break modification
? ? ? ? ? ? ?if (tep_not_null($listing[$x]['specials_new_products_price'])) {
? ? ? ? ? ? ?$lc_text = ' <s>' . ?$currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> ';
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$lc_text = ' ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' ';
? ? ? ? ? ?} end removed for price break modification, see next two lines for replacement code */

? ? ? ? ? ?$pf->parse($listing[$x]);
? ? ? ? ? ?$lc_text = $pf->getPriceStringShort();
? ? ? ? ? ?break;
? ? ? ? ?case 'MASTER_LIST_QUANTITY':
? ? ? ? ? ?$lc_align = 'right';
? ? ? ? ? ?$lc_text = ' ' . $listing[$x]['products_quantity'] . ' ';
? ? ? ? ? ?break;
? ? ? ? ?case 'MASTER_LIST_WEIGHT':
? ? ? ? ? ?$lc_align = 'right';
? ? ? ? ? ?$lc_text = ' ' . $listing[$x]['products_weight'] . ' ';
? ? ? ? ? ?break;
? ? ? ? ?case 'MASTER_LIST_IMAGE':
? ? ? ? ? ?$lc_align = 'center';
? ? ? ? ? ?if (isset($HTTP_GET_VARS['manufacturers_id'])) {
? ? ? ? ? ? ?$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
? ? ? ? ? ?}
? ? ? ? ? ?break;

? ? ? ? ?case 'MASTER_LIST_BUY_NOW': 

? ? ? ? ? ?$lc_align = 'center'; 
? ? ? ? ? ?$lc_valign = 'top';
? ? ? ? ? ?if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing[$x]['products_id']) < 1)) { 
? ? ? ? ? ?$lc_text = TEXT_STOCK;
? ? ? ? ?} elseif ((STOCK_CHECK == 'false')&&(tep_get_products_stock($listing[$x]['products_id']) < 1)) {
? ? ? ? ? ?$qty_array = array();
? ? ? ? ? ?for ($i=0; $ns = 20, $i <= $ns; $i++) {
? ? ? ? ? ?$qty_array[] = array('id' => $i, 'text' => $i); 
? ? ? ? ? ? 
? ? ? ? ? ?$lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing[$x]['products_id'], $qty_array);
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?}
? ? ? ? ?} else {
? ? ? ? ? ?$quantity = tep_get_products_stock($listing[$x]['products_id']); ?
? ? ? ? ? ?$qty_array = array();
? ? ? ? ? ?for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
? ? ? ? ? ?$qty_array[] = array('id' => $i, 'text' => $i); 
? ? ? ? ? ? 
? ? ? ? ? ?$lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing[$x]['products_id'], $qty_array);
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?} 
? ? ? ?}
? ? ? ? ? break;
? ? ? ?}
? ? ? ?$list_box_contents[$cur_row][] = array('align' => $lc_align,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'valign' => $lc_valign,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'params' => 'class="productListing-data"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' ?=> $lc_text);
? ? ?}
? ?}

? ?new productListingBox($list_box_contents);
?} else {
? ?$list_box_contents = array();

? ?$list_box_contents[0] = array('params' => 'class="productListing-odd"');
? ?$list_box_contents[0][] = array('params' => 'class="productListing-data"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => TEXT_NO_PRODUCTS);

? ?new productListingBox($list_box_contents);
?}
?>
? ? <table border="0" width="100%" cellspacing="0" cellpadding="2">
? ? ?<tr>
? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>
? ? </table>
<?php
?if ( ($listing_split->number_of_rows > 0) && ((MASTER_PREV_NEXT_BAR_LOCATION == '2') || (MASTER_PREV_NEXT_BAR_LOCATION == '3')) ) {
?> ? ? 
? ? <table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ?
? ? <tr>
? ? ? ?<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
? ? ? ?<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
? ? </tr>
? ?</table>
? ? ?<tr>
? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>

<?php
?}
?>

 

greetz john

 

Hi,

 

I have now tried to include both SPPC and master products togehter without any luck.I tried what you explained here.

 

But i get this error 1054 - Unknown column 'p.products_price1' in 'field list'

 

select p.products_id, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks from products p where products_id = '2'

 

And i dont now what i should do since the SPPC store the group prices in products_groups.

 

Does anybody now what to do?

 

Best regards

-Thomas-

Share this post


Link to post
Share on other sites
Hi,

 

I have now tried to include both SPPC and master products togehter without any luck.I tried what you explained here.

 

But i get this error 1054 - Unknown column 'p.products_price1' in 'field list'

 

select p.products_id, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks from products p where products_id = '2'

 

And i dont now what i should do since the SPPC store the group prices in products_groups.

 

Does anybody now what to do?

 

Best regards

-Thomas-

 

Thomas,

 

This is looking for the Quantity Price Break mod also. You'll need to install that mod and run the sql and this error should go away.

 

Greg

Edited by mickeymouse

I only do what my Rice Krispies tell me to do!

Share this post


Link to post
Share on other sites

Debbie,

any ideas why I am having this problem with the search then??

Did you make these changes in advanced_search_results.php?

catalog/advanced_search_result.php

Line 359-363

***REPLACE***

   // EOF Separate Pricing Per Customer BOF Hide Products from groups mod

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   $where_str .= " group by p.products_id, tr.tax_priority";
 }
 
***WITH***

   // EOF Separate Pricing Per Customer BOF Hide Products from groups mod

$where_str .= " and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 ";
// EOF hide products from group
 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   $where_str .= " group by p.products_id, tr.tax_priority";
 }

Share this post


Link to post
Share on other sites

Thomas,

I have now tried to include both SPPC and master products togehter without any luck.I tried what you explained here.

 

But i get this error 1054 - Unknown column 'p.products_price1' in 'field list'

 

Does anybody now what to do?

Yes, the idea was to remove the code specific to the price break contribution and end up with only the code needed for SPPC. If you would have succeeded I think it should have looked like this (haven't tested this, so bear with me):

<?php
/*
$Id: master_listing.php
adapted for SPPC by RobinsonDixon

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

Copyright (c) 2003 osCommerce

Master Products MS2  - JOHNSON - 05/07/2003 matti@suomedia.com

Copyright (c) 2003 Suomedia - Dynamic Content Management

Released under the GNU General Public License
  
*/

$listing_split = new splitPageResults($master_sql, MAX_DISPLAY_SEARCH_RESULTS, 'products_master');
 
if ( ($listing_split->number_of_rows > 0) && ( (MASTER_PREV_NEXT_BAR_LOCATION == '1') || (MASTER_PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
  <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
  <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}

$list_box_contents = array();

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
  switch ($column_list[$col]) {
    case 'MASTER_LIST_MODEL':
      $lc_text = TABLE_HEADING_MODEL;
      $lc_align = '';
      break;
    case 'MASTER_LIST_NAME':
      $lc_text = TABLE_HEADING_PRODUCTS;
      $lc_align = '';
      break;
    case 'MASTER_LIST_DESCRIPTION':
      $lc_text = TABLE_HEADING_DESCRIPTION;
      $lc_align = 'center';
      break;
    case 'MASTER_LIST_ATTRIBUTES':
      $lc_text = TABLE_HEADING_ATTRIBUTES;
      $lc_align = 'center';
      break;                
    case 'MASTER_LIST_MANUFACTURER':
      $lc_text = TABLE_HEADING_MANUFACTURER;
      $lc_align = '';
      break;
    case 'MASTER_LIST_PRICE':
      $lc_text = TABLE_HEADING_PRICE;
      $lc_align = 'right';
      break;
    case 'MASTER_LIST_QUANTITY':
      $lc_text = TABLE_HEADING_QUANTITY;
      $lc_align = 'right';
      break;
    case 'MASTER_LIST_WEIGHT':
      $lc_text = TABLE_HEADING_WEIGHT;
      $lc_align = 'right';
      break;
    case 'MASTER_LIST_IMAGE':
      $lc_text = TABLE_HEADING_IMAGE;
      $lc_align = 'center';
      break;
    case 'MASTER_LIST_BUY_NOW':
      $lc_text = TABLE_HEADING_BUY_NOW;
      $lc_align = 'center';
      break;
  }

  if ( ($column_list[$col] != 'MASTER_LIST_BUY_NOW') && ($column_list[$col] != 'MASTER_LIST_IMAGE' && ($column_list[$col] != 'MASTER_LIST_MULTIPLE' && ($column_list[$col] != 'MASTER_LIST_DESCRIPTION'))) ) {
    $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
  }

  $list_box_contents[0][] = array('align' => $lc_align,
                                  'params' => 'class="productListing-heading"',
                                  'text' => ' ' . $lc_text . ' ');
}

if ($listing_split->number_of_rows > 0) {
  $rows = 0;
  $listing_query = tep_db_query($listing_split->sql_query);
// BOF Separate Pricing per Customer
  $no_of_listings = tep_db_num_rows($listing_query);
// global variable (session) $sppc_customer_group_id -> local variable customer_group_id

if(!tep_session_is_registered('sppc_customer_group_id')) { 
$customer_group_id = '0';
} else {
 $customer_group_id = $sppc_customer_group_id;
}

while ($_listing = tep_db_fetch_array($listing_query)) {
// let's start with default settings, you never know
$_new_listing = array_merge($_listing , $default_settings);
$listing[] = $_new_listing;
$list_of_prdct_ids[] = $_listing['products_id'];
} 
// next part is a debug feature, when uncommented it will print the info that this module receives

/*   echo '<pre>';
 print_r($listing);
 echo '</pre>'; */

$select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
if ($no_of_listings > 1) {
 for ($n = 1; $n < count($list_of_prdct_ids); $n++) {
 $select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' "; 
 }
}
 
// get all product prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
if ($customer_group_id != '0') {
$pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."' ");
//   $no_of_pg_products = tep_db_num_rows($pg_query);
  while ($pg_array = tep_db_fetch_array($pg_query)) {
     $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '', 'final_price' => $pg_array['price']);
  }
 for ($x = 0; $x < $no_of_listings; $x++) {
// replace products prices with those from customers_group table
    if(!empty($new_prices)) {
       for ($i = 0; $i < count($new_prices); $i++) {
   if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
$listing[$x]['products_price'] = $new_prices[$i]['products_price'];
$listing[$x]['final_price'] = $new_prices[$i]['final_price'];
   }
  }
} // end if(!empty($new_prices)
$listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group
$listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price
 } // end for ($x = 0; $x < $no_of_listings; $x++)
} // end if ($customer_group_id != '0')

// an extra query is needed for all the specials

$specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "'");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']);
}

// add the correct specials_new_products_price and replace final_price
for ($x = 0; $x < $no_of_listings; $x++) {
    
      if(!empty($new_s_prices)) {
   for ($i = 0; $i < count($new_s_prices); $i++) {
 if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
   $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
   $listing[$x]['final_price'] = $new_s_prices[$i]['final_price'];
 }
      }
  } // end if(!empty($new_s_prices)
} // end for ($x = 0; $x < $no_of_listings; $x++)
  
//    while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {

    $rows++;

    if (($rows/2) == floor($rows/2)) {
      $list_box_contents[] = array('params' => 'class="productListing-even"');
    } else {
      $list_box_contents[] = array('params' => 'class="productListing-odd"');
    }

    $cur_row = sizeof($list_box_contents) - 1;

    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
      $lc_align = '';
      $lc_params = '';

      switch ($column_list[$col]) {
        case 'MASTER_LIST_MODEL':
          $lc_align = '';
          $lc_text = ' ' . $listing[$x]['products_model'] . ' ';
          break;
        case 'MASTER_LIST_NAME':
          $lc_align = '';
          if (isset($HTTP_GET_VARS['manufacturers_id'])) {
            $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
          } else {
            $lc_text = ' ' . $listing[$x]['products_name'] . '</a> ';
          }
          break;
        case 'MASTER_LIST_DESCRIPTION':
          $lc_align = '';
          $lc_text = ' ' . osc_trunc_string(strip_tags($listing[$x]['products_description'], '<a><b><em><font><i><s><span><strong><sub><sup><u>'), MASTER_LIST_DESCRIPTION_LENGTH) . ' ';

          break;            
        case 'MASTER_LIST_MANUFACTURER':
          $lc_align = '';
          $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a> ';
          break;
         case 'MASTER_LIST_PRICE':
           $lc_align = 'right';
           if (tep_not_null($listing[$x]['specials_new_products_price'])) {
             $lc_text = ' <s>' .  $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> ';
           } else {
             $lc_text = ' ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' ';
           }
           break; 
        case 'MASTER_LIST_QUANTITY':
          $lc_align = 'right';
          $lc_text = ' ' . $listing[$x]['products_quantity'] . ' ';
          break;
        case 'MASTER_LIST_WEIGHT':
          $lc_align = 'right';
          $lc_text = ' ' . $listing[$x]['products_weight'] . ' ';
          break;
        case 'MASTER_LIST_IMAGE':
          $lc_align = 'center';
          if (isset($HTTP_GET_VARS['manufacturers_id'])) {
            $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
          } else {
            $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
          }
          break;

        case 'MASTER_LIST_BUY_NOW': 

          $lc_align = 'center'; 
          $lc_valign = 'top';
          if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing[$x]['products_id']) < 1)) { 
          $lc_text = TEXT_STOCK;
        } elseif ((STOCK_CHECK == 'false')&&(tep_get_products_stock($listing[$x]['products_id']) < 1)) {
          $qty_array = array();
          for ($i=0; $ns = 20, $i <= $ns; $i++) {
          $qty_array[] = array('id' => $i, 'text' => $i); 
           
          $lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing[$x]['products_id'], $qty_array);
                      
          }
        } else {
          $quantity = tep_get_products_stock($listing[$x]['products_id']);  
          $qty_array = array();
          for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
          $qty_array[] = array('id' => $i, 'text' => $i); 
           
          $lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing[$x]['products_id'], $qty_array);
                      
          } 
      }
         break;
      }
      $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                             'valign' => $lc_valign,
                                             'params' => 'class="productListing-data"',
                                             'text'  => $lc_text);
    }
  }

  new productListingBox($list_box_contents);
} else {
  $list_box_contents = array();

  $list_box_contents[0] = array('params' => 'class="productListing-odd"');
  $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                 'text' => TEXT_NO_PRODUCTS);

  new productListingBox($list_box_contents);
}
?>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
   </table>
<?php
if ( ($listing_split->number_of_rows > 0) && ((MASTER_PREV_NEXT_BAR_LOCATION == '2') || (MASTER_PREV_NEXT_BAR_LOCATION == '3')) ) {
?>     
   <table border="0" width="100%" cellspacing="0" cellpadding="2">          
   <tr>
      <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
      <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
   </tr>
  </table>
    <tr>
      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>

<?php
}
?>

Share this post


Link to post
Share on other sites

Hi,

How can I show the retail and group price on the product info page

 

IE with

 

399.99

249.99

 

with the 399.99 having a strike through it like how specials are shown?

 

and also is it possible to set a 10% discount to one group for all products...or do i have to manually set each price?

Share this post


Link to post
Share on other sites
How can I show the retail and group price on the product info page

 

IE with

 

399.99

249.99

 

with the 399.99 having a strike through it like how specials are shown?

An example on how to do that can be found in this post (page 34, post #667).

 

and also is it possible to set a 10% discount to one group for all products...or do i have to manually set each price?

To do that in phpMyAdmin (for customer group 1) you could use something like:

insert into products_groups select '1' as customers_group_id, (0.9 * p.products_price) as customers_group_price, p.products_id from products p;

If you already added prices you will get an error message and the process stops. In that case remove those first:

delete from products_groups where customers_group_id = '1';

Share this post


Link to post
Share on other sites
Debbie,

Did you make these changes in advanced_search_results.php?

 

Ahhh I inserted it in the wrong place.. thanks :) that did the trick


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites

Steve,

I've been following the thread between you and Debbie with regards to an e-Mail being sent to customers after their wholesale account has been activated. Unfortunately I'm having probs getting to grips with it and in view of the fact that our site is now live am a bit hesitant. Could you give us a walk-through of that files need changing and the amendments required please?

Backtracking the subject I think these would be correct instructions:

-------------------------
admin/customers.php

**REPLACE** line 824-833

 <td class="main"><?php if ($processed == true) {
   echo $cInfo->customers_group_id . tep_draw_hidden_field('customers_group_id');
 } else {	
 echo tep_draw_pull_down_menu('customers_group_id', $existing_customers_array, $cInfo->customers_group_id);
 } ?></td>
</tr>
<!-- EOF Separate Pricing per Customer -->
       </table></td>
     </tr>
<!-- BOF Separate Pricing per Customer --> 

**WITH**

<td class="main"><?php if ($processed == true) {
  echo $cInfo->customers_group_id . tep_draw_hidden_field('customers_group_id');
  // next line: additional modification
  echo tep_draw_hidden_field('old_customers_group_id');
} else { 
echo tep_draw_pull_down_menu('customers_group_id', $existing_customers_array, $cInfo->customers_group_id);
// next line: additional modification
echo tep_draw_hidden_field('old_customers_group_id', $cInfo->customers_group_id);
} ?></td>
</tr>
<!-- EOF Separate Pricing per Customer -->
      </table></td>
    </tr>
<!-- BOF Separate Pricing per Customer -->

**REPLACE** line 233

       tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");

**WITH**

$old_customers_group_id = $_POST['old_customers_group_id'];
if ($old_customers_group_id <= 2 && $customers_group_id >= 3) {
   $sql_data_array_cg_ra = array('customers_group_ra' => '0'); //turn off RA light
          tep_db_perform(TABLE_CUSTOMERS, $sql_data_array_cg_ra, 'update', "customers_id = '" . (int)$customers_id . "'");
} // end if ($old_customers_group_id <= 2 && $customers_group_id >= 3)

     tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");
     
if ($old_customers_group_id <= 2 && $customers_group_id >= 3) {
$name = $customers_firstname . " " . $customers_lastname;
// perhaps email_text should start with greeting: Dear mr./mrs " . $customers_lastname . ",\n\n
 $email_text = EMAIL_TEXT_WHOLESALER_APPROVAL;
 tep_mail($name, $customers_email_address, EMAIL_SUBJECT_WHOLESALER_APPROVAL, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
} // end if ($old_customers_group_id <= 2 && $customers_group_id .>= 3)
-------------------------

NOTE1: ADD the defines for EMAIL_TEXT_WHOLESALER_APPROVAL and EMAIL_SUBJECT_WHOLESALER_APPROVAL

TO admin/includes/languages/english/customers.php

 

NOTE2: CHANGE: $old_customers_group_id <= 2 && $customers_group_id >= 3 TO YOUR PARTICULAR CASE

for example retail: 0, wholesale 1:

$old_customers_group_id < 1 && $customers_group_id >= 1

Share this post


Link to post
Share on other sites

hi guys, this mod sounds interesting but i am a bit unclear as to what it does.

 

is it possible:

add a customer to special group, arrange a % discount for ALL products in the store for customers in this group?

Share this post


Link to post
Share on other sites
Jan,

 

I've been following the thread between you and Debbie with regards to an e-Mail being sent to customers after their wholesale account has been activated. Unfortunately I'm having probs getting to grips with it and in view of the fact that our site is now live am a bit hesitant. Could you give us a walk-through of that files need changing and the amendments required please?

 

Thanks,

Steve

 

Steve.. I never did get it to send that mail..it does send the generic welcome mail though when they register, in my case we shouldn't have too many wholesale people after the inital ones register, so to manually acknowledge is not an issue here.. if you figure this out let me know though..

 

I would love to have the wholesale poeple get a unique welcome stating they will be notify when their wholesale account has been approved, "meanwhile feel free to browse the retail shoopping area". Have you gotten that to happen???


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites

JanZ,

 

I have an urgent dilemma. I'm currently using SPPC in a weird way, because I don't have the time to figure out how to apply the Credit Class and Gift Voucher system.

 

I'm using SPPC to create a store opening promotion, which is 10% off plus free shipping in North America. The discount is defined manually for all my products (10% less than the retail price for customer group 1), and the free shipping is based on being in customer group 1.

 

I have changed the account creation php file to automatically put customers into group 1. I have put instructions EVERYWHERE in bold red letters that after creating an account, customers need to log off then log back on to see the promo pricing.

 

But nobody is following the instructions, and I just had four orders today that were aborted, probably because the customers thought to themselves "where the hell is that free shipping?"

 

It is totally counter-intuitive to create an account and then not have osC force you to log onto it. I don't understand fully how the code is designed but it seems to let you create an account and then it lets you do whatever you want, within that account, but it doesn't do the customer_group checking upon login, because you never actually log in when you make the account.

 

Is there any way around this? Is there an easy way to FORCE a logoff after account creation, so that the customer has to log in afterwards?

 

Or is there a way for SPPC to display proper pricing without a manual log-in?

 

Please give me some hints -- I think I'm losing business because of this!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×