Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

In Specials.php it says /admin/select_specials.php?page=1&action=new

 

in catalog box it says /admin/select_specials.php

 

Both come up blank

There is no full link then? Something like (if you do a view source):

<!-- // Select Specials Start -->
				<td colspan="2" align="right"><a href="http://192.168.0.9/cat_sppc/admin/select_specials.php?page=1&action=new"><img src="includes/languages/english/images/buttons/button_new_product.gif" border="0" alt="New Product" title=" New Product "></a></td>
<!-- // Select Specials End -->

If the link there is just:

<a href="/admin/select_specials.php?page=1&action=new">

then it is easily understood why it is not working. Looks like your includes/configure.php in the admin section is not right then.

Link to comment
Share on other sites

There is no full link then? Something like (if you do a view source):

<!-- // Select Specials Start -->
				<td colspan="2" align="right"><a href="http://192.168.0.9/cat_sppc/admin/select_specials.php?page=1&action=new"><img src="includes/languages/english/images/buttons/button_new_product.gif" border="0" alt="New Product" title=" New Product "></a></td>
<!-- // Select Specials End -->

If the link there is just:

<a href="/admin/select_specials.php?page=1&action=new">

then it is easily understood why it is not working. Looks like your includes/configure.php in the admin section is not right then.

 

 

Sorry I cut off my website part. full link is https://www.needlecraft.co.nz/catalog/admin...ct_specials.php

 

And https://www.needlecraft.co.nz/catalog/admin...&action=new

 

Uploading a file (as apposed to FTPing) wouldn't change anything would it? I can't currently FTP to my site (Network settings), so I Uploaded using OSCommerce Upload feature, the two files needed for this Contrib. I haven't figured out how, if possible, to CHMOD files through the oscommerce file manager yet.

Link to comment
Share on other sites

Uploading a file (as apposed to FTPing) wouldn't change anything would it? I can't currently FTP to my site (Network settings), so I Uploaded using OSCommerce Upload feature, the two files needed for this Contrib. I haven't figured out how, if possible, to CHMOD files through the oscommerce file manager yet.

Never tried the upload feature in this way I think, but since php files are kind of executable files, they are usually filtered out in upload classes. Don't know if that is the case with osC too. FTP-ing would be the best option of course.

Link to comment
Share on other sites

Never tried the upload feature in this way I think, but since php files are kind of executable files, they are usually filtered out in upload classes. Don't know if that is the case with osC too. FTP-ing would be the best option of course.

 

Got it working.

 

Like you said, Upload filters php files. so I deleted it, and created a new file, and pasted in the code.

 

Thanks for you help Jan, Much appreciated.

 

TJ

Link to comment
Share on other sites

I like this module... but have a question. This might actually be a general osCommerce question though...

 

Is there a way to make so customers can have seperate payment methods? For example, we have retail and wholesale customers... our wholesale customers, are allowed to pay by check so we would like it so that they get the option to "pay by check" when they go to check out, retail cusomers shouldn't have the same option. I want to start coding up such a module, but want to know if others have tried it yet... Is this even possible? Have others tried this?

 

Thank you in advance,

a8le.

Edited by a8le

Thuan Nguyen

Link to comment
Share on other sites

Is there a way to make so customers can have seperate payment methods? For example, we have retail and wholesale customers... our wholesale customers, are allowed to pay by check so we would like it so that they get the option to "pay by check" when they go to check out, retail cusomers shouldn't have the same option. I want to start coding up such a module, but want to know if others have tried it yet... Is this even possible? Have others tried this?

Standard option in SPPC for groups and/or individual customers. Same with shipping modules.

Link to comment
Share on other sites

Hey Jan,

 

Thanks again for all the previous help. He is a good one for you. Maybe you have see a module or know if this is available. I would like to have retail customers only have the ability to ship to the one address, (billing address), but give the ability for dealers and distributors to have a bill to address for credit card verifications, but also give them the choice to have a ship to address.

 

Any help would be great.

 

Thanks JR

Link to comment
Share on other sites

Hello Again,

 

Forgot to mention, the reason for the two addresses for dealers, is I still need the billing address for verification of credit card transactions. I use the Authorize contribution and have it set to only verify a transaction if billing address matches.

 

Thanks JR

Link to comment
Share on other sites

I use the Authorize contribution and have it set to only verify a transaction if billing address matches.

Then you would have to change that contribution to look up the default address if a customer has a customer group id other than zero instead of the shipping address.

