Paypal Payment Plugin & Userpoints Compatibility

  • Posts: 265
  • Thank you received: 1
9 years 4 months ago #206828

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1

Hello,

Within the specific configuration of the 'Paypal Payment Plugin', If I set 'Send order details' to 'Yes'. It sends the full price to Paypal, rather than a discount price achieved with loyalty points.

For example, I have 50 points worth £5, the product is valued at £25. At the front-end of the website hikashop recognises the discount available and takes off the £5 to give a sub-total of £20. Then continue to Paypal and it's back to £25.

If I set 'Send order details' to no then it works and gives the appropriate discount, but then I have no order details at Paypal.

It's important for me to be able to push these details to Paypal as I know that it has recently caused a bit of confusion for my customers. Could you please help?

Many thanks,
Hal

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 4 months ago #206847

Hi,

The points system uses the "additional data" system of HikaShop which allows a plugin to insert extra lines to the cart/order between the subtotal and the total.
PayPal doesn't offer the possibility to add such extra lines.

What we can try is to add them as item rows.
Try to add the code:

foreach($order->cart->additional as $product) {
				if(empty($product->price_value)) continue;
				$vars['item_name_' . $i] = substr(strip_tags($product->name), 0, 127);
				$vars['item_number_' . $i] = 'order additional';
				$vars['amount_'.$i] = round($product->price_value, (int)$this->currency->currency_locale['int_frac_digits']);
				$vars['quantity_' . $i] = 1;
				$i++;
			}
before the line:
if(!empty($order->order_shipping_price) && bccomp($order->order_shipping_price, 0, 5)) {
in the file plugins/hikashoppayment/paypal/paypal.php and test it.
Let us know how it goes. If it works, we could include that by default in HikaShop.

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

  • Posts: 265
  • Thank you received: 1
9 years 4 months ago #206918

Hello,

I tried, but unfortunately I didn't have any success.

However, I notice that when I use a coupon that the discount is applied no problem. Is there any way to include it on this line? I have attached a screenshot.

Many thanks,
Hal

Attachments:

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 4 months ago #206984

Hi,

Please provide a FTP access to the website, a user account with points, the procedure to reproduce the issue and a link to this thread via our contact form so that we can debug the issue.
www.hikashop.com/support/contact-us.html

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

  • Posts: 265
  • Thank you received: 1
9 years 4 months ago #207071

Thanks for your help.

I've set that all up, I used the subject box for a link to this thread.

Thanks again,
Hal

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 4 months ago #207350

Hi,

As I had expected that code cannot work as you can't give to paypal products with negative prices.
I've made an additional patch to pass the point discount as a normal coupon to PayPal.
It seems to work fine now.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum