Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Converting Points and Rewards system for osC BS


Tsimi

Recommended Posts

If I well remember that's not a bug. A guest can opt in for a regular account on checkout success. Tha'ts why he also gets the points even he is a guest at checkout process.

If he doesn't opt in, these points should not do any harm.

Link to comment
Share on other sites

Link to comment
Share on other sites

The points are added before the user chooses. They could be deleted, but they really make no harm.

Please consider that PWA and Points and rewards are in use since years and no one complained until now about.

Link to comment
Share on other sites

  • 4 weeks later...

I'm hoping to add some code that disables the points system for customers who are wholesale accounts - they already get good discounts.  I'm using your Pheonix Wholesale Pro module on a Phoenix build.

Are you planning on accounting for customer wholesale type in the points system in the future?

Since this is a complicated add-on with many modules, is there one location that would disable the entire system, or, do I need to add a check in every module/part of this add on?

Thanks! C

Two forks diverged in a git, and I— I took the fork traveled by burt, And that has made all the difference.

Link to comment
Share on other sites

Hello Corey,

You could just add a check if the customer is wholesaler to the checkout payment Points module and disable it. This will disable the possibility to redeem points.

If you would like to disable all info modules and the earn procedure, as well as the info in order mails etc, I'm afraid you'll have to add this check to all point &reward modules/hooks.

rgds
Rainer

Link to comment
Share on other sites

2 minutes ago, raiwa said:

If you would like to disable all info modules and the earn procedure, as well as the info in order mails etc, I'm afraid you'll have to add this check to all point &reward modules/hooks.

Got it, thanks.  Coffee time....

Two forks diverged in a git, and I— I took the fork traveled by burt, And that has made all the difference.

Link to comment
Share on other sites

  • 1 month later...

I contacted Raiwa directly regarding this and he recommended I post on this thread in case others have this issue.

The install instructions say:

Quote

* Enable Points Expires Auto Reminder and set the numbers of days
prior points expiration for the script to run. 

