User points and currency changer

  • Posts: 38
  • Thank you received: 2
  • Hikamarket Multivendor Hikashop Business
5 years 9 months ago #303865

-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.2
-- PHP version -- : 7.1.26
-- Browser(s) name and version -- : Chrome

Hi There!

We have user points plugin and 3 different currency activated (EUR, RON, HUF)

After first purchase user gets his points. That's work correctly. But for the next purchase: when user want to use points but total amount is less then the user points all the points gets used. How to configure properly?

And a second question: user points are calculating from gross. Is there a way to calculate from net? So there's no 0 total amount bill.

Thanks in advance

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 9 months ago #303885

Hi,

1. Could you provide a screenshot of the settings of the user points plugin and the user points payment plugin in the menus System>Plugins and System>Payment methods ?
Could you also provide precise instructions to reproduce the problem on your website (with a test user account) ?

2. There is no option to do that. You would have to modify the code:

if(isset($order->order_subtotal) && isset($order->order_shipping_price)) {
			if($this->plugin_params->allowshipping == 1) {
				$final_price = @$order->order_subtotal + $order->order_shipping_price;
			} else {
				$final_price = @$order->order_subtotal;
			}
		} else if(empty($order->cart->full_total->prices[0]->price_value_with_tax)) {
			if($this->plugin_params->allowshipping == 1) {
				$final_price = @$order->full_total->prices[0]->price_value_with_tax;
				if(!empty($order->additional['userpoints']->price_value_with_tax)){
					$final_price -= $order->additional['userpoints']->price_value_with_tax;
				}
			}else{
				$final_price = @$order->total->prices[0]->price_value_with_tax;
			}
		} else {
			if($this->plugin_params->allowshipping == 1) {
				$final_price = @$order->cart->full_total->prices[0]->price_value_with_tax;
				if(!empty($order->cart->additional['userpoints']->price_value_with_tax)){
					$final_price -= $order->cart->additional['userpoints']->price_value_with_tax;
				}
			} else {
				$final_price = @$order->cart->total->prices[0]->price_value_with_tax;
			}
		}
in the file plugins/hikashoppayment/userpoints/userpoints.php in order to use the price_value instead of price_value_with_tax.
Note that in doing so, you'll loose the change after each update and thus you would have to reapply the change... unless you make a copy of the plugin but it's not that easy as it's linked to the other user points plugin in plugins/hikashop/userpoints/userpoints.php and making a copy of plugins require coding skills.
So if you're not a developer it's best to have a developer work on that for you.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum