Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

Strange... in SPPC 4.2.2 (the only version I checked) this is already shown in a new column, next to the customer name. The raw query was changed for that to:

 

$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";

 

 

Yes it is. the client wants it on the orders.php page also.. easy reference ya know??? all these joins confuse me to no end.. I'm not sure where or exactly how to add the query to the admin/orders.php -- the showing up on the site I got covered :)


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites

Yes it is. the client wants it on the orders.php page also.. easy reference ya know??? all these joins confuse me to no end.. I'm not sure where or exactly how to add the query to the admin/orders.php -- the showing up on the site I got covered :)

 

 

If you're having to insert a multi-query in multiple places, why not just create a function for it, and then call that function where it's needed?

You could then set all the parameters under the one function rule, and call the required parameters where they are needed.


Wearing a seatbelt prevents head injuries when the computer crashes - - - Yeah Right!!! - not in this office.

Share this post


Link to post
Share on other sites

$contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
       if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
       $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method . '<br>');
       $contents[] = array('text' => '<br>' . $oInfo->customers_group_name);

The line is there.. I tested by adding "xxx" after the < br > so I know it is picking up the line..

 

This is right and works fine at my site..

 

I belive I need to add something to the query array(s) above that section:

      $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, o.fedex_tracking, 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";

 

This line of yours are not the same as mine and that one Jan referred to.

Here is mine:

$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";

Compare mine and yours line and you'll see...

If you have installed SPPC right, you should have the same line as me and Jan..?


---------------

regards

sijo

---------------

 

Contrib: JMrating10 - Rate your products / osCommerce VTS - Virus & Threat Scanner

 

(osCommerce VTS now also checks for leading and trailing whitespace and also have a grep function)

Share this post


Link to post
Share on other sites

If you're having to insert a multi-query in multiple places, why not just create a function for it, and then call that function where it's needed?

You could then set all the parameters under the one function rule, and call the required parameters where they are needed.

 

 

Gaz, thanks, this thought process intrguiges me :) I can usualy manipulate someone else's code, but never learned to write it.. Sometimes the raw queries just don't make much sense to me.. sometimes I see what its doing clear as day. In this case I know I have to pull the customers_group_name from TABLE_CUSTOMERS, but adding it to the raw query or creating a new process and calling it is frankly a little out of my comfort zone :)

 

Can you give me an example?? Then I can try it myself.

 

Sijo, the line is different probably because I am using OSCmax which has many modifications already installed, then I added in Hide Categories & Products from Groups.

 

But, now looking closer at yours compared to mine, I see your line indeed has the queries I need, so I am going to do some more research, grab the latest version of SPPC and check the 3 query lines in that area.. thats my answer :)

 

thanks


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites

TADAAAAA.. mission accomplished.. I completely examined the line from 3 raw query lines (around ln 430 depending on other mods) the SPPC mod and compared them to the lines I have from the OSC max version.. and bingo.. ineed the customer group parts are missing.. what I did have extra was a fedex tracking mention so I added that to the SPPC version and bingo :) done deal.. thanks :)

 

I'm off now to let the people at OSCmax know maybe there is a problem with those lines..


Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Share this post


Link to post
Share on other sites

Looking for an attribute manager, a printer friendly order page and a price list that works with sppc. I am not finding any that have been adapted. have I missed one or does someone have one that was easy to adapt..

 

carie

Share this post


Link to post
Share on other sites

I have a problem with the NAB Transact credit card payment module because I have SPPC installed.

The NAB module uses the admin > My Store > Show Prices with Tax setting to determine whether tax is already included in the item price.

The developer is too busy with paid work to have a look at it at the moment and my php knowledge is limited.

The NAB module currently uses DISPLAY_PRICE_WITH_TAX to determine this. It looks like I should be changing it to use CUSTOMER_GROUP_SHOW_TAX.

Am I on the right track?

Share this post


Link to post
Share on other sites

Hi all,

 

I hope any of you guys can share with me how to edit the parse error coding i received while installing the Separate Pricing Per Customer 4.2.2 for RC2a for my version 2.2 rc2.

 

Parse error: syntax error, unexpected $end in /home/xxxx/public_html/test/admin/customers.php on line 1370

 

and i list out the code from 1343 to 1370

 

  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
   echo '            <td width="25%" valign="top">' . "\n";

   $box = new box;
   echo $box->infoBox($heading, $contents);

   echo '            </td>' . "\n";
 }
?>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

I compared the code with my original and it look the same. I have no knowledge in PHP coding and like to seek help to solve this error before I continue to install the rest of the contribution code.

 

Thank you and I look forward for your help.

Edited by Ariffshah

Share this post


Link to post
Share on other sites

I hope any of you guys can share with me how to edit the parse error coding i received while installing the Separate Pricing Per Customer 4.2.2 for RC2a for my version 2.2 rc2.

 

Parse error: syntax error, unexpected $end in /home/xxxx/public_html/test/admin/customers.php on line 1370

 

I compared the code with my original and it look the same. I have no knowledge in PHP coding and like to seek help to solve this error before I continue to install the rest of the contribution code.

 

