Strange work of your Hikashop AlphaUserPoints Plug

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #104142

Hi,
I notice a bad behavior of you payment points plugin.
So, first i have this first points situation



I have this setting on your plugin




I do a purchase of Euro 15,40 plus Euro 8 of shipping cost: the total is 23,40 - euro 1,80 for 36points = Euro 21,60

I set the order to payed and i have this situation



Then i set the order to confirmed and i have this




Finally i set the order to shipped and the final situation is



The sistem gives me an amount of 72 points
But i must have only 15 points that are the points of my last purchase.
What's wrong?


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #104175

Hi,

You have a wrong configuration in the plugin.
In the option "Give points on statuses" you should list all "valid" statuses. So "shipped" should be in the list too.

Can you provide some text values instead of big screenshots, it is a little bit complicated to analyse the history of order/points.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #104263

Yes, now it is better but it is not perfect.
So I have theese order statuses:
-none
-created
-waiting payment
-payed
-confirmed
-on shipping
-shipped
-cancelled
-refunded
The statuse i like to give points is payed, confirmed, on shipping and shipped (set on "Give points on statuses").
When a customer make an order the status is created and the system picks up the points to make the discount. This is OK.
Then, if i set the order on waiting payment the system refund the points. This is bad!

If I go from the order status created to the confirmed status directly the points system work well.
But i can not jump the waiting payment status and I can not give the point untill the order is payed.
What can i do to fix that?


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #104400

Hi,

Please replace in the plugin

		if( !empty($order->order_status) &&
			$order->order_status != $this->previousOrderStatus &&
			!in_array($order->order_status, $confirmed) &&
			(in_array($this->previousOrderStatus, $confirmed) || $this->previousOrderStatus == $created)
		){
By
		if( !empty($order->order_status) &&
			$order->order_status != $this->previousOrderStatus &&
			!in_array($order->order_status, $confirmed) &&
			in_array($this->previousOrderStatus, $confirmed)
		){
It will fix the problem in your configuration.
I will make more tests in order to finish the patch (there are some specific cases to support).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #104740

Hi,
i think there is something wrong on it.
I change the code on plugin>hikashoppayment>alphauserpoints>alphauserpoint.php
After that when i manage the status order i have a system block with a white page. It is the same, on frontend, when i add something on my cart.
When i come back to the original code all of things go fine.


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #104828

Hi,

The white page should be a php error (error 500), but I test the file in my side, I didn't have such problem.
Please check if you had an error logged in the "php error log" for this specific file (the plugin file).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #104839

Ok, i tried again and now it works.
Maybe i made a mistake with a bracket.
:whistle:
Excuse me, Thanks!

Will it be on the next release or i have to keep it in mind?


my site with Hikashop
www.lacasettabio.it
Last edit: 11 years 6 months ago by lacasetta.

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #104847

Hi,

It will be.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: lacasetta

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #104945

Hi,
I'm sorry but i have another problem.
I set the access level for only registered user like this:

Access level Custom

Public
- - Manager
- - - - Administrator
X- - Registered
- - - - Author
- - - - - - Editor
- - - - - - - - Publisher
- - - - GAS
- - - - Rivenditori
- - Super Users

I tried with a GAS user and the plugin give me the discount
Why?


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #104965

Hi,

GAS is under Registered. So I do not see any dysfunction.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #104975

Excuse me, i'm sorry
But I can not understand haw does it work.
Yes Gas is under registered but i did'nt select the GAS. So, if i'll select registered it is like if i select all the user under registered without choice. Isn't it?

And also i tried with this:


Public
- - Manager
- - - - Administrator
- - - - GAS
X- - Registered
- - - - Author
- - - - - - Editor
- - - - - - - - Publisher
- - - - Rivenditori
- - Super Users

where GAS is under administrator and i selected only registered
The system give discount also to GAS. Is it ok for you?
If yes ...
How can i do to have a level forbidden to the discount?


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #105010

Hi,

Please edit again the payment plugin and add the indicated code:

	function onAfterCartProductsLoad(&$cart) {
		$method = $this->getMethod();
		if(@$method->payment_params->virtual_coupon) {
// Begin: code to add
			if(hikashop_level(2) && !hikashop_isAllowed($method->payment_access))
				return;
// End: code to add
			if(isset($cart->additional['aup']))
				return;
It will test the user access even if the payment plugin is only called by triggers (and not filtered in the payment listing).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #105071

I'm not very good to php program.
So, could you explain better how i have to add the code, please?
I tried just with a copy and paste at the end of the plugin code but the system goes block/error.


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #105098

Hi,

It is the same thing are before when I gave you some code. Instead of, there is no replacement but insertion.
But finally, it is same process.

Replace

	function onAfterCartProductsLoad(&$cart) {
		$method = $this->getMethod();
		if(@$method->payment_params->virtual_coupon) {
			if(isset($cart->additional['aup']))
				return;
By:
	function onAfterCartProductsLoad(&$cart) {
		$method = $this->getMethod();
		if(@$method->payment_params->virtual_coupon) {
			if(hikashop_level(2) && !hikashop_isAllowed($method->payment_access))
				return;
			if(isset($cart->additional['aup']))
				return;
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #105120

Yes,
now i understand and it works. ;)
Thanks a lot, Jerome!


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
11 years 6 months ago #105123

Please, Just to understand the entire plugin could you explain me what is the use of:

Images
Price € EUR
Percentage %

I've looked for on the help instruction but there is any instruction.


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 6 months ago #105130

Hi,

It is generic options of payment plugins when the plugin is used as a payment method (display as a payment method in the checkout).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: lacasetta

Please Log in or Create an account to join the conversation.

Time to create page: 0.126 seconds
Powered by Kunena Forum