Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

The rest of the install instructions for Minimum Order Amount stay the same
Actually, you can set the minimum amounts for each customer group. See this post and a few post earlier on that page (127) to set Minimum order amount for different customer groups.

 

Regarding the shipping options, did you enable them in the admin for the different customer groups (I know it sounds elemental, but I guess I would forget about it myself when adding a new shipping option.

Link to comment
Share on other sites

Actually, you can set the minimum amounts for each customer group. See this post and a few post earlier on that page (127) to set Minimum order amount for different customer groups.

Great! That will be helpful for those who have multiple groups with minimum order amounts! :D

 

Regarding the shipping options, did you enable them in the admin for the different customer groups (I know it sounds elemental, but I guess I would forget about it myself when adding a new shipping option.

 

Ummmm - there's a way to do this :blush: Oh boy - better go check my Admin panel <while crawling under a rock) :lol:

 

Well - while I'm checking out my Admin panel - would you happen to know why this is happening to me on the minimum amount contrib -

 

I have everything setup now like this:

if ($customer_group_id != '0' && $order->info['subtotal'] < MIN_ORDER_AMOUNT) {

so that it goes off the subtotal and we don't end up getting taxes or shipping calculated in with the minimum dollar amount. Also - it just says < (for less than I believe) rather than <= (which I think is less than or equal to).

 

My brain - looking at this code - feels that the message alerting a wholesaler that there is a minimum $50 requirement should ONLY be showing up if their subtotal is less than the MIN_ORDER_AMOUNT ... but the message is always there for wholesalers regardless of their order subtotal ?? :huh:

 

Thankfully there's no message for the retail group or guests :)

~Tracy
 

Link to comment
Share on other sites

Regarding the shipping options, did you enable them in the admin for the different customer groups (I know it sounds elemental, but I guess I would forget about it myself when adding a new shipping option.

 

Ok - I found this section in my Admin (Customers -> Customer Groups) and both Retail and Wholesale are set to Use settings from Configuration. Is that the right setting? :blush:

~Tracy
 

Link to comment
Share on other sites

I have everything setup now like this:

if ($customer_group_id != '0' && $order->info['subtotal'] < MIN_ORDER_AMOUNT) {

so that it goes off the subtotal and we don't end up getting taxes or shipping calculated in with the minimum dollar amount. Also - it just says < (for less than I believe) rather than <= (which I think is less than or equal to).

 

My brain - looking at this code - feels that the message alerting a wholesaler that there is a minimum $50 requirement should ONLY be showing up if their subtotal is less than the MIN_ORDER_AMOUNT ... but the message is always there for wholesalers regardless of their order subtotal ??

If this is on the page shopping_cart.php the function $cart->show_total() does not add shipping (but does add tax) to the contents of the cart. I wonder if the object $order is already active on that page. I'm not sure when it is setup, but my guess is it is not "activated" until you hit checkout. So $order->info['subtotal'] might always be zero :)

 

You can check it by adding to the footer or at the bottom of the file (wrapped in HTML comment tags if you don't want to have it public):

<!--
echo '<pre>Object order is: ';
print_r($order);
echo '</pre>';
-->

Link to comment
Share on other sites

If this is on the page shopping_cart.php the function $cart->show_total() does not add shipping (but does add tax) to the contents of the cart. I wonder if the object $order is already active on that page. I'm not sure when it is setup, but my guess is it is not "activated" until you hit checkout. So $order->info['subtotal'] might always be zero :)

 

You can check it by adding to the footer or at the bottom of the file (wrapped in HTML comment tags if you don't want to have it public):

<!--
echo '<pre>Object order is: ';
print_r($order);
echo '</pre>';
-->

 

Ahhh - I didn't realize that :blush: You are correct - the Object order was empty - so I checked $cart and it had total in it so I went back to:

$cart->show_total() < MIN_ORDER_AMOUNT) and all is functioning properly now :D Thank you!!

 

So now I'm back to trying to figure out why my shipping is not showing - any other thoughts on that one?

You can see what I mean here: http://www.mmherbs.dreamhosters.com (Just put TEST in the comments box if you complete an order)

~Tracy
 

Link to comment
Share on other sites

Well - I'm getting a bit confused now :(

 

I removed (through admin) all of the shipping modules under Shipping and the shipping module under Order Total.

 

I then went through FTP and deleted all of the shipping modules in both includes/languages/english/modules/shipping and includes/modules/shipping as well as the shipping module in includes/modules/order_total and includes/languages/english/modules/order_total

 

I then uploaded all of these files from the clean osC I started with for the store.

 

Then I went back into admin - installed the Table Rate module and set up the info for what order amount = what shipping amount and I installed the shipping module in Order Total and set it to show shipping.

 

All this after verifying that I didn't have any shipping contributions installed and that none of the contributions I had tried in the past had changed any other files.

 

Still - no shipping showing up during the checkout process :blink: :'(

 

What other files should I be comparing to stock osC files that would have to do with whether or not the shipping shows up and gets calculated during checkout?

~Tracy
 

Link to comment
Share on other sites

Then I went back into admin - installed the Table Rate module and set up the info for what order amount = what shipping amount and I installed the shipping module in Order Total and set it to show shipping.

 

All this after verifying that I didn't have any shipping contributions installed and that none of the contributions I had tried in the past had changed any other files.

 

Still - no shipping showing up during the checkout process

And you did enable the shipping contributions for the groups iin admin/customer_groups.php ?
Link to comment
Share on other sites

And you did enable the shipping contributions for the groups iin admin/customer_groups.php ?

 

Well - in my Admin>Customers>Customer Groups file I have the radio button selected for Use settings from Configuration for both Payment and Shipping and I have this setup for both groups.

 

Is that what you are asking about, or is there somewhere else I should be doing this?

~Tracy
 

Link to comment
Share on other sites

I've been looking through my database (configuration table) to see if anything looked amiss here.

 

My configuration_group table says group ID 7 is Shipping/Packaging and group ID 6 is Hidden from configuration

 

in my configuration table I have

MODULE_SHIPPING_ZONES_COUNTRIES_5, MODULE_SHIPPING_ZONES_COUNTRIES_4 and MODULE_SHIPPING_ZONES_COUNTRIES_3 (as well as 5, 4 & 3 for MODULE_SHIPPING_ZONES_COST and MODULE_SHIPPING_ZONES_HANDLING) and they are all listed as Group ID 6

 

The MODULE_SHIPPING_ZONES_COST_3 and 5 above have a configuration_value that is the same as my Table Rate, but 4 doesn't have anything in the configuration_value field.

 

the MODULE_SHIPPING_ZONES_COUNTRIES_5 has All Others in configuration_value, but 3 & 4 have nothing in that field.

 

So I'm now curious - should I have a 5, 4 & 3 for the above? Should some of them have blank fields where others have information? Should they be under group ID 6 instead of 7?

 

If I remove my shipping modules in admin, delete the MODULE_SHIPPING_ZONES_* rows in the database and then re-install the shipping I want through my admin will it re-populate the database with the correct info or would I be seriously messing things up?

~Tracy
 

Link to comment
Share on other sites

Well - in my Admin>Customers>Customer Groups file I have the radio button selected for Use settings from Configuration for both Payment and Shipping and I have this setup for both groups.

 

Is that what you are asking about, or is there somewhere else I should be doing this?

Then you are set what SPPC concerns. One way to see if SPPC is the culprit is to exchange your includes/classes/shipping.php with the standard osC one because that is the only file that regulates for SPPC what is loaded.

 

Also check your table configuration for configuration tile "Installed Modules", configuratin key MODULE_SHIPPING_INSTALLED to see if it is a semi-colon separated list of modules like flat.php;table.php;upsxml.php;usps.php

Link to comment
Share on other sites

Well - I might be getting closer to narrowing down the problem (still unsure if I can delete the above from my database though).

 

If I change Table Rate so that Shipping Zone is ---none--- then the shipping shows up during checkout! But if I tell it Shipping Zone US, I no longer see shipping during checkout when signed in as a customer from the US :blink:

~Tracy
 

Link to comment
Share on other sites

Then you are set what SPPC concerns. One way to see if SPPC is the culprit is to exchange your includes/classes/shipping.php with the standard osC one because that is the only file that regulates for SPPC what is loaded.

 

Also check your table configuration for configuration tile "Installed Modules", configuratin key MODULE_SHIPPING_INSTALLED to see if it is a semi-colon separated list of modules like flat.php;table.php;upsxml.php;usps.php

 

That appears to look correct in the database as the only one I have installed is the Table Rate, and the only one it shows under configuration_value for that row is table.php

 

However - I did look in the database under MODULE_SHIPPING_TABLE_ZONE and if I have my zone set to ---none--- in admin, then it has a 0 in the database, but if I set it to US in admin it has a 2 in the database. Does this mean I should have a MODULE_SHIPPING_ZONES_2 in the database (instead of 3, 4 & 5) ?

~Tracy
 

Link to comment
Share on other sites

Well - I might be getting closer to narrowing down the problem (still unsure if I can delete the above from my database though).

 

If I change Table Rate so that Shipping Zone is ---none--- then the shipping shows up during checkout! But if I tell it Shipping Zone US, I no longer see shipping during checkout when signed in as a customer from the US

Interesting.... Better check if the correct parameters are set when logging in. So instead of print_r($object), use print_r($_SESSION); You should see something like this on the bottom:

	[customer_id] => 3
[customer_default_address_id] => 3
[customer_first_name] => Jan
[sppc_customer_group_id] => 1
[sppc_customer_group_show_tax] => 0
[sppc_customer_group_tax_exempt] => 1
[customer_country_id] => 150
[customer_zone_id] => 0

The country_id and customer_zone_id are important.

Link to comment
Share on other sites

However - I did look in the database under MODULE_SHIPPING_TABLE_ZONE and if I have my zone set to ---none--- in admin, then it has a 0 in the database, but if I set it to US in admin it has a 2 in the database. Does this mean I should have a MODULE_SHIPPING_ZONES_2 in the database (instead of 3, 4 & 5) ?
Frankly, I don't have a clue.
Link to comment
Share on other sites

Interesting.... Better check if the correct parameters are set when logging in. So instead of print_r($object), use print_r($_SESSION); You should see something like this on the bottom:

	[customer_id] => 3
[customer_default_address_id] => 3
[customer_first_name] => Jan
[sppc_customer_group_id] => 1
[sppc_customer_group_show_tax] => 0
[sppc_customer_group_tax_exempt] => 1
[customer_country_id] => 150
[customer_zone_id] => 0

The country_id and customer_zone_id are important.

 

Oh how bizarre! :huh:

 

Here is what I got at the end:

[customer_id] => 2
[customer_default_address_id] => 2
[customer_first_name] => Tracy
[sppc_customer_group_id] => 0
[sppc_customer_group_show_tax] => 0
[sppc_customer_group_tax_exempt] => 1
[customer_country_id] => 223
[customer_zone_id] => 37
[sendto] => 2
[cartID] =>

 

How do I find out if the US is country_id 223? I know if I say US for zones in the Table Rate module it comes back with the number 2 in the database under configuration_value

 

223 is the Country of Origin in the database - which is the US in our case - so maybe that part is correct?

 

Do I somehow need to set the US Zone to number 37 somewhere?

~Tracy
 

Link to comment
Share on other sites

How do I find out if the US is country_id 223? I know if I say US for zones in the Table Rate module it comes back with the number 2 in the database under configuration_value

 

223 is the Country of Origin in the database - which is the US in our case - so maybe that part is correct?

 

Do I somehow need to set the US Zone to number 37 somewhere?

If you look in the table zones you will find that zone_id 37 is Montana and zone_country_id is the US. So that part should be OK.
Link to comment
Share on other sites

223 is the Country of Origin in the database - which is the US in our case - so maybe that part is correct?

 

Do I somehow need to set the US Zone to number 37 somewhere?

 

Ok - in my Zones table - all of the US States have their own Zone ID - but the US Country has zone_country_id of 223

 

Zone 2 is actually AK (Alaska) - most strange :blink:

~Tracy
 

Link to comment
Share on other sites

Ok - in my Zones table - all of the US States have their own Zone ID - but the US Country has zone_country_id of 223

 

Zone 2 is actually AK (Alaska) - most strange :blink:

 

I'm not allowed to browse my zones_to_geo_zones DB Table in phpMyAdmin- is that right?

~Tracy
 

Link to comment
Share on other sites

I'm not allowed to browse my zones_to_geo_zones DB Table in phpMyAdmin- is that right?

 

Ok - I can view my geo_zones table, and that has the US setup with a geo_zone_id of 2

 

So - should my table rate module be looking for geo_zone_id rather than zone_id ?

~Tracy
 

Link to comment
Share on other sites

Maybe nothing is saved in there?

 

You don't happen to use the latest osC and not having fixed this bug?

 

Well - I don't know if my osC is the latest or not (it's 2.2ms2-060817) - but I did find the line of code mentioned in that post and changed it.

 

I then removed and installed the Table Rate again and re-set it up - but I still have the same problem and customer_zone_id is still showing up at the bottom of the page as 37 (with the little script you had me put on for debugging).

 

Is there something else I should be doing after changing that line of code?

~Tracy
 

Link to comment
Share on other sites

Ok - I can view my geo_zones table, and that has the US setup with a geo_zone_id of 2

 

So - should my table rate module be looking for geo_zone_id rather than zone_id ?

This is the piece of code that enables it (includes/modules/shipping/flat.php):

	  if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
	$check_flag = false;
	$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
	while ($check = tep_db_fetch_array($check_query)) {
	  if ($check['zone_id'] < 1) {
		$check_flag = true;
		break;
	  } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
		$check_flag = true;
		break;
	  }
	}

	if ($check_flag == false) {
	  $this->enabled = false;
	}
  }

Perhaps you have to set up a geo_zone US and add all the states to that geo_zone?

Link to comment
Share on other sites

Is there something else I should be doing after changing that line of code?

 

Ah Hah!!! :D

 

I've been scouring the forums for further hints as to what's going on while posting with you here and I found that I could go into my Admin>Locations/Taxes>Tax Zones and when I clicked on my US tax zone I found that it was EMPTY! I needed to insert the US into the US tax zone and then it worked correctly!

 

Now - I have no idea how I ended up with empty tax zones (unless that has to do with that code you had me fix) - but at least we've got that part of it fixed :D

 

YAY!!! I'm doin' my Happy Dance!!!! :D :D I've been trying to figure this one out for over a month!!

THANK YOU THANK YOU THANK YOU!!!!! :D

~Tracy
 

Link to comment
Share on other sites

Oh - this now brings me back to a SPPC feature I need to have with the shipping.

 

In the Order Total section in Admin there is a Shipping option where you choose to show the shipping and whether or not to offer free shipping based on the order total. We need to be able to offer free shipping within one zone for retail orders equal to or more than $150 and on wholesale orders equal to or more than $200.

 

How would you set that up?

~Tracy
 

Link to comment
Share on other sites

No, you are missing part(s) of the regular osC code:

	  if ($status_tmp_product_prices_table == true) {
 $from_str = "from " . TABLE_PRODUCTS . " p 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_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_MANUFACTURERS . " m using(manufacturers_id) ";
  }
 // EOF Separate Pricing Per Customer

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
if (!tep_session_is_registered('customer_country_id')) {
  $customer_country_id = STORE_COUNTRY;
  $customer_zone_id = STORE_ZONE;
}
$from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
 }

 $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

 $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

In particular you are missing the:

  $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

This is another 1054 error code: missing pd.products_id because " . TABLE_PRODUCTS_DESCRIPTION . " pd, is missing.

 

You need to add those changes to the latest osC updated version of that page !

Hello Janz,

 

Can ypu please help me with my little problem,

 

After installing the Separate Pricing Module and STS, I have a probem with the search function.

 

this is what I get when trying to search.

 

 

1066 - Not unique table/alias: 'pd'

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%plasma%' or p.products_model like '%plasma%' or m.manufacturers_name like '%plasma%') )

 

[TEP STOP]

 

I have search the Forum, but cant seen to find an answer to this problem.

 

Ant help would be appriciated.

:blush:

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