Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Just in case this comes up >>>

 

I had a small typo. Be sure to pay close attention to your opening and closing parenthisi - I found it almost immediatly following my post when I cut and Pasted the lines into the BBS - Be sure to step back and use another editor or change the font to give yor eyes something to look at - -

 

From

 

p.products_id in (" . $list_of_products_ids . ")");

 

To

 

p.products_id in ('" . $list_of_products_ids . "')");

 

:rolleyes:

IMHO there is absolutely nothing wrong with that. It is perfectly OK to have this as e.g. p.products_id in (12,15,38,59)

The question is why do you get the p.products_id in ()?

The particular function is called after a check for that in includes/classes/shopping_cart.php, function reset:

	  $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
// BOF SPPC Hide products and categories from groups
	  $no_of_products_in_basket = 0;
  while ($_products = tep_db_fetch_array($products_query)) {
	$temp_post_get_array[] = $_products['products_id'];
		$products[] = $_products;
		$no_of_products_in_basket += 1;
   }
 if ($no_of_products_in_basket > 0) {
		$hide_status_products = array();
		$hide_status_products = tep_get_hide_status($hide_status_products, $this->cg_id, $temp_post_get_array);

So there should be at least a single products_id in between the parentheses.... :blink:

Link to comment
Share on other sites

IMHO there is absolutely nothing wrong with that. It is perfectly OK to have this as e.g. p.products_id in (12,15,38,59)

The question is why do you get the p.products_id in ()?

The particular function is called after a check for that in includes/classes/shopping_cart.php, function reset:

So there should be at least a single products_id in between the parentheses.... :blink:

 

Okay . . . With that, I have found a missing line in my code from your example. . . I have seen code done both ways like you said it should be okay. However, I encountered the same issue with the same schema on another contribution tonight while working.

 

// BOF QPBPP for SPPC
  $products_query = tep_db_query("select cb.products_id, ptdc.discount_categories_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " cb left join (select products_id, discount_categories_id from " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " where customers_group_id = '" . $this->cg_id . "') as ptdc on cb.products_id = ptdc.products_id where customers_id = '" . (int)$customer_id . "'");
  while ($products = tep_db_fetch_array($products_query)) {
	$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']);
// EOF QPBPP for SPPC
	$temp_post_get_array[] = $_products['products_id'];
		$products[] = $_products;
		$no_of_products_in_basket += 1;
   }
 if ($no_of_products_in_basket > 0) {
		$hide_status_products = array();
		$hide_status_products = tep_get_hide_status($hide_status_products, $this->cg_id, $temp_post_get_array);
		for ($i=0; $i < $no_of_products_in_basket; $i++) {
		  foreach($hide_status_products as $key => $subarray) {
			if ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '0') {
// not hidden for this customer, can be added to the object shoppingCart
			$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']);
// attributes
	$attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
	while ($attributes = tep_db_fetch_array($attributes_query)) {
	  $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
	}
  }elseif ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '1') {
// product is hidden for the customer, don't add to object shoppingCart, delete from db next
			$products_to_delete_from_cb[] = $products[$i]['products_id'];
			} // end if/elseif
		  }// end foreach ($hide_status_products as $key => $subarray)
		} // end for ($i=0; $i < $no_of_products_in_basket; $i++)

 

I did notice that I am missing the following line >>> $no_of_products_in_basket = 0;

 

Will that cause a problem? Should I put it in even since I am not getting the error now? Also, since I am consistintly running into this with the opening/closing of the SQL statements, do you think it could have something to do with the way GoDaddy has set up thier hosting?

Link to comment
Share on other sites

Hi I installed the mod and it all seemed to go ok.

 

The only issue I can see is when I checkout it displays: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/******/html/includes/functions/database.php on line 100

 

Line 100 contains:

 

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC);

 

Thanks for your help :)

Link to comment
Share on other sites

I did notice that I am missing the following line >>> $no_of_products_in_basket = 0;

It is a rather inconspicious line of code so easy to overlook when combining two (actually three) contributions in the same piece. I would put it in, just in case

 