Link to comment
Share on other sites

There are a few posts on this problem, but I can’t seem to find a fix.

My problem is that there is No Image Available" no other details and a price $0.00 in the index.php listing.

Is it possible that the previous mods are interfering (have added extra fields and additional fields.)

Any help would be great.

Thank you Richard

Link to comment
Share on other sites

There are a few posts on this problem, but I can’t seem to find a fix.

My problem is that there is No Image Available" no other details and a price $0.00 in the index.php listing.

Is it possible that the previous mods are interfering (have added extra fields and additional fields.)

Very well possible because as was pointed out in more than one post, the listing (includes/modules/product_listing.php) has a few subtle changes. Normally, in the listing the HTML is built for each product while fetching the information from the database. For SPPC this is done earlier, to be able to do less queries: one for group prices and one for special prices with the products_id's.

 

So for every $listing['field_name'] you now need to use $listing[$x]['field_name'].

Link to comment
Share on other sites

Very well possible because as was pointed out in more than one post, the listing (includes/modules/product_listing.php) has a few subtle changes. Normally, in the listing the HTML is built for each product while fetching the information from the database. For SPPC this is done earlier, to be able to do less queries: one for group prices and one for special prices with the products_id's.

 

So for every $listing['field_name'] you now need to use $listing[$x]['field_name'].

 

Thank you, should have read the last post a little closer.

Do have a new problem in that all the products in each of the catergories are the same, see www.esdesignjewelry.com. I hope have not miss a posting on this fix.

Richard

Link to comment
Share on other sites

I'm sure this has to be somewhere in the forums - but I'm not having any luck finding it :blush:

 

Has anyone gotten Attitude Simple Manual Order Entry and SPPC working together? I know I need to pass the Customer Group ID along to the checkout pages, so I'm guessing I need to get it somewhere (probably on admin.php).

 

I also have Quantity Price Break for SPPC - do I need to add anything special for that?

 

TIA!

~Tracy
 

Link to comment
Share on other sites

Well - I've been trying several different things to get the customer ID - and I am beginning to think that it has to do with what is queried when searching for an existing customer. Here is the code for that section:

 

 $info_box_contents = array();
		$info_box_contents[] = array('text' => TEXT_ADMIN_SEARCH_ACCOUNT);

		new infoBoxHeading($info_box_contents, true, false);

		unset($info_box_contents);

		$info_box_contents[] = array('align' => 'center',
					 'text'  => tep_draw_form('search_customers', tep_href_link(FILENAME_ADMIN,'','SSL'), 'get').TEXT_ADMIN_SEARCH_EMAIL.'<br>'.tep_draw_input_field('search_email').'<br>'.TEXT_ADMIN_SEARCH_LASTNAME.'<br>'.tep_draw_input_field('search_lastname').'<br>'.TEXT_ADMIN_SEARCH_PHONE.'<br>'.tep_draw_input_field('search_phone'));
		$info_box_contents[] = array('align' => 'center',
					 'text'  => tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH).tep_hide_session_id().'</form>');

		if ($HTTP_GET_VARS['search_email']) {
			$search_email = tep_db_prepare_input($HTTP_GET_VARS['search_email']);
			$where_clause = "customers_email_address RLIKE '".tep_db_input($search_email)."'";
		}

		if ($HTTP_GET_VARS['search_phone']) {
			$search_phone = tep_db_prepare_input($HTTP_GET_VARS['search_phone']);
			$where_clause .= ($where_clause ? ' or ' : '')."customers_telephone RLIKE '".tep_db_input($search_phone)."'";
		}

		if ($HTTP_GET_VARS['search_lastname']) {
			$search_lastname = tep_db_prepare_input($HTTP_GET_VARS['search_lastname']);
			$where_clause .= ($where_clause ? ' or ' : '')." customers_lastname RLIKE '".tep_db_input($search_lastname)."'";
		}


		if ($where_clause) {

			$search_sql = "select * from ".TABLE_CUSTOMERS." where ".$where_clause;
			$search_query = tep_db_query($search_sql);

			if (tep_db_num_rows($search_query)) {

			$info_box_contents[] = array('align' => 'center',
						 'text'  => TEXT_ADMIN_MATCHES);


			$search_display = '<table border="1" width="100%" cellspacing="0" cellpadding="2">';
			$search_display .= '<tr><td class="tableHeading">'.TEXT_ADMIN_SEARCH_EMAIL.'</td><td class="tableHeading">'.TEXT_ADMIN_SEARCH_NAME.'</td><td class="tableHeading">'.TEXT_ADMIN_SEARCH_PHONE.'</td></tr>';	
			while ($search_result = tep_db_fetch_array($search_query)) {
				$search_display .= '<tr><td class="smallText"><a href="'.tep_href_link(FILENAME_ADMIN_LOGIN,'email_address='.$search_result['customers_email_address'],'SSL').'">'.$search_result['customers_email_address'].'</a></td><td class="smallText">'.$search_result['customers_firstname'].' '.$search_result['customers_lastname'].'</td><td class="smallText">'.$search_result['customers_telephone'].'</td></tr>';	
			}
			$search_display .= '</table>';

			$info_box_contents[] = array('align' => 'left',
						 'text'  => $search_display);

		} else {
				$info_box_contents[] = array('align' => 'center',
							 'text'  => TEXT_ADMIN_NO_MATCHES);
		}
		}

		new infoBox($info_box_contents);

 

