Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

so what do i do with all those codes that we put before???
Might come in handy one day when you have a special customer or a few special customers who you want to give a discount on one or more articles :)

Make sure you add the languages file for admin/customers_groups if you leave the code in.

Link to comment
Share on other sites

Might come in handy one day when you have a special customer or a few special customers who you want to give a discount on one or more articles :)

Make sure you add the languages file for admin/customers_groups if you leave the code in.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

THANK YOU - THANK YOU - THANK YOU - THANK YOU - THANK YOU - THANK YOU - THANK YOU - THANK YOU

 

Y O U A R E A W E S O M E!!! Y O U A R E A W E S O M E!! Y O U A R E A W E S O M E!!!

DONE@last.jpg

 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

you don't how good it feels... it was endless.. ok

now is working what i wanted it thanks very much.

 

next step.. but its diferent thing...

 

1.- the main category has all the products and order...

 

Ceiling Fans

- - Manufacturer 1

- line 1

prod 1

prod 2

prod 3

 

- line 2

prod 1

 

- - Manufacturer 2

- line 1

prod 1

prod 2

 

- line 2

prod 1

prod 2

prod 3

 

- line 3

prod 1

 

- - Manufacturer 3

- line 1

prod 1

prod 2

prod 3

 

- line 2

prod 1

prod 2

 

- line 3

prod 1

prod 2

prod 3

 

- line 4

 

prod 1

prod 2

prod 3

 

 

so..

 

2.- how can i create a drop down list under the of the main categories.

regarding a for example... assigning a special category, but from diferent manufacturers.

 

we are saying..

 

Ceiling Fans for:

- Bath

Manufacturer 1 - prod 1

Manufacturer 4 - prod 2

Manufacturer 4 - prod 1

Manufacturer 8 - prod 7

 

- Living Room

Manufacturer 1 - prod 1

Manufacturer 4 - prod 1

Manufacturer 10 - prod 4

Manufacturer 12 - prod 3

 

- Bed Room, etc...

Manufacturer 1 - prod 1

Manufacturer 4 - prod 2

Manufacturer 10 - prod 1

Manufacturer 12 - prod 7

 

well nothing else beside to say again thank you

i hope theres is something to use for this..

 

nacho

pd:

but i did never understand how make that sppc contribution work.. so i will ask for that some day soon...

 

\m/

keep on rockin'

Link to comment
Share on other sites

Thanks G?tz!

 

It works, I have been sitting for hours with the categori problem. My next task is to adjust directbuy.php to not show some products for retail. I have been searching for a solution but didn?t find any. Anyone ho knows?

 

/Fredrik

Link to comment
Share on other sites

Hi,

 

On the shopping cart page, I display a "Quote Request" button if Group = Retal '0' and order total=$0, or display the "Checkout" button ... but if cart price > $0 I still see the "Quote Request" button.

<?php // if Retail '0' Cart =$0, display Quote Button
if ($_SESSION['sppc_customer_group_id'] == '0' || !isset($_SESSION['sppc_customer_group_id'])) {
if ( $order->info['subtotal']+$order->info['shipping_cost']==0 ) {
echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_request_quote.gif', IMAGE_BUTTON_REQUEST_QUOTE) . '</a>';
}
} else {
echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>';
}
?>

This must not be working correctly ...

if ( $order->info['subtotal']+$order->info['shipping_cost']==0 )

 

Does anyone see what I'm doing wrong?

 

Thanks,

EricK

Link to comment
Share on other sites

Eric,

On the shopping cart page, I display a "Quote Request" button if Group = Retal '0' and order total=$0, or display the "Checkout" button ... but if cart price > $0 I still see the "Quote Request" button.
As far as I know the class order is not called on the page shopping_cart.php, only on the checkout pages. To know the value of the items in the shopping cart you should therefore rely on the shopping cart class.

 

Perhaps this does what you want:

<?php // if Retail '0' Cart =$0, display Quote Button
if ($_SESSION['sppc_customer_group_id'] == '0' || !isset($_SESSION['sppc_customer_group_id'])) {
$shopping_cart_total = $cart->show_total();
if ( $shopping_cart_total == 0 ) {
echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_request_quote.gif', IMAGE_BUTTON_REQUEST_QUOTE) . '</a>';
} // are you sure about this } ?
} else {
echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>';
}
// shouldn't it be here: ? } // end if ($_SESSION['sppc_customer_group_id'] == '0' || !isset($_SESSION['sppc_customer_group_id']))
?>

