[Skip to main content](#vessel-content)

#   Cart page : add donation line

##

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 11 months ago -  10 years 11 months ago [\#220720](#220720) by [newt](/forum/user/39210-newt "View newt's Profile")  *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#220720 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")* was created by *[newt](/forum/user/39210-newt "View newt's Profile")*

-- url of the page with the problem -- : solishop.fr
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5

Hello,

I add a line just above the total line on the cart page.
I already add the html part :

> &lt;td id="hikashop\_checkout\_donation\_title" class="hikashop\_checkout\_donation\_title"&gt;
> &lt;?php echo JText::\_('HIKASHOP\_DONATION'); ?&gt;
> &lt;/td&gt;
> &lt;td&gt;
> &lt;form method="post"&gt;
> &lt;input type="number" name="donation" style="width:30%" value="0" min="0"&gt;
> &lt;input type="submit" value="Ok"&gt;
> &lt;/form&gt;
> &lt;/td&gt;

Then I recover the value here :

> &lt;td class="hikashop\_cart\_total\_value" data-title="&lt;?php echo Jtext::\_('HIKASHOP\_TOTAL'); ?&gt;"&gt;
> &lt;span class="hikashop\_checkout\_cart\_final\_total"&gt;
> &lt;?php
> $total = $this-&gt;currencyHelper-&gt;format($this-&gt;full\_total-&gt;prices\[0\]-&gt;price\_value\_with\_tax,$this-&gt;full\_total-&gt;prices\[0\]-&gt;price\_currency\_id);
> if (isset($\_POST\["donation"\]))
> $total += $\_POST\["donation"\];
> echo $total;
> ?&gt;
> &lt;/span&gt;
> &lt;/td&gt;

So the client enter the price and press enter or click on the button "Ok".
The page refresh and print the new price, but instead of print the price for example : 32,42 €
It print only : 32

And I don't know how to correct this...

And for the mail sent to the client and vendor I want to also put the donation line to inform them.
But how can I send and retrieve the value to the file where I custom the mail sent ?

Thank you,

Last edit: 10 years 11 months ago by [newt](/forum/user/39210-newt "View newt's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 11 months ago [\#220737](#220737) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#220737 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Hi,

You should add the donation before the call to the format function. For example: Code:

$total = $this-&gt;currencyHelper-&gt;format($this-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax+(float)@$_POST["donation"],$this-&gt;full_total-&gt;prices[0]-&gt;price_currency_id); echo $total;

Also, I would recommend to store your donation in $_SESSION so that you can then use it in the emails and also use it in your checkout, when the value is not sent by the input.

The emails can be edited via the menu System&gt;Emails with the Business edition.
Otherwise, you have to directly edit the files in the folder media/com_hikashop/mail/

The following user(s) said Thank You: [newt](/forum/user/39210-newt "View newt's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 11 months ago [\#220793](#220793) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#220793 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Thank you !

How can I use $_SESSION to store the donation value ?

Yes I know where to edit this ![:)](/media/kunena/emoticons/8.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

10 years 11 months ago [\#220795](#220795) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#220795 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Hi,

[ docs.joomla.org/How\_to\_access\_session\_va...y\_an\_external\_script](https://docs.joomla.org/How_to_access_session_variables_set_by_an_external_script)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 11 months ago -  10 years 11 months ago [\#221009](#221009) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221009 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Thanks for the link but I don't understand all...

The file I edit is cart.php from the views hikashop/checkout/joomspirit_76.
It says to replace session_start() with the code but I don't find session_start().
Should I place it below the line at the beginning of the file ?

> defined('\_JEXEC') or die('Restricted access');

Which path should I add to this line ? :

> define( 'JPATH\_BASE', realpath(dirname(\_\_FILE\_\_).'/../..' ));

The path to the cart.php file ?

I tried

> ./components/com\_hikashop/views/checkout/tmpl

but it doesn't work..

Regards,

Last edit: 10 years 11 months ago by [newt](/forum/user/39210-newt "View newt's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 11 months ago [\#221034](#221034) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221034 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

$_SESSION is like $_POST.
So you can set it like that: Code:

if(!empty($_POST["donation"])) $_SESSION["donation"] = $_POST["donation"];

and then use it like you would use $_POST. The great thing is that once you set it, you can use it anywhere, even on other pages after that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 11 months ago [\#221195](#221195) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221195 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Thank you

But when I go the the file where I can edit the mails sent to the client ? I can't display the value of $_SESSION;
How can the program know for which command is the donation ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 11 months ago [\#221210](#221210) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221210 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Hi,

You can edit the emails via the menu System&gt;Emails.
There, in the "HTML version" area, you can use such code: Code:

&lt;?php echo $_SESSION["donation"]; ?&gt;

and it should work.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 11 months ago [\#221297](#221297) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221297 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

I tried this but it display nothing..
Even the total is wrong it doesn't add the donation value.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 11 months ago [\#221354](#221354) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221354 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Hi,

That's normal that the total doesn't change. With the code you did before, you simply change the total displayed on the checkout, but not the total in the database.

What you need to do is a small HikaShop plugin implement the onAfterCartProductsLoad(&amp;$cart) trigger of HikaShop in order to set the donation value as an additional in the $cart-&gt;additional array.
The system will then add it to the display automatically everywhere.
An example of implementation of that can be found here:
[ www.hikashop.com/forum/taxes/873285-fix-tax-import.html#190511](http://www.hikashop.com/forum/taxes/873285-fix-tax-import.html#190511)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 10 months ago [\#221661](#221661) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221661 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Thank you for the plugin.

I installed it but don't know how to use it ?
I actived it and went in Hikashop's Option.
I clicked on the new button but I can only fill a name and some others but there isn't mention of any price or something ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 10 months ago [\#221826](#221826) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221826 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Hi,

You can't just use it for what you want to do. You need to modify its code.
When you configure it via the new button of the System&gt;Plugins menu, you'll get a screen with the options of the plugin and you'll be able to set the price that you want to be displayed on the cart in the checkout.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 10 months ago [\#221898](#221898) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221898 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

I understand but the I didn't manage to keep the value donation.
I saved it in $_SESSION and you said I could recover it everywhere but when I want to display it it doesn't work.

The plugin you gave me allow me to add the donation value to the total right ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 10 months ago [\#221915](#221915) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#221915 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Hi,

I didn't say that you could get the value from anywhere if you put it in the SESSION. I only said that you would be able to get it in the order creation email by doing that.

And no, the plugin global cart fee doesn't allow you to add the donation value to the total. What it does is it allows you to add a fixed value to the total of the cart. As I said, in order for it to do what you want, you'll have to modify its code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 10 months ago [\#222914](#222914) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#222914 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Ok ![:)](/media/kunena/emoticons/8.png ":)")
I got it for the value. I used it but how can I display it too in the other mail ? I have to recover it in the notification of the command status how can I do it ?

I can't just put it in the database where is the final total ?

Ok i'll try to understand it and modify

Thank you !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 10 months ago [\#222989](#222989) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#222989 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

You'll have to store it in the hikashop_order table together with the rest of the order data and then you'll be able to access it in the order status notification email.
For example if you add your data in a new column of that table that you call "my_data", you can use the tag below in the HTML version of the email and it will display your data in the email:
{VAR:order.my_data}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 10 months ago [\#223106](#223106) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#223106 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Te hikashop_order table is $data ?
Can I do $data-&gt;order-&gt;my_data = 'my donation value'; ??

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 10 months ago [\#223109](#223109) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#223109 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

I don't know. Where are you trying to do that ?
In which function of which file ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[newt](/forum/user/39210-newt "View newt's Profile")**
- [![newt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39210-newt "View newt's Profile") Topic Author
- [ Offline](/forum/user/39210-newt)

Less More

- Posts: 36
- Thank you received: 0
-
-

10 years 10 months ago [\#223251](#223251) by [newt](/forum/user/39210-newt "View newt's Profile")  Replied by *[newt](/forum/user/39210-newt "View newt's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#223251 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

It is in the order creation email file.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86284
- Thank you received: 14263
-
-

10 years 10 months ago [\#223259](#223259) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cart page : add donation line](/forum/27-checkout/880481-cart-page-add-donation-line#223259 "-- url of the page with the problem -- : solishop.fr -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  Hello,  I add a line just above the total line on the cart page. I already add the html part :  Then I recover the value here :  So the client enter the price and press enter or click on the button &quot;Ok&quot;. The page refresh and print the new price, but instead of print the price for example : 32,42 € It print only : 32  And I don't know how to correct this...  And for the mail sent to the client and vendor I want to also put the donation line to inform them. But how can I send and retrieve the value to the file where I custom the mail sent ?  Thank you,")*

Well, that won't do anything. There is no save done on $data-&gt;order after that code.
So you need to do the save yourself: Code:

$orderClass=hikashop_get('class.order'); $order = new stdClass(); $order-&gt;order_id = $data-&gt;order_id; $order-&gt;my_data = 'my donation value'; $orderClass-&gt;save($order);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg4MDQ4MS1jYXJ0LXBhZ2UtYWRkLWRvbmF0aW9uLWxpbmU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.417 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