Does it look to you guys like, in order for this at the very top of the page:

require('includes/application_top.php');
  global $customer_group_id;
  if(!isset($customer_group_id)) { $customer_group_id = '0'; }

 

And this at the top of the <body> tag:

// BOF Separate Pricing Per Customer, hide products and categories from groups
 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, hide products and categories from groups

 

to work properly - the Customer Group ID needs to be pulled in from the query when searching for an existing customer?

 

TIA! :blush:

 

I'm sure this has to be somewhere in the forums - but I'm not having any luck finding it :blush:

 

Has anyone gotten Attitude Simple Manual Order Entry and SPPC working together? I know I need to pass the Customer Group ID along to the checkout pages, so I'm guessing I need to get it somewhere (probably on admin.php).

 

I also have Quantity Price Break for SPPC - do I need to add anything special for that?

 

TIA!

~Tracy
 

Link to comment
Share on other sites

Well - I've been trying several different things to get the customer ID - and I am beginning to think that it has to do with what is queried when searching for an existing customer. Here is the code for that section:

 

Hmmm - it appears that the query is pulling everything from the Customers table, and the Customer Group ID is in that table. So it should be pulling the information - am I just trying to access it incorrectly? :huh:

 

TIA

~Tracy
 

Link to comment
Share on other sites

Hmmm - it appears that the query is pulling everything from the Customers table, and the Customer Group ID is in that table. So it should be pulling the information - am I just trying to access it incorrectly?

Must be, the query is pulling all fields from the table customers:

$search_sql = "select * from ".TABLE_CUSTOMERS." where ".$where_clause;

Adding a table cell or whatever with $search_result['customers_group_id'] in it should display the customer group.

 

The session stuff cannot be used in the admin. The customers are not allowed to come in the admin section, or are they? :lol:

Link to comment
Share on other sites

Do have a new problem in that all the products in each of the catergories are the same, see www.esdesignjewelry.com. I hope have not miss a posting on this fix.

Looks interesting ;)

 

It looks like a template so I can't be certain how that particular one works but are you sure you commented out the while and added a for statement like:

//	while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {

Link to comment
Share on other sites

Must be, the query is pulling all fields from the table customers:

$search_sql = "select * from ".TABLE_CUSTOMERS." where ".$where_clause;

Adding a table cell or whatever with $search_result['customers_group_id'] in it should display the customer group.

 

The session stuff cannot be used in the admin. The customers are not allowed to come in the admin section, or are they? :lol:

 

Sorry - I should have been more specific :blush: - it isn't in the Admin section. The page is in the catalog section and just happens to have been named admin.php (catalog/admin.php). You simply go to URL/admin.php and login, then you can search for a customer or click to create a new account from that same page. Once you click a found customer or click to create a new customer, it has you use all of the existing pages within osC. But the catalog/admin.php page is not getting the Customer Group ID in order to pass it along. I learned this when I got to the checkout process and entered a discount coupon and the SQL Error showed me that the customer_group_id was missing. I don't necessarily want it to display the customer_group_id - just pass it along through the pages as it does when someone orders online normally.

 

The whole point to us adding the Attitude Simple Manual Order Entry is that we are going to be hiring a call center soon to handle phone orders when our office is closed. We wanted to be able to allow the call center to enter the orders via the website and have them tagged as Manual Orders so we would know which one's were from the call center, vs which ones were directly from the customer going online. Do you know of a better way to accomplish this without giving the call center access to the admin area?

 

