Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

I used the times on files in build 051113 and manually edited for new installation those files in version 4.1.4 that are older, then I made a zip and requested the package to be posted to http://www.oscommerce.com/community/contri...ns,716/new,file - due to size it will require moderator to accept.

 

So far the proposed v4.1.5 seems to be working.....

Link to comment
Share on other sites

Normando,

I have a question about table (sorry for any mistake).

Why not create the table, like SPPC logical model?

In this table the connections are through Field 1 and Field 2, because the attributes are already created.

This table is similar to table products_groups, where the field product_id is the link (connection) to the product that has defined.

In the present case, the field products_options_values_to_products_options_id is the link to the attribute that has the product.

Actually, the way I proposed is according to the SPPC logical model. The table with the price is connected through the key of that table (in products_groups that is products_id) with the table that has the price for the groups. In this case we are dealing with the attributes_id.

 

The table you propose contains all the possible option values to options and is not specific to a product. As an example "memory" is an option and it can have values 4, 8, 16, and 32 MB (in the sample products database that is in the osC download). However product 1 only has 4, 8, and 16 MB and product 2 only 16 and 32. Besides, 16 MB with product 1 can have a diffferent price than for product 2. It is just not possible that way.

Maybe for admin section adapt this contrib? = http://www.oscommerce.com/community/contributions,1119
I haven't installed that one and I don't believe we should force people to install certain contributions to use a certain feature for SPPC. Adapting a good attributes manager (I believe there are more than that one) to this feature can always be done later, but there should be some basic option for a "default" osC installation.

 

Sorry for my baaaaddd english, and my little knowledge.
It is not bad at all and I'm not a native English speaker myself... Regarding the knowledge, the attributes system of osC is pretty complicated and even the developers (well, ex-developers I should say) have said that the system should be replaced with a better one. In the default osC it is not possible for example to keep stock of products with attributes so if you sell T-shirts in red and green you cannot separately track stock of red and green T-shirts. Not really handy...
Link to comment
Share on other sites

Paul,

I used the times on files in build 051113 and manually edited for new installation those files in version 4.1.4 that are older, then I made a zip and requested the package to be posted to http://www.oscommerce.com/community/contri...ns,716/new,file - due to size it will require moderator to accept.

 

So far the proposed v4.1.5 seems to be working.....

Good point, it did start to become a mess with undocumented changes and changes that were not working or had flaws in it. The mysql 5 changes being one of them.

 

I am working on an update and at least include the feature to select taxes for groups (perhaps the attribute prices for groups also). I first want to finish the "hide products and categories for groups" contribution now though, with November 13 updated files and then direct my (full) attention to SPPC 4.20 adding in a few minor bug fixes and improvements to login.php.

Link to comment
Share on other sites

Guys I have completed the installation and now i am getting this error, can somebody please help me?

 

1054 - Unknown column 'p.products_id' in 'on clause'

This is caused by MySQL5. The fixes I use for those are found in this post on page 122.
Link to comment
Share on other sites

Mark,

Ever since adding this most excellent osC Contribution... whenever anyone logs in, they are sent to an unsecure (http) "/account.php" page. My question is this:

 

- How can I force osC to send people to a secure (https) "/account.php" page?

This is from the login.php page? Did you change that in the file yourself because the default is sending you to FILENAME_DEFAULT (around line 116). SPPC didn't change that.

If you added it yourself it should look this (starts around line 108, only the last couple of lines changed):

