Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

hi all. i've weeded through this thread and can't seem to see an answer to my question. i'd like the specials page to be laid out the same way as the new products page (like this contribution http://www.oscommerce.com/community/contri...earch,specials). i've tried modifying the specials file but my php is not up to snuff to get it working. i'd even settle for a layout similar to the general product listing.

 

has anyone tried either of these approaches with SPPC?

Link to comment
Share on other sites

Please HELP

I installed SPPC and also the hide products contribition now I get this error

In my online catalog

 

 

 

Fatal error: Call to undefined function: tep_db_check_age_specials_retail_table() in /usr/www/users/webassi/catalog/index.php on line 155

Edited by Pixy

Pixy

One day at a time - we all have to learn

Link to comment
Share on other sites

Fatal error: Call to undefined function: tep_db_check_age_specials_retail_table() in /usr/www/users/webassi/catalog/index.php on line 155
That should have been added to catalog/includes/database.php. You probably can upload the file from the package, not many contributions change this file.
Link to comment
Share on other sites

That should have been added to catalog/includes/database.php. You probably can upload the file from the package, not many contributions change this file.

 

Okay - I am a bit slow today

Should I just uplaod a new database.php file? or should I edit the database file?

Pixy

One day at a time - we all have to learn

Link to comment
Share on other sites

Okay I am STILL STRUGGLING

I am getting this error but the Table is there!

 

1146 - Table 'webassi_oscommerce.TABLE_CUSTOMERS_GROUPS' doesn't exist select customers_group_id, customers_group_name from TABLE_CUSTOMERS_GROUPS order by customers_group_id

Pixy

One day at a time - we all have to learn

Link to comment
Share on other sites

I am getting this error but the Table is there!

 

1146 - Table 'webassi_oscommerce.TABLE_CUSTOMERS_GROUPS' doesn't exist select customers_group_id, customers_group_name from TABLE_CUSTOMERS_GROUPS order by customers_group_id

Looks like the define for TABLE_CUSTOMERS_GROUPS hasn't been added to admin/includes/database_tables.php (or not added in between the opening and closing PHP-tags: <?php ?>:

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

Link to comment
Share on other sites

I am having an issue with the function getPriceString() in Price Breaks for SPPC PriceFormatter.php. Is this the appropriate forum or is there another just for PB/SPPC?

Briefly, I am getting double 'regular price' when there are no price breaks for the item. It appears that both the [if special_price] and the [if price_break] sections both end in an [else show regular price]

 

I am getting the hang of using the price breaks, and am finding I can have more control over discounts for wholesale than if I were to just use my original plan of a order_total %-off MOD. Now I have to figure out how to adapt this to quickbooks (which currently discounts the whole order at the end of each section), as there will be pennies left on one side of the table or the other for cumulative rounding effects.

Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA

Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad)

Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO

Link to comment
Share on other sites

