Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

I am working on a new installation of the Separate Pricing Per Customer contribution and have run in to an error that I cannot find a solution to. I am getting the following when I begin the check out process, on the checkout_shipping.php page:

 

Fatal error: Call to undefined function: calculate_price() in

/oscommerce/catalog/includes/classes/order.php on line 265

 

Has anyone had this same fatal error, and have you found a solution to it?

I think you have a pre-RC1 osC installation to which you added the current files of SPPC 4.2.0 which used RC1 pages. In RC1 a new function was added to includes/classes/currencies.php:

 

function calculate_price($products_price, $products_tax, $quantity = 1) {
global $currency;

return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity;
}

Of course there were more changes using that function so it would be best to manually update your other files to RC1 too.

Share this post


Link to post
Share on other sites
I think you have a pre-RC1 osC installation to which you added the current files of SPPC 4.2.0 which used RC1 pages. In RC1 a new function was added to includes/classes/currencies.php:

 

Hi Jan,

 

Thanks for your response. I have a new website hosted by GoDaddy.com, and they automatically installed osCommerce. It appears that it was an older version of osCommerce and you are correct. While there was a classes/currencies.php file in there, it must have been older. I replaced that one with the current one and the problem has seemed to go away (at least for now).

 

Thanks so much for your help!

 

 

I do have another question, while I have you. Will this contribution work okay with templates and skins, or will there need to be a lot of work done.

 

Thanks,

Carl

Edited by parr

Share this post


Link to post
Share on other sites
It appears that it was an older version of osCommerce and you are correct. While there was a classes/currencies.php file in there, it must have been older. I replaced that one with the current one and the problem has seemed to go away (at least for now).

There might be other problems mixing old and new...

I do have another question, while I have you. Will this contribution work okay with templates and skins, or will there need to be a lot of work done.

There is always extra work with templates I understand from people who have dealt with that (Vger for example). A lot of those templates have bad code in them, are not upgraded to newer versions, bugs etc. etc. They can be regarded as forks of osC. I have seen a bad example not so long ago where a query on index.php was totally wrong.

Share this post


Link to post
Share on other sites
Guest

Jan,

 

I finally figured out the problem with the attribute pricing. I installed the contribution "Add Multiple Products to Cart in Columns for SPPC" by djmonkey - NOT the one you recently updated. The one I have has the product_listing_multi_col file which is overriding the product_listing_col file.

 

I guess I have two options - try to update the multi_col file to include the necessary code (not my first choice as I can't code a thing) or back it out and install another contribution for the columns.

 

Does the Product Listing in Columns that you updated last month have the option to have the qty box?

 

Thanks!

 

Joanne

Share this post


Link to post
Share on other sites
There might be other problems mixing old and new...

 

Yes, I can see the potential for lots of problems. I went ahead and reinstalled everything from scratch with the latest files to avoid any problems. So far so good!

 

 

I do have another question. My website is primarily wholesale. Do you see any problem with making the default Customer Group for wholesale customers and then adding Retail as the next group? The reason I would like to do this, is that I will want some products (such as bulk packaging) available for wholesale customers only, and I don't see any way to not have these products show up for Retail (there does not seem to be a way to uncheck the default group, only added groups).

Share this post


Link to post
Share on other sites
...Do you see any problem with making the default Customer Group for wholesale customers and then adding Retail as the next group?...

 

Okay, I can already see the problem with doing this. I guess everyone sees the products listed under the default group, including guests. So I need to approach this from a different angle. Is there any way to list products that only my wholesale customers will see? There does not appear to be a way to uncheck Retail customers (the default group), so I cannot see how this would be possible.

 

Thanks in advance for your help.

Share this post


Link to post
Share on other sites
Is there any way to list products that only my wholesale customers will see? There does not appear to be a way to uncheck Retail customers (the default group), so I cannot see how this would be possible.

It's an addon on an addon: Hide Products from Customers for SPPC (not updated for RC1/SPPC 4.2.0 so you will need to go over the instructions and add it manually, mostly changing queries).

Share this post


Link to post
Share on other sites
Does the Product Listing in Columns that you updated last month have the option to have the qty box?

Had to check that, but yes can add a quantity box (together with attributes though). The setting in the admin for product listing is a bit ackward I think. You will need to enable the setting "Display Add Multiples column". There are two small bugs in the product_listing_col.php for SPPC though. One will show a repetition of attributes and one shows up as a strange style for an empty box that fills up the row.

Share this post


Link to post
Share on other sites

Hey Jan,

 

Hope all is well. By chance have you used the Quantity Price Breaks with Easy Populate? I get a 1136 error, but from what I can see, there are equal fields and data on the EP import?

 

Thanks JR

Share this post


Link to post
Share on other sites

Hi,

I just finished the install of SPPC but now on the website, I cannot more choose language and currency.

The 2 boxes are gone ? but only on the index page

 

Somebody an idea ?

 

Thanks

Share this post


Link to post
Share on other sites

Hi again,

 

I have a new request after installing SPPC + Hide category for SPPC

 

when I want, on the webpage, to creat a new account, the page come without error, but white

 

anybody an idea ?

 

Thanks

Share this post


Link to post
Share on other sites
I have a new request after installing SPPC + Hide category for SPPC

 

when I want, on the webpage, to creat a new account, the page come without error, but white

Probably an error after all. Is there a log of PHP errors for your account?

Share this post


Link to post
Share on other sites
Probably an error after all. Is there a log of PHP errors for your account?

 

Dag Jan,

 

no,

 

it's very strange, everithing is working perfect,but impossible to create a new account.

But I don't have error message

the page is coming in white ?

 

when I use my account for exemple, it's working and i don't see the hide category (perfect !!!)

 

do you have an idea ??

sorry to disturb you again and again.

Share this post


Link to post
Share on other sites
it's very strange, everithing is working perfect,but impossible to create a new account.

But I don't have error message

the page is coming in white ?

 

when I use my account for exemple, it's working and i don't see the hide category (perfect !!!)

No error but a white page? Hard to see how that could be not an error.

- What is the url that you see in the browser.

- When does this happen when you go to that page or when you push the submit button after having added all the info.

- What do you see when you do a view source of that white page. It might be white but there could be some html source with an error that doesn't show on the screen.

Share this post


Link to post
Share on other sites

JR,

By chance have you used the Quantity Price Breaks with Easy Populate? I get a 1136 error, but from what I can see, there are equal fields and data on the EP import?

Sorry, I have absolutely no clue about Ease Populate. I have read about the basic idea of it, using comma separated files to do an import in your database tables but I have never looked at the contribution to see how it actually works under the hood.

Share this post


Link to post
Share on other sites
I just finished the install of SPPC but now on the website, I cannot more choose language and currency.

The 2 boxes are gone ? but only on the index page

This is not in a file that SPPC changes. Those are loaded in includes/column_right.php:

  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
include(DIR_WS_BOXES . 'languages.php');
include(DIR_WS_BOXES . 'currencies.php');
 }