// restore cart contents
	$cart->restore_contents();

	if (sizeof($navigation->snapshot) > 0) {
	  $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
	  $navigation->clear_snapshot();
	  tep_redirect($origin_href);
	} else {
	  tep_redirect(tep_href_link(FILENAME_ACCOUNT),'','SSL');									
//		  tep_redirect(tep_href_link(FILENAME_DEFAULT));

Link to comment
Share on other sites

when i highlight an order and click "edit" i no longer see the credit card information...

 

i used to see this:

 

 

Payment Method: Credit Card

 

Credit Card Type: XXXX

Credit Card Owner: Shay Tester

Credit Card Number: 4060XXXXXXXXXXXX

Credit Card Expires: XXXX

 

and now i see only this:

 

 

Payment Method: Credit Card

 

i think SPPC changed this... if there is a way to tell exactly what changed it please let me know

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

when i highlight an order and click "edit" i no longer see the credit card information...

 

i think SPPC changed this... if there is a way to tell exactly what changed it please let me know

SPPC doesn't do anything with that page (orders.php) and in general when the order is finished, SPPC's job is done. I don't know what you normally should see though (never dealt with credit cards in osC although this seems to be standard: line 179-201 in that page) but it doesn't look to me it has something to do with SPPC. Can you find the info back in the table orders using phpMyAdmin?
Link to comment
Share on other sites

Christopher,

Okay, I have a little problem, I searched and searched this topic, but was unable to find it.

It involves advanced_search_result.php I ran into a little clash between extra fields, and seperate pricing per customer.

I think it would be best to change the queries according to the MySQL5 version (see that post on page 122, see last piece of code there) and then add the extra fields in three queries like this:

	  if ($status_tmp_product_prices_table == true) {
// START: Extra Fields Contribution
 $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . $product_prices_table . " as tmp_pp using(products_id)";
  } elseif ($status_tmp_special_prices_table == true) {
 $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id";
  } else {
 $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";		  
  }
 // EOF Separate Pricing Per Customer, END Extra Fields Contribution

Link to comment
Share on other sites

The table you propose contains all the possible option values to options and is not specific to a product. As an example "memory" is an option and it can have values 4, 8, 16, and 32 MB (in the sample products database that is in the osC download). However product 1 only has 4, 8, and 16 MB and product 2 only 16 and 32. Besides, 16 MB with product 1 can have a diffferent price than for product 2. It is just not possible that way.

 

You are right :thumbsup:

Thanks for the explanation JanZ.

 

Normando

Link to comment
Share on other sites

Hi I have a custom template for osCommerce and I have been trying to integrate the Separate Pricing Per Customer in the templates and have had no luck. Is there anyone willing to offer their help into just editing the files and sending them back to me, and how much would you charge to do it for me.

 

Thank You

Link to comment
Share on other sites

Hi I have a custom template for osCommerce and I have been trying to integrate the Separate Pricing Per Customer in the templates and have had no luck. Is there anyone willing to offer their help into just editing the files and sending them back to me, and how much would you charge to do it for me.

 

Thank You

Link to comment
Share on other sites

Hi,

 

I have a question .. maybe someone here can help me.

 

I am installing SPPC and I have Admin Access with Levels

 

I am wanting to move this code:

// BOF Separate Pricing Per Customer
// define the email address that can change customer_group_id on login
define('SPPC_TOGGLE_LOGIN_PASSWORD', 'root@localhost');

 

from the file catalog/includes/languages/english/login.php to the database. I then want to add it in the admin section so I can set it for each admin user there.

 

Any help would be great.

 

Thanks,

Philip

Link to comment
Share on other sites

I am wanting to move this code:

// BOF Separate Pricing Per Customer
// define the email address that can change customer_group_id on login
define('SPPC_TOGGLE_LOGIN_PASSWORD', 'root@localhost');

 

from the file catalog/includes/languages/english/login.php to the database. I then want to add it in the admin section so I can set it for each admin user there.

I don't know anything how that admin contribution keeps a list of admins, but the rest shouldn't be too complicated. I assume you do a query for the email addresses of the admin, retrieve the results with a while and then adding all the email addresses to an array. Then check if the supplied email address (password versus email address should already have been confirmed) is in the array and then you got the same functionality (at the cost of one mysql query for every login) for more than one user IMHO.
Link to comment
Share on other sites

In the default osC it is not possible for example to keep stock of products with attributes so if you sell T-shirts in red and green you cannot separately track stock of red and green T-shirts. Not really handy...

If you add QTPro you are able to track stock.

Link to comment
Share on other sites

Hi,

 

I have just installed SPPC 4.15.

 

I stripped the sorting out of admin/customers.php because I found it anoying and already use "Customers List Improved 1.4_1_2" http://www.oscommerce.com/community/contributions,3463.

 

My problem is - I have been able to get everything else to work - but it does not list the customers group. This is when you first click on customers and it lists them all.

 

Here is the code that I have in there:

 

				<td class="dataTableContent"><?php echo ucwords($customers['entry_company']); ?></td>
			<td class="dataTableContent"><?php echo ucwords($customers['customers_lastname']); ?></td>
			<td class="dataTableContent"><?php echo ucwords($customers['customers_firstname']); ?></td>
			<td class="dataTableContent"><?php echo $customers_groups['customers_group_name']; ?></td>
			<td class="dataTableContent" align="center"><?php echo tep_date_short($customers['date_account_created']); ?></td>
	<td class="dataTableContent" align="middle">
<?php
  if ($customers['customers_group_ra'] == '1') {
	echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'icon_status_green.gif', 10, 10);
	} else {
	echo tep_draw_separator('pixel_trans.gif', '10', '10'); 
	} ?></td>
			<td class="dataTableContent" align="center"><?php echo tep_date_short($info['date_last_logon']); ?></td>
			<td class="dataTableContent" align="center"><?php echo ($info['number_of_logons']); ?></td>
			<td class="dataTableContent"><?php echo $customers['customers_telephone']; ?></td>
			<td class="dataTableContent" align="center"><?php echo ucwords(($customers['country'] ? $customers['country'] : '<font color="#808080">None</font>') . ', ' . ($customers['state'] ? $customers['state'] : '<font color="#808080">None</font>') . ',<br>' . ($customers['city'] ? $customers['city'] : '<font color="#808080">None</font>')); ?></td>
			<td class="dataTableContent" align="center"><?php if (tep_not_null($customers['notes'])) {  echo '<img src="images/icons/tick.gif" width="14" height="14" border="0" alt="Yes, Has Notes">';  } ?></td>

			<td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

 