I am having an issue with the function getPriceString() in Price Breaks for SPPC PriceFormatter.php. Is this the appropriate forum or is there another just for PB/SPPC?
There is no separate thread for that (and hasn't been needed so far IMHO).
Briefly, I am getting double 'regular price' when there are no price breaks for the item. It appears that both the [if special_price] and the [if price_break] sections both end in an [else show regular price].
I have had to look very careful again and indeed, it is very subtle but both brances after the else corresponding with this if:

	  // displayed on the product information page, here is where you do it.

if($this->hasQuantityPrice == true) {

start with $lc_text = so not a $lc_text .=? Basically, what has been done with $lc_text above that is thrown away.

 

So at this point I'm really in the dark about what is happening. The first regular price is not a strike through as for a special price?

 

I am getting the hang of using the price breaks, and am finding I can have more control over discounts for wholesale than if I were to just use my original plan of a order_total %-off MOD. Now I have to figure out how to adapt this to quickbooks (which currently discounts the whole order at the end of each section), as there will be pennies left on one side of the table or the other for cumulative rounding effects.
True, there was a question on that not so long ago but I don't remember who asked and I don't even remember if it was in this thread but it is caused by rounding errors in a few places. Basically, the price is first rounded and then multiplied by quantity (in e.g. the class shopping cart). Instead you need to multiply and then do the rounding. Example in the shopping cart, function calculate:

$this->total += tep_add_tax($products_price, $products_tax) * $qty;

and it should be:

$this->total += tep_add_tax($products_price * $qty, $products_tax);

to get rid of rounding errors. There are a couple of places where this happens.

Link to comment
Share on other sites

OK I see it; "my kingdom for a dot"

I had made both 'else's' as .= during my editing for new classes & such. Turned the little chart into a 3-column table with headings. Thank you for your eagle eyes. Do you ever get those cartoon spirals under your eyelids?!?

 

see at this product listing

 

that's a piece of logic, there, to re-do the specials price with a new $lc_text = if the special price doesn't have any price breaks. Once you see it, it makes sense.

Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA

Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad)

Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO

Link to comment
Share on other sites

Hey Jan-

 

While troubleshooting my admin/categories.php (I don't know what I did wrong but I fixed it!), I found this tiny error in the stock version that comes with the contribution:

 

at line 574 you have

 

<tr bgcolor="#ebebff"">

 

Note the extra "

 

Cheers

Stew

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Jan,

I am having a bit of trouble. When products have attributes and you are logged in the products won't delete from the cart permanetly. I mean permanetly by, if you delete such and such a product that has an attribute from your cart and log out and log back in then the item reappears in your cart. You can delete products with attributes either logged in or not from a stock install.

 

What I have found so far is that when you are logged in the <input type="hidden" is not being returned from this part of shopping_cart.php (shopping_cart.php is unmoddified by sppc or me)

	  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
								  from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
								  where pa.products_id = '" . $products[$i]['id'] . "'
								   and pa.options_id = '" . $option . "'
								   and pa.options_id = popt.products_options_id
								   and pa.options_values_id = '" . $value . "'
								   and pa.options_values_id = poval.products_options_values_id
								   and popt.language_id = '" . $languages_id . "'
								   and poval.language_id = '" . $languages_id . "'");
	  $attributes_values = tep_db_fetch_array($attributes);

	  $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
	  $products[$i][$option]['options_values_id'] = $value;
	  $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
	  $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
	  $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
	}
  }
}

When you are logged in your basket is stored in customer_basket and redundantly in customers_basket_attributes rather then just in the session like being unlogged and there are a few differences in the sessions when you are logged too. I just can't figure out why they product attributes arent be passed to that shopping_cart.php statement.

 

Maybe you can pointme in the right direction?

thanks

<Curt

Link to comment
Share on other sites

Hi I have added SPPC version 4, but I am getting the following MySQL warning message when viewing products:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/xxx-xxxxx.co.uk/public_html/catalog/includes/functions/database.php on line 103

 

The line that the error is refering to was not modified as part of the install - the code is

 

CODE

Line 102 function tep_db_num_rows($db_query) {

Line 103 return mysql_num_rows($db_query);

Line 104 }

CODE END

 

Any assistance would be greatly appreciated as it looks a great contribution..

 

Regards

Link to comment
Share on other sites

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/xxx-xxxxx.co.uk/public_html/catalog/includes/functions/database.php on line 103
Looks like you made a mistake when adding in the code. The line $no_of_listings = tep_db_num_rows($listing_query); e.g. in includes/modules/product_listing.php might be the culprit. The error means that $listing_query hasn't been done, so tep_db_num_rows has nothing to work with.
Link to comment
Share on other sites

I am going to do some more testing later today to see what module might be causing the error. I do have a couple others installed. Have you tested the deleting products with attributes while logged on your test store? wffu?

<Curt

Link to comment
Share on other sites

Have you tested the deleting products with attributes while logged on your test store?
I am at work now, so I haven't been able to test that. Tonight I don't have time, but I will check it out. I wonder if it has anything to do with/is similar to this bug.
Link to comment
Share on other sites

Have you tested the deleting products with attributes while logged on your test store? wffu?

<Curt

 

I tested it and had no problem.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

This may take a while then.

Stew: when you are logged in and have an item in your cart that has attributes, can you view page source and see if <input="hidden" line exists:

		<td>
<input type="hidden"  blah blah blah
 <tr>
<td align="center" class="productListing-heading">Remove</td>
<td class="productListing-heading">Product(s)</td>
<td align="center" class="productListing-heading">Qty.</td>
<td align="right" class="productListing-heading">Total</td>
 </tr>

or

		<td>
 <tr>
<td align="center" class="productListing-heading">Remove</td>
<td class="productListing-heading">Product(s)</td>
<td align="center" class="productListing-heading">Qty.</td>
<td align="right" class="productListing-heading">Total</td>
 </tr>

thanks ~ curt

Link to comment
Share on other sites