I was trying to determine how this script works so that I could adapt it for our integration with a third-party email system (Oracle's Bronto).  However, I found no "Script" anywhere in the code that would make the points auto expire.  Looking for guidance.

I tried to find the script for auto expire by searching for the constant 'MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_EXPIRES_REMIND' in the entire module package.  The only instances I found of this are in the install functions.  I did not find any other functions that check this value and then run a script.  

Does anyone use this feature?  

Edited by cdetdi

Two forks diverged in a git, and I— I took the fork traveled by burt, And that has made all the difference.

Link to comment
Share on other sites

1 minute ago, cdetdi said:

I contacted Raiwa directly regarding this and he recommended I post on this thread in case others have this issue.

The install instructions say:

I was trying to determine how this script works so that I could adapt it for our integration with a third-party email system (Oracle's Bronto).  However, I found no "Script" anywhere in the code that would make the points auto expire.  Looking for guidance.

I tried to find the script for auto expire by searching for the constant 'MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_EXPIRES_REMIND' in the entire module package.  The only instances I found of this are in the install functions.  I did not find any other functions that check this value and then run a script.  

It seems you didn't read my answer completely;

Quote

The constant "MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_EXPIRES_REMIND" is only used as a language constant in the e-mails. You can find it in the language file:
catalog\admin\includes\languages\english\customers_points_pending.php
It should not have an influence on the correct working of this feature.

The relevant constant for the auto expire function to work is: "MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_AUTO_EXPIRES".

It is used in several files:

- catalog\admin\customers_points.php
- catalog\admin\customers_points_pending.php
- catalog\includes\functions\redemptions.php
- catalog\includes\languages\english\my_points_help.php

I do not use the Addon myself, so I have to find time to research on this. However no one reported until now that the feature is not working. Maybe something with your store installation.

Please let me know on the forum if you get it to work.

 

Link to comment
Share on other sites

Raiwa - 

I read your response, and I followed all the constants.  I think you are missing my question.

'MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_EXPIRES_REMIND' is a CONFIGURATION KEY that, I assumed, would be used in a script to auto remind.  Accordingly I assumed it would be referenced in that script.

If it is only used in the language file in order to build constant. 'EMAIL_EXPIRE_INTRO' then I should be able to find the tep_mail function that uses that constant.  Searching/grepping for EMAIL_EXPIRE_INTRO yields no results other than the language files, so it isn't actually used anywhere that I can see.

I'm just looking for a simple yes or no really if this remind function exists.  I'll build it if not, just wanting clarification.

::EDIT FOR WORDINESS::

Edited by cdetdi

Two forks diverged in a git, and I— I took the fork traveled by burt, And that has made all the difference.

Link to comment
Share on other sites

4 minutes ago, cdetdi said:

Raiwa - 

I read your response, and I followed all the constants.  I think you are missing my question.

'MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_EXPIRES_REMIND' is a CONFIGURATION KEY, not just a language constant, so there's that. 

The language file uses that constant to build the constant. 'EMAIL_EXPIRE_INTRO'.  Searching/grepping for EMAIL_EXPIRE_INTRO yields no results other than the language files, so it isn't actually used anywhere that I can see.

I'm just looking for a simple yes or no really if this remind function exists.  I'll build it if not, just wanting clarification.

MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_EXPIRES_REMIND is just used as a constant which holds the number of days and is used in the language definition. It is not used for functionality.

For functionality the constant MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_AUTO_EXPIRES  is used in the above mentioned files.

The functionality exists.

Example: my_points.php:

<?php
    if (tep_not_null(MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_AUTO_EXPIRES)) {
      $expires_query = tep_db_query("select customers_points_expires from customers where customers_id = '" . (int)$customer_id . "' and customers_points_expires > curdate() limit 1");
      $expires = tep_db_fetch_array($expires_query);

 

Edited by raiwa
Link to comment
Share on other sites

To be more clear:

There is virtually no difference between a configuration constant and a text constant.

The only difference in OsCOmmerce is that a text constant is usually defined in a language file and only used to echo text. Meanwhile a configuration constant is usually defined in the database and used for condition checks and other functionality.

But it is not always like this. Language constants can be hold/defined in the database and viceversa configuration constants can be defined in a language file or for example in the configure.php files.

Hope this helps.

Link to comment
Share on other sites

1 hour ago, cdetdi said:

I'm just looking for a simple yes or no really if this remind function exists.  I'll build it if not, just wanting clarification.

O.K. I believe I got it now:

You do not ask for the general expire functionality, but for an e-mail to be sent advising that the points will expire and which would use the constant MODULE_HEADER_TAGS_POINTS_REWARDS_POINTS_POINTS_EXPIRES_REMIND which holds the days.

I searched  my backup files including the old version on which this Bootstrapped version is based on and there was a admin file called customers_points_expire.php which was included in the first beta versions of the Bootstrap update, but not any more in the first released bootstrap version. I do not recall why and didn't found any reference in this thread.

The language definitions and days constant is a relict from that and has no functionality in the actual version.

Maybe I find time to research.

If you wish to research on your own, here the file I found:

customers_points_expire.php

Be aware that the constants in this file need to be updated to the header tag constants.

If it's this, sorry that it tooks me time to get it 🙂

Edited by raiwa
Link to comment
Share on other sites

@cdetdi,

I found now the discussion about this removed feature during the update for Bootstrap:

Note that the original update was a teamwork of several forum members in which I took part. I only maintain it since then with updates for the newer BS and Phoenix versions.

Thank you for pointing on this. I'll remove the unused config and language constants in the next update.

Edited by raiwa
Link to comment
Share on other sites

  • 4 months later...
Link to comment
Share on other sites

  • 3 weeks later...

@raiwa Rainer I have just tried to install this on the latest 1.0.7.7. and received several errors when installing the headertags module as expected when reading the instructions. I know you normally do not upgrade your addons until a certain release point but thought I would just mention it. Here are the errors.

Quote

There was an error encountered when trying to add the points and rewards code to the file: "checkout_confirmation.php".
The original file has been recovered from the auto backup: "/points_backups/checkout_confirmation.php.bak" Please check the file and apply the required modifications manually.

There was an error encountered when trying to add the points and rewards code to the file: "checkout_process.php".
The original file has been recovered from the auto backup: "/points_backups/checkout_process.php.bak" Please check the file and apply the required modifications manually.

There was an error encountered when trying to add the points and rewards code to the file: "create_account.php".
The original file has been recovered from the auto backup: "/points_backups/create_account.php.bak" Please check the file and apply the required modifications manually.

There was an error encountered when trying to add the points and rewards code to the file: "create_account_success.php".
The original file has been recovered from the auto backup: "/points_backups/create_account_success.php.bak" Please check the file and apply the required modifications manually.

There was an error encountered when trying to add the points and rewards code to the file: "ext/modules/content/reviews/write.php".
The original file has been recovered from the auto backup: "/points_backups/write.php.bak" Please check the file and apply the required modifications manually.

I know you are busy, but if you could just look into one of the errors and point me in the right direction I could probably find the rest.

Also noticed that when installing the points payment module the text in the module says Enable Cash On Delivery Module. easy change I know.

I also believe that the PayPal page has also had changes made.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Hi Steve,

I'm working on the update for 1.0.7.7 and it is already very advanced. But I'm now pending on the next update to 1.0.7.8 for which Matt promised me to add support for checkout_process.php hooks which I would need. So I believe you should await this update. It's not worth to try to hotpatch the actual version for 1.0.7.7. There would be for sure more issues.

rgds
Rainer

Link to comment
Share on other sites

Points and rewards is something that I want to make use of. I wanted to see what it was like so added it to a copy of my test store.  I didn't think about it before but I could have added it to a copy of an earlier version. I have a few other addons that I need so have decided to upload the new store when I have all the basic bits available and after making sure that everything works ok then I  will add new features when they become available.

Thanks for the response though.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

PayPal IPN support added to the current version Points and Rewards Phoenix 3.0.1.

Update instructions are included.

Points and Rewards Phoenix 3.0.2.zip

Compatibility:
OSCOM Phoenix CE 1.0.3.0

Who is using PayPal standard and a Phoenix version up to aprox. 1.0.3.0, please test it and confirm if everything works as expected.

I'll then upload it.

Best regards
Rainer

Link to comment
Share on other sites

  • 2 weeks later...

Points and Rewards 3.1.0 beta for Phoenix 1.0.7.8

Version 3.1.0.

 - Updated for Phoenix 1.0.7.8+
 - No more core file modifications
 - Deprecated Header Tag Module and moved all configuration entries into Order Total Module
 - Merged all Shop Hooks into one SiteWide hook
 - Replaced checkout payment content module with form hook
 - Bootstrapped Admin pages
 - removed alternative info footer and box module and provided modified language files instead
 - moved the reviews point info message module to product info page
 - updated all modules to abstract_executable_module
 - updated coding to match Phoenix 1.0.7.8 standards
 - added product info pi system modules
 - Integrated PayPal Standard IPN support into siteWide hook

Points and Rewards Phoenix 3.1.0_beta.zip

 

This is a beta version for testing. There are many changes and it requires a complete new installation. Please use the latest Phoenix 1.0.7.8 from GitHub at least from Tuesday 2020/09/01.

PayPal Standard requires some updates which are not yet available on GitHub.

Modify includes/modules/payment/paypal_satndard.php line 178-179:

          require 'includes/system/segments/checkout/build_order_totals.php';
          require 'includes/system/segments/checkout/insert_order.php';

 

Edited by raiwa
Link to comment
Share on other sites

  • 3 weeks later...
On 9/4/2020 at 2:44 PM, raiwa said:

Points and Rewards 3.1.0 beta for Phoenix 1.0.7.8

Version 3.1.0.

 - Updated for Phoenix 1.0.7.8+
 - No more core file modifications
 - Deprecated Header Tag Module and moved all configuration entries into Order Total Module
 - Merged all Shop Hooks into one SiteWide hook
 - Replaced checkout payment content module with form hook
 - Bootstrapped Admin pages
 - removed alternative info footer and box module and provided modified language files instead
 - moved the reviews point info message module to product info page
 - updated all modules to abstract_executable_module
 - updated coding to match Phoenix 1.0.7.8 standards
 - added product info pi system modules
 - Integrated PayPal Standard IPN support into siteWide hook

Points and Rewards Phoenix 3.1.0_beta.zip

 

This is a beta version for testing. There are many changes and it requires a complete new installation. Please use the latest Phoenix 1.0.7.8 from GitHub at least from Tuesday 2020/09/01.

PayPal Standard requires some updates which are not yet available on GitHub.

Modify includes/modules/payment/paypal_satndard.php line 178-179:


          require 'includes/system/segments/checkout/build_order_totals.php';
          require 'includes/system/segments/checkout/insert_order.php';

 

Hello @raiwa ,, I am testing it on 1.0.7.8 and it show error when I go to  install the "Points" payment method module. (Modules -> Payment)
 

Fatal error: Uncaught Error: Call to a member function show_total() on null in C:\xxxx\xxxx\shop\includes\modules\payment\points.php:69 Stack trace: #0 C:\xxxx\xxxx\shop\includes\system\versioned\1.0.7.8\abstract_zoneable_module.php(19): points->update_status() #1 C:\xxxx\xxxx\shop\includes\system\versioned\1.0.7.8\abstract_payment_module.php(16): abstract_zoneable_module->__construct() #2 C:\xxxx\xxxx\shop\includes\modules\payment\points.php(32): abstract_payment_module->__construct() #3 C:\xxxx\xxxx\shop\admin\modules.php(174): points->__construct() #4 {main} thrown in C:\\xxxx\xxxx\shop\includes\modules\payment\points.php on line 69

and line 67-75  (points.php)
 

 if ($this->enabled == true) {
        $this->enabled = false;
        $cart_show_total = $cart->show_total();
        if ( tep_not_null($max_points = check_points_redemtion ($cart_show_total)) ) {
          if ($order->info['total'] <= tep_calc_shopping_pvalue($max_points)) {
            $this->enabled = true;
          }
        }
      }

 

Edited by Omar_one

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

If you want to try something before Rainer has a chance to look at it, consider changing

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

to

 if ($this->enabled && !defined('DIR_FS_ADMIN')) {

or

 if ($this->enabled && isset($_SESSION['cart'])) {

Either of those should fix installing.  So at least you could test more interesting things.  Of  course, there's some risk that this will break something else.  So you could wait for Rainer to look into it. 

Always back up before making changes.

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