Thanks again!

~Tracy
 

Link to comment
Share on other sites

You simply go to URL/admin.php and login, then you can search for a customer or click to create a new account from that same page. Once you click a found customer or click to create a new customer, it has you use all of the existing pages within osC. But the catalog/admin.php page is not getting the Customer Group ID in order to pass it along.

OK, than probably the query gets every field, but the session parameter for customer group id is not set. Look at login.php to see how that is done for SPPC.

Link to comment
Share on other sites

OK, than probably the query gets every field, but the session parameter for customer group id is not set. Look at login.php to see how that is done for SPPC.

 

Hi JanZ,

 

I just finished installing this contribution manually. WOW, you guys put a mess of work into it. Thank you.

 

Problem: I have a "sort product attributes" contribution installed as well. The two conflict in product_info.php at product options I have a:

 

. "' order by pa.attribute_sort"

 

like such:

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");

 

where would I add that to this?:

 

		$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0");
	$list_of_prdcts_attributes_id = '';
	$products_options = array(); // makes sure this array is empty again
	while ($_products_options = tep_db_fetch_array($products_options_query)) {
	$products_options[] = $_products_options;
	$list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].",";
}

  if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { 
	 $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")";
 $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'");
 while ($pag_array = tep_db_fetch_array($pag_query)) {
	 $cg_attr_prices[] = $pag_array;
 }

 // substitute options_values_price and prefix for those for the customer group (if available)
 if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) {
	for ($n = 0; $n < count($products_options); $n++) {
	 for ($i = 0; $i < count($cg_attr_prices); $i++) {
		 if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) {
			$products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix'];
			$products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price'];
		 }
	 } // end for ($i = 0; $i < count($cg_att_prices); $i++)
	}
	} // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices))
  } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0')

  for ($n = 0; $n < count($products_options); $n++) {
	  $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']);
	  if ($products_options[$n]['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	  }
	}
// EOF SPPC attributes mod

 

Thank you again. -a8le

Thuan Nguyen

Link to comment
Share on other sites

Ugh, I'm at a loss.

 

I've got SPPC w/QPBPP installed, along with Attribute Percentage, Options as Images, and Attrib_Sort.

 

My issue is that I can't assign users to groups in the Customer admin area for SPPC. I can enter prices in products, but everyone who visits can see the QPBPP prices. I want the visitors to see the single MSRP listed from SPPC.

 

What files should I check if the customer edit screen has no method of changing their groups? I'd be happy with a straight sql edit.

 

Any ideas?

Link to comment
Share on other sites

Problem: I have a "sort product attributes" contribution installed as well. The two conflict in product_info.php at product options

No, not really.

I have a:

. "' order by pa.attribute_sort"

like such:

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");

where would I add that to this?:

		$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0");

To the first query: $products_options_query, just add it to the end like:

pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by pa.attribute_sort");

Link to comment
Share on other sites

I've got SPPC w/QPBPP installed, along with Attribute Percentage, Options as Images, and Attrib_Sort.

 

My issue is that I can't assign users to groups in the Customer admin area for SPPC. I can enter prices in products, but everyone who visits can see the QPBPP prices. I want the visitors to see the single MSRP listed from SPPC.

 

What files should I check if the customer edit screen has no method of changing their groups? I'd be happy with a straight sql edit.

Sure? It is a drop-down in the section Option, just under Newsletter subscribed/unsubscribed. Sure you can't use the file from the package? There are quite a few changes in customers.php so doing it manually is rather tedious.

 

To do a "mass upgrade" from group 0 to 1 you do this:

update customers set customers_group_id = '1' where customers_group_id = '0';

If you want to have anybody who opens an account to be in another group than 0 just add it in the appropriate section of create_account.php. For example like:

	  if ( ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id)  ) {
  $sql_data_array['customers_group_ra'] = '1';
// entry_company_tax_id moved from table address_book to table customers in version 4.2.0
  $sql_data_array['entry_company_tax_id'] = $company_tax_id; 
}
// put everybody in group 1
  $sql_data_array['customers_group_id'] = '1';

Normally, it is not set so the default set in MySQL (0) is entered.

Link to comment
Share on other sites

No, not really.

 

To the first query: $products_options_query, just add it to the end like:

pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by pa.attribute_sort");

 

Thank you, working perfectly. -Thuan

Thuan Nguyen

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