Link to comment
Share on other sites

I am using Add Multiple Products to Cart, in columns, for SPPC and I love it!

 

One little thing would make me complete. Does anyone know how to highlight the chosen products to help you see what was selected?

 

Thanks in advance

Link to comment
Share on other sites

Jan,

 

Thanks, that was it so now I'm using ...

 

<?php // if Retail '0' Cart =$0, display Quote Button
if ($_SESSION['sppc_customer_group_id'] == '0' || !isset($_SESSION['sppc_customer_group_id'])) {
$shopping_cart_total = $cart->show_total();
if ( $shopping_cart_total == 0 ) {
echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING2, '', 'SSL') . '">' . tep_image_button('button_request_quote.gif', IMAGE_BUTTON_REQUEST_QUOTE) . '</a>';
} else {
echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>';
}
}
?>

 

Yes, that is _SHIPPING2 you see above, as I've cloned the checkout_shipping.php page into a Quote Form.

 

Thanks again,

EricK

Link to comment
Share on other sites

@JanZ

 

Hi, here Njuwdaij again. You told me to login as the admin through the normal login screen. But which password do I use? I haven't put in a password anywhere, together with the general mail address of the site.

 

And do you know how it is possible that my subcategories have gone missing? Which file does that? Do you know?

 

Thank you!

Link to comment
Share on other sites

Hi, here Njuwdaij again. You told me to login as the admin through the normal login screen. But which password do I use? I haven't put in a password anywhere, together with the general mail address of the site.
You do have to register yourself as a customer on your own site to be able to check all kinds of things. How are you going to see if your shipping or payment modules work as they should? That account can be used to also check those things as a customer in a certain customer group. The issue was that you needed to register yourself with (of course) different email addresses to be able to browse the site as a customer from a different group. Now you only need one account, where you choose the customer group on the login.

 

And do you know how it is possible that my subcategories have gone missing? Which file does that? Do you know?
Not something that SPPC is doing in my opinion. I suppose you are talking about the box with the categories. That would be catalog/includes/boxes/categories.php.
Link to comment
Share on other sites

Hello there,

First of all , many thanks for your work on this. It's been very usefull indeed, this contrib...!

 

After testing and playing around with it, I found, that if you remove a Customer group, the products_group_prices_cg_1 and products_group_prices_cg_2 , and so on are not removed. Even if no customer is connected anymore. This seems a bit strange.

I've tested this with the two mentioned tables, which where not complete.

I had 136 tuples in the products table, and 129 in the products_group_prices_cg_1 table, Although I didn't use insert any seperate prices for group id 1.... Strange?

I've deleted the two tables with phpmyadmin, and now it works.....

 

Any idea?

I checked the code, and in customer_groups.php, with the deleteconfirm function, the above mentioned tables are not deleted, or am I thinking to simple now???

 

 

case 'deleteconfirm':

$group_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);

tep_db_query("delete from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id= " . $group_id);

$customers_id_query = tep_db_query("select customers_id from " . TABLE_CUSTOMERS . " where customers_group_id=" . $group_id);

while($customers_id = tep_db_fetch_array($customers_id_query)) {

tep_db_query("UPDATE " . TABLE_CUSTOMERS . " set customers_group_id = '0' where customers_id=" . $customers_id['customers_id']);

}

tep_redirect(tep_href_link('customers_groups.php', tep_get_all_get_params(array('cID', 'action'))));

break;

 

Reg,

Wim

Link to comment
Share on other sites

Wim,

After testing and playing around with it, I found, that if you remove a Customer group, the products_group_prices_cg_1 and products_group_prices_cg_2 , and so on are not removed. Even if no customer is connected anymore. This seems a bit strange.
True, haven't thought of it. It is not in the uninstall query either (but that is more complicated because the uninstall query does not have any knowledge how many customer groups there were). To include that, first add the define for those tables to admin/includes/database_tables.php to make it read:

  // BOF Separate Pricing per Customer
 define('TABLE_PRODUCTS_GROUPS', 'products_groups');
 define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');
 define('TABLE_PRODUCTS_GROUP_PRICES', 'products_group_prices_cg_');
 // EOF Separate Pricing per Customer