If you use a decent program to edit PHP code (see below for a list of 35 different ones):

 

http://www.smashingmagazine.com/2008/05/07/35-useful-source-code-editors-reviewed/

it would give you all kinds of options like color coding to more easily find errors like that. Could be a curly brace or a semi-colon missing or something like that. Also the actual problem line could be much higher up than the line mentioned in the error.

Share this post


Link to post
Share on other sites

I am trying to create a custom greeting for my wholesale clients as well as the current one for logged in retail clients and guests. can someone help? code is in: cat/includes/functions/general.php around LINE 1031

 

// Return a customer greeting

function tep_customer_greeting() {

global $customer_id, $customer_first_name;

 

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {

$greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));

} else {

$greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

}

 

return $greeting_string;

}

_____________________________________________________________________________

I tried this but it is not much more than a guess. and doesn't work

 

// Return a customer greeting

function tep_customer_greeting() {

global
$sppc_customer_group_id,
$customer_first_name;

 

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('
$sppc_customer_group_id =’4’
')) {

$greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));

} else if {

(tep_session_is_registered('customer_first_name') && tep_session_is_registered('$sppc_customer_group_id =’2’ ')) {

$greeting_string = sprintf(TEXT_GREETING_WHOLESALE, tep_output_string_protected($customer_first_name),);

} else {

$greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

}

 

 

return $greeting_string;

}

Share this post


Link to post
Share on other sites

If you use a decent program to edit PHP code (see below for a list of 35 different ones):

 

http://www.smashingmagazine.com/2008/05/07/35-useful-source-code-editors-reviewed/

it would give you all kinds of options like color coding to more easily find errors like that. Could be a curly brace or a semi-colon missing or something like that. Also the actual problem line could be much higher up than the line mentioned in the error.

 

Thank you Jan for replying. At the moment I'm using Beyond Compare program to edit the PHP code. I will check with the link you provide and hope will get the program that can detect any parse error mistake being done while installing this wonderful contribution.

 

Cheers.

Share this post


Link to post
Share on other sites

I am trying to create a custom greeting for my wholesale clients as well as the current one for logged in retail clients and guests. can someone help? code is in: cat/includes/functions/general.php around LINE 1031

Looks like you want to do this:

 

// Return a customer greeting
function tep_customer_greeting() {
 global $sppc_customer_group_id, $customer_first_name;

 if (tep_session_is_registered('customer_first_name')) {
    $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
   if (tep_session_is_registered('sppc_customer_group_id')) {
      if ( $sppc_customer_group_id == '2' ) {
      $greeting_string = sprintf(TEXT_GREETING_WHOLESALE, tep_output_string_protected($customer_first_name));
     }
   } // end if ( tep_session_is_registered('sppc_customer_group_id') )
 } else {
   $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
 }
 return $greeting_string;
 }

Share this post


Link to post
Share on other sites

Show price with/without tax for shipping on Checkout Shipping and Order Confirmation page do not seem to be based on the setting for the current customer group (CUSTOMERS_GROUP_SHOW_TAX).

These seem to be based on the My Store setting for "Display Prices with Tax" (DISPLAY_PRICE_WITH_TAX).

This is causing a problem because I have some groups with tax displayed and some without.

How can I set the inclusion or exclusion of tax in the shipping price on these pages to depend on the setting for the current customers group id and display of prices before login based on the default group 0?

Share this post


Link to post
Share on other sites

OK. I have now set My Store > Show Prices with Tax to true.

The shipping cost ex-tax is $9.81

I have one group "Consumer" that it set to Show Prices WITH Tax and Tax Exempt = No.

Shipping is shown as $10.79 (includes tax) on both Shipping Method and Order Confirmation pages.

Tax is calculated on item plus $9.81

 

I have another group "Dealer" this is set to Show Prices WITHOUT Tax and Tax Exempt = No.

Shipping is shown as $10.41 on the Shipping Method page and $11.45 on the Order Confirmation page.

Tax is calculated on item plus $10.41.

 

Can someone tell me how is the Dealer group is being charged a different shipping price?

It is not even tax on tax. ($9.81 + 10% = $10.79 + 10% = $11.87).

Share this post


Link to post
Share on other sites

Please ignore my previous posts in this thread.

I just realised that my test accounts had different postcodes, hence, different shipping costs.

Ploblem is solved.

-

Share this post


Link to post
Share on other sites

Still need help with this one.

I thought I had solved the problem but I hadn't.

Sending details to the NAB credit card gateway for a customer that is in a group that has "Show Prices with/without Tax" set to WITH works correctly.

However, the correct details are not sent for a customer in a group for which the setting is WITHOUT.

For this customer the shipping prices are shown excluding tax but when you get to the Order Confirmation page the shipping price is shown with tax.

This is the shipping price that is sent to the gateway along with the correct tax, therefore, the tax is charged twice.

How do I change the shipping on the Order Confirmation page to show and pass on the ex-tax price for customers in a group set to show prices WITHOUT tax?

Share this post


Link to post
Share on other sites

hi, wondering about two tings.

 