Might be a register globals issue. Perhaps it is solved when you change $PHP_SELF to $_SERVER['PHP_SELF']

Share this post


Link to post
Share on other sites

I just installed this contribution and everything is ok in admin side, but if I login as a customer marked as wholesale with better prices I see the same retail prices. What's wrong? Please give me a mind why customer don't see better prices even if it's marked to have such.

Share this post


Link to post
Share on other sites
This is not in a file that SPPC changes. Those are loaded in includes/column_right.php:

  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
include(DIR_WS_BOXES . 'languages.php');
include(DIR_WS_BOXES . 'currencies.php');
 }

Might be a register globals issue. Perhaps it is solved when you change $PHP_SELF to $_SERVER['PHP_SELF']

 

Thanks Jan.

 

I deleted all the config and I will do it again.

Probably I do some mistakes.

I will reinstall it this week.

Share this post


Link to post
Share on other sites
but if I login as a customer marked as wholesale with better prices I see the same retail prices. What's wrong?

Hard to say what you did wrong. For starters you could check if the correct sppc_customer_group_id is set as a session variable when you log-in.

Share this post


Link to post
Share on other sites

What exactly should be done to install this module?

 

According to the readme, a lot of changes should be done to some files...

 

...can't I just copy the catalog-folder from the module-zip into my present install, and simply run the sql-things?

 

And I understand this module correctly, as a module that can also make "price based on quantity" to all customers?

 

1 pcs. = €10

10 pcs. = €8 / pcs.

100 pcs. = €6 / pcs.

 

...or similar?

Edited by daller

Share this post


Link to post
Share on other sites
According to the readme, a lot of changes should be done to some files...

 

...can't I just copy the catalog-folder from the module-zip into my present install, and simply run the sql-things?

If you have got an unmodified RC1 shop you can do that with the files in the package. Not all files that are in the catalog and subdirectories are in the package though.

 

And I understand this module correctly, as a module that can also make "price based on quantity" to all customers?

No, for that you need to install the Quantity Price Breaks Per Product for SPPC contribution (manual addition, not updated for RC1, let alone RC2).

Share this post


Link to post
Share on other sites

Hey guys,

 

Do any of you know if there is a mod for SPPC that disables the "Free Shipping if under xxx" for specific groups?

 

Thanks!

Share this post


Link to post
Share on other sites
How can I check it?

As mentioned so often in this thread. Add (e.g. in the footer, inside PHP tags):

echo '<pre>';
print_r($_SESSION);

You might have to do a "view source" in your browser to see it.

Share this post


Link to post
Share on other sites
Do any of you know if there is a mod for SPPC that disables the "Free Shipping if under xxx" for specific groups?

Isn't that a define in the admin? You can change the original by adding a zero (for retail) in phpMyAdmin (table configuration) and then use that constant with the customer_group_id appended to it. You would have to add the one for groups to the table configuration if you want to change the amount. Then checking for it is not totally straightforward. If the constant is named FREE_SHIPPING1 you would need to use (constant)FREE_SHIPPING . "customer_group_id and also look if it is defined in case you don't want to offer free shipping to certain groups and not want to trigger a warning that the constant FREE_SHIPPING1 is not defined.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×