Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

  • 4 months later...

where is $cd_id set ?

 

I have 5 groups and the default $cg_id is 0 I want to change this to another number as default so when a customer is not logged in they see the default group i set as default.

 

I have tried

    function get_customer_group_id() {
      if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
        $_cg_id = $_SESSION['sppc_customer_group_id'];
      } else {
         $_cg_id = 5;
      }
      return $_cg_id;
    }

in both PriceFormatterStore.php and PricFormatter.php but this does not appear to have any affect?

Link to comment
Share on other sites

Anyone yet get the admin/includes/classes/order.php integrated with the new PayPal App v4.039?

 

I'm struggling with the order query - its just beyond my skill level...

 

The app has the $order_query (from a stock 2.3.4) changing from

$order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

To

$order_query = tep_db_query("select o.*, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.orders_id = '" . (int)$order_id . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "'");

With SPPC the order query adds the customer group like

$order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, o.customers_telephone, o.customers_email_address, customers_address_format_id, customers_group_name, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, cp_tracking from " . TABLE_ORDERS . " o left join " . TABLE_CUSTOMERS . " using(customers_id) left join " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) where orders_id = '" . (int)$order_id . "'");

I'm not clear where this query is now taking place (I presume it must be????).... and therefore not clear how to re-integrate.

Link to comment
Share on other sites

Hey John @@joli1811, it looks like this set of queries needs a close look as well;

     $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
    } elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
      $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
    } else {
      $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";

from SPPC

	    // BOF Separate Pricing Per Customer
      $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
      $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
    } elseif (isset($HTTP_GET_VARS['status'])) {
      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
      $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
    } else {
      $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
      // EOF Separate Pricing Per Customer
Link to comment
Share on other sites

Maybe going to have get that Jan Zonjee out of semi retirement for this one (w00t)

 

have not found the query but still searching initally thought it was moved guess this is the start of 2.4/5

$order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
Edited by joli1811
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

  • 3 weeks later...

Hi !

I'm looking for a way to change the price of all products depending from the group and not manually modify each price of each product. For instance the retail pricing is the wholesale pricing minus 20% for all products. Do you know if there is an add-on to do that ?

Link to comment
Share on other sites

Not sure it is exactly what you need but will do a precentage discount on all products in a given catagory/ and filtered by group (retail/wholesale)

 

http://addons.oscommerce.com/info/3366

 

works with 2.3.....  I believe it is relatively easy install if my memory serves me right

 

of course you first need sppc installed .

 

Regards

Joli

 

PS: would do that the otherway round haha (w00t)

 

"retail pricing is the wholesale pricing minus 20% for all product"

Edited by joli1811
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

  • 4 months later...

I posted this somewhere else also, but thought it should be here.

 

There is a modification that is not found in the SPPC package  v_2_3_3_4_revised, http://addons.oscommerce.com/info/716.

 

The file in question is catalog/includes/functions/general.php and in my comment here, it applies specifically to OSC V.2.3.4. and OSC V.2.3.3. I have not tested any other version or incremental upgrade.

 

Without this modification customer specific tax exempt status does not work on the customer side.

 

This modification was in package: "Full set of new and amended files for SPPC 4.2.2 on oscommerce 2.3.1  Mar 8, 2011", but somehow was lost from here to this "v2_3_3_4_revised  Jan 4, 2014".

 

The needed modification is around line 370-380 roughly. Code to be added is this:

" . $additional_for_specific_taxes . "

Procedure for change-

Change this line of code:

      $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' group by tr.tax_priority");

To this:

// BOF Separate Pricing Per Customer, specific taxes exempt modification
      $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' " . $additional_for_specific_taxes . " group by tr.tax_priority");
// EOF Separate Pricing Per Customer, specific taxes exempt modification

Have a great day. :)

Alan

Production:
osCommerce V. 2.3.4BS
VPS Box

Link to comment
Share on other sites

This is my second entry in finding code issues for Separate Pricing Per Customer v_2_3_3_4_revised contribution 4 Jan 2014. http://addons.oscommerce.com/info/716

I have tested this only on OSC V.2.3.4