- Is there posible to make one group having for instance 75% off the original price on all items without edit all the products?

 

- If one item who has 400 different prices is on special price for one week, can everyone get the special price, or do i have to manualy edit the prices for all the 400 customers?

Share this post


Link to post
Share on other sites

- Is there posible to make one group having for instance 75% off the original price on all items without edit all the products?

In a way. With a simple sql statement you can add all prices using a factor * products_price to the table customer_group_prices. This is mentioned a couple of times in this thread.

 

- If one item who has 400 different prices is on special price for one week, can everyone get the special price, or do i have to manualy edit the prices for all the 400 customers?

The contribution is called pricing per customer but it is really about customer groups. It is not really practical to have 400 different customer groups.

Share this post


Link to post
Share on other sites

Sending details to the NAB credit card gateway for a customer that is in a group that has "Show Prices with/without Tax" set to WITH works correctly.

However, the correct details are not sent for a customer in a group for which the setting is WITHOUT.

For this customer the shipping prices are shown excluding tax but when you get to the Order Confirmation page the shipping price is shown with tax.

This is the shipping price that is sent to the gateway along with the correct tax, therefore, the tax is charged twice.

How do I change the shipping on the Order Confirmation page to show and pass on the ex-tax price for customers in a group set to show prices WITHOUT tax?

As far as I can recall we never have heard of this problem before. On the order confirmation page the price for an item is always with tax whether you want to show prices including tax (like we have to for consumers in Europe) or without tax (like e.g. in the US).

 

So it is a bit hard to fathom that suddenly the shipping is taxed twice.

Share this post


Link to post
Share on other sites

The contribution is called pricing per customer but it is really about customer groups. It is not really practical to have 400 different customer groups.

 

Is it posible to have unlimited customer groups, or is it a maximum?

 

I see the unpractical ting, but probably i need to have one group for each customer.

Share this post


Link to post
Share on other sites

As far as I can recall we never have heard of this problem before. On the order confirmation page the price for an item is always with tax whether you want to show prices including tax (like we have to for consumers in Europe) or without tax (like e.g. in the US).

 

So it is a bit hard to fathom that suddenly the shipping is taxed twice.

 

Hi Jan,

Thanks for your reply. It looks like the problem is in the NAB Transact gateway module.

Here is an example of what is happening.

Order Confirmation page.

Item ex-tax = $54.55

Shipping incl. tax = $10.79

Tax = $6.44 (54.44 + 9.81 (shipping ex-tax)*10%)

Surcharge = $1.70

Total = $72.49

 

NAB Transact page (Bank website)

Item ex-tax = $54.55

Shipping incl. tax = $10.79

Tax = $6.44

Surcharge = $1.70

Total = $73.48

 

It looks like I'll have to figure out where the shipping is being sent to the bank and get it to send the ex-tax price for shipping.

The developer for this module is too busy to look at it at the moment. Can you suggest what I should be looking for in his code?

 

Thanks,

Lester

Share this post


Link to post
Share on other sites

It looks like the problem is in the NAB Transact gateway module.

 

Shipping incl. tax = $10.79

I have the feeling that the shipping price should be shown ex tax also but I can't find the code in neither checkout_payment.php or checkout_confirmation.php. Been too long ago I looked at that code.

Share this post


Link to post
Share on other sites

I have the feeling that the shipping price should be shown ex tax also but I can't find the code in neither checkout_payment.php or checkout_confirmation.php. Been too long ago I looked at that code.

This looks like the line in the NAB module that gets the shipping cost.

Where would I find the shipping cost displayed on the shipping method page?

Share this post


Link to post
Share on other sites

I have the feeling that the shipping price should be shown ex tax also but I can't find the code in neither checkout_payment.php or checkout_confirmation.php. Been too long ago I looked at that code.

 

Oops. Forgot to past the code in the last message.

$gateway_vars[MODULE_PAYMENT_NAB_TRANSACT_HPP_PROD_DESC_SHIPPING.': '.$shipping_desc] = '1,'.number_format((float)$order->info['shipping_cost'], 2, '.', '');

Share this post


Link to post
Share on other sites

Looks like you want to do this:

 

// Return a customer greeting
function tep_customer_greeting() {
 global $sppc_customer_group_id, $customer_first_name;

 if (tep_session_is_registered('customer_first_name')) {
    $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
   if (tep_session_is_registered('sppc_customer_group_id')) {
      if ( $sppc_customer_group_id == '2' ) {
      $greeting_string = sprintf(TEXT_GREETING_WHOLESALE, tep_output_string_protected($customer_first_name));
     }
   } // end if ( tep_session_is_registered('sppc_customer_group_id') )
 } else {
   $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
 }
 return $greeting_string;
 }

Jan you are always so helpful, i thank you! however, its not working :'( I have the wholesale greeting in lang/english.php file, and i can log in as a wholesale buyer but it is returning the same result for logged in retail and wholesale accounts. in admin, my groups are listed as retail 4 and wholesale 2. what am i missing? site goes online saturday and my brain is misfiring after days of computer code. plus I really dont know what i am doing :-"

carie

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

×