- Posts: 171
- Thank you received: 9
Exclude discounted products paying with userpoints
- pepecortez
-
Topic Author
- Offline
Less
More
10 years 3 months ago #243500
by pepecortez
Exclude discounted products paying with userpoints was created by pepecortez
-- HikaShop version -- : 2.6.3
Hi!
As I see now there's no option to set to let the user to pay partially with points for just those products which are not discounted. Could anyone give me some code tricks to solve that?
Or at least to take this to the nearly upcoming "To-Do-List"?
Thanks in advance,
Hi!
As I see now there's no option to set to let the user to pay partially with points for just those products which are not discounted. Could anyone give me some code tricks to solve that?
Or at least to take this to the nearly upcoming "To-Do-List"?
Thanks in advance,
Please Log in or Create an account to join the conversation.
10 years 3 months ago #243522
by nicolas
Replied by nicolas on topic Exclude discounted products paying with userpoints
Hi,
Code tricks ? Well, it would require to remove the code:
in the file plugins/hikashoppayment/userpoints/userpoints.php and add instead a loop on the products array (in $order->products or $order->cart->products) to see in each product if there is a discount attribute or not and then sum the product price if there is no discount attached to the product.
If you're a developer, it's easy to change.
Code tricks ? Well, it would require to remove the code:
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;
}else{
$final_price = @$order->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 {
if($this->plugin_params->allowshipping == 1) {
$final_price = @$order->cart->full_total->prices[0]->price_value_with_tax;
} else {
$final_price = @$order->cart->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;
}
}
If you're a developer, it's easy to change.
The following user(s) said Thank You: pepecortez
Please Log in or Create an account to join the conversation.
Time to create page: 0.144 seconds