First let me tell you what my problem was. In Admin I could not edit properly the second or third group in Customers Groups. When I clicked/highlighted the second or third group that I had created, then clicked Edit in the menu, the first group would open up. Any changes made would affect the first group.

 

The only way I could edit the second or third group was to click/highlight the group I wanted then click the same line a second time; then it would open the correct group to edit.

 

This issue was found in catalog/admin/customers_groups.php

 

I found this problem on about Line 852

There are two changes to make on this line. Change categories_group_id to customers_group_id.

 

Change this line of code:

            $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_group_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_group_id . '&action=confirm')));

To this:

            $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_group_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_group_id . '&action=confirm')));

Have good day. :thumbsup:

Alan

Production:
osCommerce V. 2.3.4BS
VPS Box

Link to comment
Share on other sites

  • 3 weeks later...

Hi All, I have a couple PM's from you looking for help installing SPPC and QPBPC on 2.3.4BS. I do plan on getting back to you.... And plan also to have a file package added to the current addon for 2.3.4BS.

 

Please be patient... My goal is to get my 2.3.4 BS live and fully de-bugged first.

Link to comment
Share on other sites

  • 2 weeks later...

We have SPPC 4.2.2 installed.

 

Our problem:

We do extensive use of 'Attribute prices for groups', which is accessible by going to to Admin --> Catalog --> Products Attributes --> click the 'group prices' button for the attribute of the desired product.

The store has over 2200 products with 5070 attributes in total, assigned to them. The page mentioned above only shows 10 assigned attributes, which makes for 507 pages to find the attribute for a particular product, to modify it's 'Attribute prices for groups'. Quiet a daunting task, as one can imagine.

 

Solutions we looked for:

We do have installed this addon:

New Attribute Manager http://addons.oscommerce.com/info/1119

and looked into:

AJAX Attribute Manager http://addons.oscommerce.com/info/4063

These provide an easier method to assign attributes to products, however neither of these support assigning 'Attribute prices for groups' to these attributes, that we know of.

 

Somebody must have run into this. Maybe there is a similar 'Attribute Manager' that supports this SPPC 'Attribute prices for groups' feature. Maybe someone came up with an easier way to do this.

 

Any suggestion on how to simplify this task would be greatly appreciated.

 

Thanks

Link to comment
Share on other sites

Hi All, I have finally got around to make a full file set for the 2.3.4 Community Bootstrap edition.

 

This file set includes a SPPC login content module and also a replacement (optional) version of admin/include/classes/order.php for uses with the Paypal App.

 

Let me know if you fined any bugs...

 

update is found here; http://addons.oscommerce.com/info/716

Link to comment
Share on other sites

Hi All, I have finally got around to make a full file set for the 2.3.4 Community Bootstrap edition.

 

This file set includes a SPPC login content module and also a replacement (optional) version of admin/include/classes/order.php for uses with the Paypal App.

 

Let me know if you fined any bugs...

 

update is found here; http://addons.oscommerce.com/info/716

 

Thanks Scott, I will check this out sooner or later. I'm still on installing SEO Header Tags Reloaded, actually installed, just trying to see how it works. 

Alan

Production:
osCommerce V. 2.3.4BS
VPS Box

Link to comment
Share on other sites

@@greasemonkey

 

Thank you

 

another observation in:

catalog\includes\modules\content\login\cm_sppc_login_form.php

 

      include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/login_form.php');

 

should be

 

      include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/sppc_login_form.php');

Link to comment
Share on other sites

With a standard unmodified advanced_search_results.php, If you search (logged out) and logged in as a member of a customer group, the prices appear to display correctly, so maybe no further changes are needed there.

Link to comment
Share on other sites

@@Hotclutch I have confirmed... niether file is required as advanced_search_results.php in bootstrap is built directly from the product_listing module.

 

 

another observation in:

catalog\includes\modules\content\login\cm_sppc_login_form.php

 

      include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/login_form.php');

 

should be

 

      include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/sppc_login_form.php');

Good catch.... There is also a bug (which this was masking) in /includes/modules/content/login/cm_sppc_login_form.php.

 

Let me know if you find anything else... I will wait a day or 2 to see if you (or anyone else) finds any other mistakes...

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