I can provide my whole customers.php file if needed.

 

Or maybe does anyone have a clean copy of the admin/customers.php file without that sorting contrib mixed in?

 

Thanks,

Philip

Link to comment
Share on other sites

My problem is - I have been able to get everything else to work - but it does not list the customers group. This is when you first click on customers and it lists them all.
I think it is a small typo in this part:

				<td class="dataTableContent"><?php echo $customers_groups['customers_group_name']; ?></td>

I assume if you change it to:

				<td class="dataTableContent"><?php echo $customers['customers_group_name']; ?></td>

it works (surely you changed the query to pick up the group name).

Link to comment
Share on other sites

No, I was not sure how to add it to the query.

 

Here it is:

	$customers_query_raw = 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_notes as notes, c.customers_email_address, c.customers_group_id, c.customers_group_ra, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, z.zone_name as state, ctry.countries_iso_code_2 as country, a.entry_country_id, a.entry_company from ' . TABLE_CUSTOMERS . ' c left join ' . TABLE_ADDRESS_BOOK . ' a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join ' . TABLE_CUSTOMERS_INFO . ' ci on c.customers_id = ci.customers_info_id left join ' . TABLE_COUNTRIES . ' ctry on a.entry_country_id = ctry.countries_id left join ' . TABLE_ZONES . ' z on a.entry_zone_id = z.zone_id ' . $search . ' order by ' . $db_orderby . ' ' . $sort;

 

any help would be great!

 

Oh! - Also I am using php 5 and MySQL 5 - so any changes for the above would need to reflect that.

 

Thanks,

Philip

Edited by dwdonline
Link to comment
Share on other sites

This will work (I think):

		$customers_query_raw = 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_notes as notes, c.customers_email_address, c.customers_group_id, cg.customers_group_name, c.customers_group_ra, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, z.zone_name as state, ctry.countries_iso_code_2 as country, a.entry_country_id, a.entry_company from ' . TABLE_CUSTOMERS . ' c left join ' . TABLE_ADDRESS_BOOK . ' a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join ' . TABLE_CUSTOMERS_GROUPS .  ' cg on c.customers_group_id = cg.customers_group_id left join ' . TABLE_CUSTOMERS_INFO . ' ci on c.customers_id = ci.customers_info_id left join ' . TABLE_COUNTRIES . ' ctry on a.entry_country_id = ctry.countries_id left join ' . TABLE_ZONES . ' z on a.entry_zone_id = z.zone_id   ' . $search . ' order by ' . $db_orderby . ' ' . $sort;