// BOF QPBPP for SPPC
  $products_query = tep_db_query("select cb.products_id, ptdc.discount_categories_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " cb left join (select products_id, discount_categories_id from " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " where customers_group_id = '" . $this->cg_id . "') as ptdc on cb.products_id = ptdc.products_id where customers_id = '" . (int)$customer_id . "'");
	  $no_of_products_in_basket = 0; //  SPPC Hide products and categories from groups
  while ($products = tep_db_fetch_array($products_query)) {
	$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']);
// EOF QPBPP for SPPC

Also, since I am consistintly running into this with the opening/closing of the SQL statements

Sorry, don't follow you here but I do think your hosting has nothing to do with these kind of errors.

Link to comment
Share on other sites

The only issue I can see is when I checkout it displays: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/******/html/includes/functions/database.php on line 100

You will need to check the HTML code of that page and hope the error is in the PHP code of that one instead of in one of the included classes like shopping_cart.php. If it is on that page you will have to search for the missing code around the area where the error pops up in the HTML code.

You namely missed adding a piece of code that does the actual query (first line in the example below) and only left with the second line that fetches the results of query that has not taken place. That will cause this error:

$attributes_query = tep_db_query("select products_options_id, blah blah blah"); 
while ($attributes = tep_db_fetch_array($attributes_query)) {

Link to comment
Share on other sites

I have installed this and workes fine...

 

 

BUT... my templates and layout is F. up !!

 

is there a changelog .. in the changed PHP files which I can alter !!

 

See my testsite ad www.digicall.nl and my online site at www.destenenboer.nl

 

:blink:

Link to comment
Share on other sites

I am building a wholesale only site and have installed SPPC and Hide Products. Everything is working well. I want to make the Tax ID # a required field in the create account form. We want to approve all accounts. So how do I do that? Or Alternatively have all accounts sent for approval.

 

Thanks,

 

Chuck

Edited by chasjs
Link to comment
Share on other sites

I give up in the end, Just removed the mod and will have to do without

 

I am changing my format in the SPPC contrib it is not that much work.

 

Just look for the BOF / and EOF in the contribs contained files and you should be done.

 

And some knowledge of PHP to set some variables correctly.

 

I am halfway but it works great... this is a very valueble contrib for me.

Link to comment
Share on other sites

i have sppc installed and working perfect.

 

i installed the 'show price list for sppc by jeep ice.

 

 

in the store admin, i have set 'show prices with tax as true. however in the setting for the customer group wholesale , i have set it as false.

 

so when a retail customer accesses a site , the product info page shows the price as

your price: $24- -------- I am trying to display the title in this case as MRP(Maximum Retail price) as this price is inclusive of tax.

 

and when a wholesale customer logs in , the product info pages shows the price as

retail price : $23.3

your price : $ 22.2

 

 

technically everything is working just fine but just that i am unable to change that title in the first case from' your price' to MRP. it either happens in both the cases or doesnt .

 

Kindly advice

Link to comment
Share on other sites

I have a stupid question, but I need some feedback nonetheless. I am working on a new site. I am running this contribution, plus more pics 6. Everything is fine with no errors but I cannot get my products attributes pull down menu to come up. I did load just the more pics contribution on a fresh install and the attributes menu came up. I did not try to load just this sep. pricing per cust because it takes so long. I have marked all the pricing groups to come up, etc. My question is, does anyone have this problem? It could just be that there is a conflict with the contributions. I am just wandering.

 

Thanks

Link to comment
Share on other sites

I have a stupid question, but I need some feedback nonetheless. I am working on a new site. I am running this contribution, plus more pics 6. Everything is fine with no errors but I cannot get my products attributes pull down menu to come up. I did load just the more pics contribution on a fresh install and the attributes menu came up. I did not try to load just this sep. pricing per cust because it takes so long. I have marked all the pricing groups to come up, etc. My question is, does anyone have this problem? It could just be that there is a conflict with the contributions. I am just wandering.

 

Thanks

 

I don't think there is any overlap in both contribs one is mainly special pricing the other one is just adding more pictures to your products.

Link to comment
Share on other sites

I added v4.2.2 to two web sites and on testing I could not add categories. When added via myPHPadmin I could not edit them. I can add products but not deleat them. I have gone thru the install instructions, looked at the forums.

 

Where is the URL with query string sent upon save of a new category:

 

http://uniquefashionacc.com/admin/categori...p;x=42&y=17

 

I added a print_r for $_GET, $_POST and $_REQUEST to try to debug.

 

Thank you for any help or direction on finding a fix to this. My clients are on my back and I have no answer for them.

Link to comment
Share on other sites

Hi folks,

Loaded (copied over as opposed to C&P method) the latest and greatest flavor today and all appears to be working great with one exception- The default "My account" co-located as * My Account | Cart Contents | Checkout * is no longer working. Server throws a 404.

 

Link being:

http://localhost/Speed%20Demon/account.php...4809e4746b8cd65

 

 

Anybody run in to this?

 

BTW, I can log in using my default 'welcome', (Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?)

 

The link there being:

http://localhost/Speed%20Demon/login.php?o...4809e4746b8cd65

 

Any ideas?

I am a NOOB BTW, so if it is something stupid feel to say as much ;)

 

LOL

 

Greg

Link to comment
Share on other sites

I added v4.2.2 to two web sites and on testing I could not add categories. When added via myPHPadmin I could not edit them. I can add products but not deleat them. I have gone thru the install instructions, looked at the forums.

Since you don't explain what version of osC you use or what contributions were already added to admin/categories.php we can only guess what the problem is. I would think of a register_globals problem. The osC code uses HTTP_POST_VARS and HTTP_GET_VARS and in the later versions those were populated using $_POST and $_GET if they are not populated.

The code of the form for the categories shows the use of the long arrays:

<form name="newcategory" action="http://website/catalog/admin/categories.php?action=insert_category&cPath=" method="post" enctype="multipart/form-data">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td class="infoBoxContent">Please fill out the following information for the new category</td>
 </tr>

 <tr>
<td class="infoBoxContent"><br>Category Name:<br><img src="/catalog/includes/languages/english/images/icon.gif" border="0" alt="English" title=" English "> <input type="text" name="categories_name[1]"><br><img src="/cat_sppc_rc2/includes/languages/german/images/icon.gif" border="0" alt="Deutsch" title=" Deutsch "> <input type="text" name="categories_name[2]"><br><img src="/cat_sppc_rc2/includes/languages/espanol/images/icon.gif" border="0" alt="Español" title=" Español "> <input type="text" name="categories_name[3]"></td>
 </tr>
 <tr>
<td class="infoBoxContent"><br>Category Image:<br><input type="file" name="categories_image"></td>
 </tr>
 <tr>
<td class="infoBoxContent"><br>Sort Order:<br><input type="text" name="sort_order" size="2"></td>

 </tr>
 <tr>
<td align="center" class="infoBoxContent"><br><input type="image" src="includes/languages/english/images/buttons/button_save.gif" border="0" alt="Save" title=" Save "> <a href="http://website/catalog/admin/categories.php?cPath="><img src="includes/languages/english/images/buttons/button_cancel.gif" border="0" alt="Cancel" title=" Cancel "></a></td>
 </tr>
</table>
</form>

The code for the categories is pretty high up in admin/categories.php (around line 40):

	  case 'insert_category':
  case 'update_category':
	if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
	$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

	$sql_data_array = array('sort_order' => (int)$sort_order);

	if ($action == 'insert_category') {
	  $insert_sql_data = array('parent_id' => $current_category_id,
							   'date_added' => 'now()');

	  $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

	  tep_db_perform(TABLE_CATEGORIES, $sql_data_array);

	  $categories_id = tep_db_insert_id();
etcetera

You could try changing $HTTP_POST_VARS to $_POST and $HTTP_GET_VARS to $_GET in the first 60 lines of that file and see if that helps.

Link to comment
Share on other sites

I have perhaps a really simple question for what I now think is really difficult. I need the quantity price break to start if the accumulated ammount of several products reaches the quantity set for one of those products..

 

let say product A costs €20 or €15 at 3 pieces.

product B costs €30 or € 25 at 5 pieces.

 

 

when I have 2 x product A and 1 time product B in my cart, I would like product A to get the price for 3 pieces because the accumulated ammount is 3..

 

I allready made a formula which adds all quantities together, so that I have. I just can't figure out in which file i need to replace the quantity with my total cart quantity for this to start working... :blush:

 

Anybody any tips? :rolleyes:

Link to comment
Share on other sites

I seem to have found a solution.

 

I changed the function computePrice($qty) so that it does not compute the price by the quantity of one product but by that of the quantity of the total of all products in the cart.

 

For this to work I added my variable:

global $totaal;

 

and changed

 

$qty = $this->adjustQty($qty);

 

to

 

$qty = $this->adjustQty($totaal);

 

 

I thought this would take me weeks to figure out. Turned out to be just 2 hours... ;)

Link to comment
Share on other sites

I am using SSPC with Custom Product Builder. Custom product builder allows scenarios like custom configured computers. The user selects ram, hdd, cpu and then the products are combined by CPB into a new product that is placed in the cart. CPB also subtracts the product from stock. Anyway my problem is that CPB is using the standard price rather than the group price the user is assigned to. Does anyone have an idea on how to get CPB to use the group price?

 

Thanks,

Ryan

Link to comment
Share on other sites

Hi folks,

Loaded (copied over as opposed to C&P method) the latest and greatest flavor today and all appears to be working great with one exception- The default "My account" co-located as * My Account | Cart Contents | Checkout * is no longer working. Server throws a 404.

...

 

 

 

Duh. '404'...

account.php moved itself from its required directly (store root)_. Litterally- just picked up and moved itself!

;)

Link to comment
Share on other sites

I have perhaps a really simple question for what I now think is really difficult. I need the quantity price break to start if the accumulated ammount of several products reaches the quantity set for one of those products..

 

let say product A costs €20 or €15 at 3 pieces.

product B costs €30 or € 25 at 5 pieces.

 

 

when I have 2 x product A and 1 time product B in my cart, I would like product A to get the price for 3 pieces because the accumulated ammount is 3..

I would say that if you add both A and B to the same discount category you would achieve exactly that.

Link to comment
Share on other sites

I am running OSC RC2 with SPPC 422 and SPPC Price Break V2. Everyting is working correctly with the exception that all the product prices only show the retail price when browsing a catagory for wholesale (or any other discount level) customers. When you click for the full product details it then shows the correct price for the customer's group. I don't think I missed anyting on the install but it is such a large contribution I don't even know where to start.

 

Any ideas?

Link to comment
Share on other sites

Update to the above:

If I log into the shop as a discount customer and I add a product to my cart, that product shows the correct price if I continue to shop. If it is removed from my cart or I checkout, the price for that product goes back to the first level retail price.

Still scratching my head on this one. Maybe this info will help someone track down whats wrong. For me, it threw a huge wrench into things because now I have no clue where to look.

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