And then change the code in admin/customers_groups.php (starts around line 63, only one line and a comment added) to:

	  case 'deleteconfirm':
	$group_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
	tep_db_query("delete from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id= " . $group_id); 
// updated to also delete products_groups_cg_$group_id table
tep_db_query("drop table if exists " . TABLE_PRODUCTS_GROUP_PRICES.(int)$group_id . "");
	$customers_id_query = tep_db_query("select customers_id from " . TABLE_CUSTOMERS . " where customers_group_id=" . $group_id);
	while($customers_id = tep_db_fetch_array($customers_id_query)) {
		tep_db_query("UPDATE " . TABLE_CUSTOMERS . " set customers_group_id = '0' where customers_id=" . $customers_id['customers_id']);
	}	 
	tep_redirect(tep_href_link('customers_groups.php', tep_get_all_get_params(array('cID', 'action')))); 
	break;

I've tested this with the two mentioned tables, which where not complete.

I had 136 tuples in the products table, and 129 in the products_group_prices_cg_1 table, Although I didn't use insert any seperate prices for group id 1.... Strange?

Perhaps. These tables are only updated when they are needed (when someone does a sort by price in a product listing). Perhaps you added some products after the moment that table was created?
I've deleted the two tables with phpmyadmin, and now it works.....
Their existence shouldn't cause any problems in the functioning of the shop...
Link to comment
Share on other sites

Thnx Jan, for your quick reply.

It works fine now.

The problem was, that if the table wasn't removed, and the group was, if changes in the tables were made, the products_group_cg etc table wasn't updated. even if ordering on pricing was made.

 

But now it al works fine!

Reg,

Wim

Link to comment
Share on other sites

please help im getting this error:

Fatal error: Call to undefined function: link_get_variable() in /home/cust1/user1116323/html/catalog/admin/products_attributes.php on line 18

 

 

its not a brand new installation but all i had done so far was:

 

1. added about 20 test products

2. deleted all product attributes and created my own

3. changed alot of stuff in stylesheet.css

4. created about 3 customers

 

when i installed PPC i did not do it manually... but the only file that had been modified was index.php in /catalog/...

 

the above error occurs in the Admin area; Catalog-->product attributes---> error above

everything else seems to be working fine and wholesale customers see wholesale prices and the same for retail...

i just cant get into my "product attributes" anymore...

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

Fatal error: Call to undefined function: link_get_variable() in /home/cust1/user1116323/html/catalog/admin/products_attributes.php on line 18
This function seems to be neither in SPPC as in default osC. Perhaps it was added for another contribution to admin/includes/functions/general.php and when you used that file from the SPPC package you lost that function? Check a backup (assuming you have one... as you should...).
Link to comment
Share on other sites

Great contribution, no probs with install. No error messages.

 

However, when I assign a customer to a 'Wholesale' group and they log in, the price displayed on product_info.php page is that of the retail group.

 

I have tried to install the contribution Show Price list for SPPC 4.1 v1.0, but it just displays "price Retail" and "Price Wholesale" as being the same :(

 

All the other pages function great, for example when viewing the product as part of the category (I used the great contribution Column Product Listing (for Separate Pricing Per Costomer v4.0)) in index.php, when the product is placed in the shopping cart, even the All Products contribution shows the correct group price.

 

The code on product_info.php page, just relevant for this case, is as follows. I dont suppose anyone can take a quick peek:

 

<?php
 } else {
 // BOF MaxiDVD: Modified For Ultimate Images Pack!
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 // EOF MaxiDVD: Modified For Ultimate Images Pack!
$product_info = tep_db_fetch_array($product_info_query);

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

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

	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
	$product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer

  $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
// BOF Separate Price per Customer
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
	$product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
// EOF Separate Price per Customer
  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

if (tep_not_null($product_info['products_model'])) {
  $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
  $products_name = $product_info['products_name'];
}
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
		<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
	  </tr>
	</table></td>

 

Many thanks/ Luke

Link to comment
Share on other sites

Well, I have just found the fix :lol: :D :thumbsup:

 

I searced on Google to see if anyone else experienced this annoying problem. I found :

 

http://bugtrack.oscmax.com/print_all_bug_p...=-1&show_flag=0

 

which states you have to change, on product_info.php:

 

<html <?php echo HTML_PARAMS;?>>

 

to:

 

<html <?php echo HTML_PARAMS;
 // BOF Separate Pricing Per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
 $customer_group_id = $sppc_customer_group_id;
}
 // EOF Separate Pricing Per Customer