Link to comment
Share on other sites

This will work (I think):
		$customers_query_raw = 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_notes as notes, c.customers_email_address, c.customers_group_id, cg.customers_group_name, c.customers_group_ra, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, z.zone_name as state, ctry.countries_iso_code_2 as country, a.entry_country_id, a.entry_company from ' . TABLE_CUSTOMERS . ' c left join ' . TABLE_ADDRESS_BOOK . ' a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join ' . TABLE_CUSTOMERS_GROUPS .  ' cg on c.customers_group_id = cg.customers_group_id left join ' . TABLE_CUSTOMERS_INFO . ' ci on c.customers_id = ci.customers_info_id left join ' . TABLE_COUNTRIES . ' ctry on a.entry_country_id = ctry.countries_id left join ' . TABLE_ZONES . ' z on a.entry_zone_id = z.zone_id   ' . $search . ' order by ' . $db_orderby . ' ' . $sort;

 

 

That code worked great! Thank you sooooo much. I really appreciate your help.

 

Thanks,

Philip

Link to comment
Share on other sites

Hi,

 

I think I have everything fixed except one place now. In catalog/index.php

 

this code does not work. I get this error:

1054 - Unknown column 'p.products_id' in 'on clause'

 

as it is does not work with php 5 or mysql 5.

 

// BOF Separate Pricing Per Customer
if ($status_product_prices_table == true) {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} else { // either retail or no need to get correct special prices
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m  left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  }
} else {
// show the products in a given categorie
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory;
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } // end else { // either retail...
// EOF Separate Pricing per Customer

 

 

Any help getting this to work with php 5 / mysql 5 would be great.

 

Thanks,

Philip

Link to comment
Share on other sites

Hello again JanZ! :)

 

I have another question regarding "Quantity Price Breaks for Separate Pricing Per Customer v1.02"

 

Is it posible to get the quantity input field to shop as a drop down menue instead? (values 10/20/30/40/40/50/60/70/80/90/100)

 

Im talking about this line:

echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"');

Link to comment
Share on other sites

hi JanZ

thank you for your pm, hope you had a nice holiday :)

as i allready mentioned is that i have "categories_description" installed so my kategories page looks like the produkt page.

to show me the buttons for hiden categories i changed the code arround like

		<tr> 
	  <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 
	</tr> 
	<tr> 
	  <td colspan="2" class="main" ><?php // echo TEXT_HIDE_KATEGORIES_FROM_GROUP; ?></td> 
	</tr> 
	<?php   
  $hide_categories_customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id");
  $hide_categories_from_groups_array = explode(',',$cInfo->categories_hide_from_groups);
  $hide_categories_from_groups_array = array_slice($hide_categories_from_groups_array, 1); // remove "@" from the array
  while ($hide_categories_customers_group = tep_db_fetch_array($hide_categories_customers_group_query)) {
?> 
	<tr bgcolor="#ebebff"> 
	  <td class="main" colspan="2"><?php 
  if (isset($cInfo->categories)) {
   echo tep_draw_checkbox_field('hide_cat[' . $hide_categories_customers_group['customers_group_id'] . ']',  $hide_categories_customers_group['customers_group_id'] , (isset($cInfo->categories[ $hide_categories_customers_group['customers_group_id']])) ? 1: 0);
  } else {
  echo tep_draw_checkbox_field('hide_cat[' . $hide_categories_customers_group['customers_group_id'] . ']',  $hide_categories_customers_group['customers_group_id'] , (in_array($hide_categories_customers_group['customers_group_id'], $hide_categories_from_groups_array)) ? 1: 0);
  } ?> 
 <?php echo $hide_categories_customers_group['customers_group_name']; ?></td> 
	</tr> 
	<tr bgcolor="#ebebff"> 
	  <td class="main" colspan="2"><?php
	} 

	$category_hide_string = '<br>'. "\n" . TEXT_HIDE_CATEGORIES_FROM_GROUPS;
	 for ($i = 0; $i < count($customers_groups); $i++) {
   $category_hide_string .= '<br>' . "\n" . tep_draw_checkbox_field('hide_cat[' . $customers_groups[$i]['id'] . ']',  $customers_groups[$i]['id'] , (in_array($customers_groups[$i]['id'], $hide_cat_from_groups_array)) ? 1: 0) . '  ' . $customers_groups[$i]['text']; 
	  }
	echo $category_hide_string;