Looks like you made a mistake when adding in the code. The line $no_of_listings = tep_db_num_rows($listing_query); e.g. in includes/modules/product_listing.php might be the culprit. The error means that $listing_query hasn't been done, so tep_db_num_rows has nothing to work with.

 

Jan - Thanks for your feedback - I have checked the file you mention but code is OK - checked with file comparer. TheThe version of Oscomemrce that I am using is CRE Loaded 6.15 - should this make any difference? -

 

Regards

 

Mike

Link to comment
Share on other sites

I have checked the file you mention but code is OK - checked with file comparer. The version of Oscomemrce that I am using is CRE Loaded 6.15 - should this make any difference? -
Not really I guess. I just mentioned that module because I know there is tep_num_rows in it. This would be used on an index page, looking at a category. But perhaps you get the error on product_info.php? Perhaps the query is in an if else and not executed.
Link to comment
Share on other sites

This may take a while then.

Stew: when you are logged in and have an item in your cart that has attributes, can you view page source and see if <input="hidden" line exists:

thanks ~ curt

 

Yes, it's there.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Jan,

The problem lies in pbpc. Probably in shopping_cart_pbpc.php I am no expert, would you mind having a look? I installed ms2.2 and added sppc then pb_sppc then pbpc_sppc and that's when the error appeared. I didn't mod any of the files. I tar'd them up and exctracted them in the proper place. Since this is a new page ;) on the forum, this is the can't delete products with attributes when logged in problem (the product reappears after logout/log back in).

Thanks,

<Curt

Edited by curt
Link to comment
Share on other sites

Not really I guess. I just mentioned that module because I know there is tep_num_rows in it. This would be used on an index page, looking at a category. But perhaps you get the error on product_info.php? Perhaps the query is in an if else and not executed.

 

Jan - The error can be seen on http://www.web-remedy.co.uk/catalog/index....381bf361250f4dc - and is the same when viewing any products in a category.

 

The warning continues to be displayed when viewing the detail of a product - http://www.web-remedy.co.uk/catalog/produc...381bf361250f4dc - gets worse when added to the shopping cart!

 

Any guildance much appreciated.

 

Regards

 

Mike

Link to comment
Share on other sites

Mike,

The error can be seen on - and is the same when viewing any products in a category.

 

The warning continues to be displayed when viewing the detail of a product - gets worse when added to the shopping cart!

Bizar, the error seems to popup everywhere, also on places that are not even touched by SPPC (like boxes/shopping_cart) or shopping_cart.php itself. Since you seem to have lots of mods added, it is hard to even start to guess where the errors comes from. Perhaps you can paste the code for say boxes/shopping_cart.php here and then perhaps we can see where it could possibly come from. I mean: add one product to the shopping cart and generate three errors like that :blink:
Link to comment
Share on other sites

Curt,

The problem lies in pbpc. Probably in shopping_cart_pbpc.php I am no expert, would you mind having a look? I installed ms2.2 and added sppc then pb_sppc then pbpc_sppc and that's when the error appeared.
Weird error. I have no explanation for it at this point. Can you echo the contents of the cart and see if all the attributes and the category are present there:

 

If you add some new code to includes/boxes/shopping_cart.php:

<!-- shopping_cart //-->
	  <tr>
		<td>
<?php
// add some code to echo the contents of the cart
echo '<pre><span style="font-size: 9px;">';
print_r($cart);
echo '</pre>';
// end of adding some code

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

You should see something like this in the box shopping cart:

<span style="font-size: 9px;">shoppingcart Object
(
[contents] => Array
	(
		[1{4}1{3}5] => Array
			(
				[qty] => 1
				[category] => 4
				[attributes] => Array
					(
						[4] => 1
						[3] => 5
					)

			)

	)

[total] => 320.99
[weight] => 23
[cartID] => 32409
[content_type] => 
)

So you should see the category where the product is in, and of course the attributes should be in order.

Link to comment
Share on other sites

I think that this database query (around line 51):

	  $products_query = tep_db_query("select products_to_categories.products_id, categories_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " using(products_id) where customers_id = '" . (int)$customer_id . "'");

should look like this (or similar):

	  $products_query = tep_db_query("select cb.products_id, pdc.categories_id, cb.customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " cb LEFT JOIN " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " pdc on cb.products_id=pdc.products_id where cb.customers_id = '" . (int)$customer_id . "'");

Did I get that right?

I will that debuging code here in a bit...

Thanks

<Curt

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