?>>

 

drum roll...... it works like a treat.

 

Has anyone had any experice with this before...do you know if this is the best fix for the problem and if there are any drawbacks with it?

Edited by scanditan
Link to comment
Share on other sites

searced on Google to see if anyone else experienced this annoying problem. I found :

 

which states you have to change, on product_info.php:

 

<html <?php echo HTML_PARAMS;?>>

 

to:

 

<html <?php echo HTML_PARAMS;
 // BOF Separate Pricing Per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
 $customer_group_id = $sppc_customer_group_id;
}
 // EOF Separate Pricing Per Customer
?>>

 

drum roll...... it works like a treat.

 

Has anyone had any experice with this before...do you know if this is the best fix for the problem and if there are any drawbacks with it?

Actually, in SPPC 4.1.1 these exact lines are just above that piece of code, so I don't understand why you had that problem.... In hindsight, perhaps for SPPC it should have been added to application_top.php, but I haven't tried that.
Link to comment
Share on other sites

No no no.. :( I thought this contribution would allow the store owner to assign customers to different groups, not that customers can choose themselves. The store owner wants a wholesale feature. Any suggestions if it's possible to modify SPPC or choosing another contribution instead?

 

I am very delayed with the development, fast support is very much appreciated.

 

Also, there is an error in admin/customers.php. Just above "Streeta address" it says

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lounge24/public_html/devstore2/admin/includes/functions/database.php on line 99

 

Line 99 in database.php;

 

return mysql_fetch_array($db_query, MYSQL_ASSOC);

Edited by Fredrik.r
Link to comment
Share on other sites

Sorry once again. Something went wrong during installation. When using the included customers.php everything looks right. I will have to try to merge the code again.

 

Changes to new_products.php was included in the package but I really need to get SPPC to work for these too;

 

modules/featured.php (Featured Products)

modules/xsell_products.php (X-Sell v2-MS2)

 

I have also done one that displays the 4 most purchased on the front page (under featured products and new products..)

 

Is there an way to modify these files like the new_products.php are modified? There's so much new code with SPPC and I do not understand it all...

 

If you have got the modules for featured products and xsell to work with SPPC, please paste the code here or PM me.

Link to comment
Share on other sites

modules/featured.php (Featured Products)
I think the one in this post is working.
modules/xsell_products.php (X-Sell v2-MS2)
There is one (older) version added to the contribution section by Marvin Miller I think. The code needed is very similar to ones in SPPC files though.
Link to comment
Share on other sites

Thank you!

 

T think that is the catalog\featured_products.php. I'm only using the file featured.php in includes/modules. If I can find an example I probably can modify my best_sellers box in main page too.

 

Ok, I'll look in the contribution area for X-Sell.

Link to comment
Share on other sites

This function seems to be neither in SPPC as in default osC. Perhaps it was added for another contribution to admin/includes/functions/general.php and when you used that file from the SPPC package you lost that function? Check a backup (assuming you have one... as you should...).

 

OK well to fix this i put my "backup" copy of general.php back into /catalog/admin/includes/functions/

and now i CAN access my product attributes again...

 

i was assuming that it would break something else but if it has i havn't found what yet...

 

again, i used my original "general.php" file NOT the one SPPC came with...

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

No no no.. :( I thought this contribution would allow the store owner to assign customers to different groups, not that customers can choose themselves. The store owner wants a wholesale feature. Any suggestions if it's possible to modify SPPC or choosing another contribution instead?

 

I am very delayed with the development, fast support is very much appreciated.

 

Also, there is an error in admin/customers.php. Just above "Streeta address" it says

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lounge24/public_html/devstore2/admin/includes/functions/database.php on line 99

 

Line 99 in database.php;

 

return mysql_fetch_array($db_query, MYSQL_ASSOC);

I must add that we have regular jobs and do understand deadlines. I would suggest that if anyone ever needs fast, immediate support that they hire someone. This is OS which means there isn't a standard tech support offered.

Edited by HallMarc
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...