// end while ($hide_categories_customers_group = tep_db_fetch_array($hide_categories_customers_group_query))
?> </td> 
	</tr> 
	<tr> 
	  <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 
	</tr> 
	<!-- EOF Separate Pricing Per Customer --> 
	<tr> 
	  <td class="main"><?php echo TEXT_EDIT_SORT_ORDER; ?></td> 
	  <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'); ?></td> 
	</tr>

 

It shows the buttons and if a customer group is selected it is ticked (i can only chose manually by phpmyadmin) if i then chose one or simple just update the page the hiden categorie settings are dropped.

 

any clue?

 

Regards Beruska

Link to comment
Share on other sites

sorry about that! here is a litle correction to my code.

i was messing about with the radio buttons in the standard right menu!

		  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	<tr>  
	<tr> 
	  <td class="main"><?php echo TEXT_EDIT_CATEGORIES_IMAGE; ?></td> 
	  <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('categories_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $cInfo->categories_image . tep_draw_hidden_field('categories_previous_image', $cInfo->categories_image); ?></td> 
	</tr> 

<!-- BOF SPPC hide from groups mod -->
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
		<td colspan="2" class="main" ><?php echo TEXT_HIDE_PRODUCTS_FROM_GROUP; ?></td>
	  </tr>
	<?php   
  $hide_categories_customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id");
  $hide_categories_from_groups_array = explode(',',$cInfo->categories_hide_from_groups);
  $hide_categories_from_groups_array = array_slice($hide_categories_from_groups_array, 1); // remove "@" from the array
  while ($hide_categories_customers_group = tep_db_fetch_array($hide_categories_customers_group_query)) {
?> 
	<tr bgcolor="#ebebff"> 
	  <td class="main" colspan="2"><?php 
  if (isset($cInfo->categories)) {
   echo tep_draw_checkbox_field('hide_cat[' . $hide_categories_customers_group['customers_group_id'] . ']',  $hide_categories_customers_group['customers_group_id'] , (isset($cInfo->categories[ $hide_categories_customers_group['customers_group_id']])) ? 1: 0);
  } else {
  echo tep_draw_checkbox_field('hide_cat[' . $hide_categories_customers_group['customers_group_id'] . ']',  $hide_categories_customers_group['customers_group_id'] , (in_array($hide_categories_customers_group['customers_group_id'], $hide_categories_from_groups_array)) ? 1: 0);
  } 
  }
?> 
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
<!-- EOF Separate Pricing Per Customer -->

	<tr> 
	  <td class="main"><?php echo TEXT_EDIT_SORT_ORDER; ?></td> 
	  <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'); ?></td> 
	</tr> 
	<tr> 
	  <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 
	</tr>

 

Regards Beruska

Link to comment
Share on other sites

Is it posible to get the quantity input field to shop as a drop down menue instead? (values 10/20/30/40/40/50/60/70/80/90/100)

 

Im talking about this line:

echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"');

Well, yes that is possible. I saw something like that in Master Products 1.1.5. This is an amended version that makes a dropdown of 1 to 10 times the quantity block (so if the quantity block is 1, 1,2,3,4,5,6,7,8,9,10 if the quantity block is 10, it will make 10,20,30,40,50,60,70,80,90,100 in the drop-down menu).

					  <?php // echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); 
$qblocks = $pf->adjustQty(1);
for ($i = $qblocks; $i <= 10 * $qblocks; $i += $qblocks ) {   	
$qty_array[] = array('id' => $i, 'text' => $i);
										 }
echo TEXT_ENTER_QUANTITY . '  ' . tep_draw_pull_down_menu('cart_quantity', $qty_array); 
										?>

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