discount also influences the delivery value?

  • Posts: 9
  • Thank you received: 0
9 years 2 months ago #214981

-- HikaShop version -- : 2.5.0

Hi,

First I loved this exelente tool that you guys have provided .

One of the payment methods (Bank transfer) in my website has a discount of 10 % on the value of the product ,
the problem is that it also calculates the discount upon the delivery value , how can I solve this problem ?

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

  • Posts: 12953
  • Thank you received: 1778
9 years 2 months ago #214988

Hello,

One of the payment methods (Bank transfer) in my website has a discount of 10 % on the value of the product ,

Can you give us more information on the way you are applying your discount ?
Thank you.

The following user(s) said Thank You: adriel350

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

  • Posts: 9
  • Thank you received: 0
9 years 2 months ago #215132

Yes , I am sending attached a screenshot.
Use the percentage option to apply the discount should apply to all products from the site , if the customer choose this method of payment.

Attachments:

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 2 months ago #215167

Hi,

Well, using the payment fee as a discount is already border line, so there is no mechanism to have it apply to only the products and not the shipping fee.
The only solution would be to customize the code:

$methods[$k]->payment_price = $currencyClass->round(($price_all * (float)@$method->payment_params->payment_percentage / 100) + @$method->payment_price,$currencyClass->getRounding($currency,true));
in the file administrator/components/com_hikashop/classes/payment.php in order to calculate differently the payment fee. But you'll need the help of a developer in order to do that.

The following user(s) said Thank You: adriel350

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

  • Posts: 9
  • Thank you received: 0
9 years 2 months ago #215242

hi , thanks for the reply , I found that the line of code which you reported:

$methods[$k]->payment_price = ($price_all* (float)@$method->payment_params->payment_percentage / 100) + @$method->payment_price ;

What I'm trying to do only need recall the value of sending and add it on that account , but unfortunately I can not find it , if that's possible someone could send me ?

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 2 months ago #215268

Hi,

Do a var_dump() of the variable $order. One of the sub attributes of that object should contain the value you're looking for. If you're a developer, it shouldn't be a problem.

The following user(s) said Thank You: adriel350

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

  • Posts: 9
  • Thank you received: 0
9 years 2 months ago #215361

hi ,
Unfortunately I am not a developer , I have some knowledge of PHP, but i could do with it was correctly calculated the discount amount , modified the line as follows :

$methods[$k]->payment_price = (@$order->full_total->prices[0]->price_value_without_shipping_with_tax* (float)@$method->payment_params->payment_percentage / 100) + @$method->payment_price

But what to modify the value that will appear in the email and at the end of the purchase, because in these places still show the wrong value , which I file to modify to achieve the desired result in these steps?

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 1 month ago #215374

Hi,

You'll find a similar line to calculate the percentage fee in the same file.
Make sure that you change them all and that should help.
You can search for "payment_params->payment_percentage" in that file in order to find them.

The following user(s) said Thank You: adriel350

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

  • Posts: 9
  • Thank you received: 0
9 years 1 month ago #215568

HI , apparently my version of hikashop was outdated , with the latest(2.6.0) got the desired result , thank Nicolas for the explanation , the file will be attached next to this post if someone wanted.

It would be interesting to have this option without being necessary to modify the source code , perhaps in the future.

Thanks again .

Attachments:

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

Time to create page: 0.085 seconds
Powered by Kunena Forum