Donations

  • Posts: 32
  • Thank you received: 0
10 years 6 months ago #129415

My client just purchased the business version.

How do we go about setting up donations? Where use can enter an amount info a field.

I saw references to a plugin but I do not see it when searching Plugins in the backend.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 6 months ago #129464

Hi,

You'll find more information through this thread :

You'll find it through your plug-in manager with the name "HikaShop Donation plugin".
If you want to configure it you'll just have to :

create a category named "donation" for example
- create a product named "donation" set the price to 0 and the category to "donation"

- go to "Hikashop -> Display -> Custom fields"
- create a new field
- set the "label" field to amount
- set the "table" field to item
- set the "Column name" field to amount
- set the "field type" to text
- set the "default value" to 0
- add the donation category

- enable the "HikaShop Donation plugin".

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

  • Posts: 455
  • Thank you received: 35
3 years 1 month ago #331156

Hi guys, Please:
1 - Are these instructions on Donation setting up still valid / up to date ?
2 - Is the creation of the "Donations" Category mandatory ?
3 - Is there a way to create "Donations Campaigns" ? I'm thinking something like to show the meta goal near the amount (it can be also into the description) and the total amount reached (in % is okay) till that moment (this is really too important)

Last edit: 3 years 1 month ago by joomleb.

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
3 years 1 month ago #331175

Hi,

1. Yes.

2. No, it's not mandatory at all.

3. Well, there is no such mechanism. You could have a custom product field where you would enter the percentage accomplished already and update it manually periodically.

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

  • Posts: 455
  • Thank you received: 35
3 years 1 month ago #331213

Hi Nicolas,
thanks for the quick answer...

3 - A PHP Custom Field could solve this and other needs, no ?!?

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
3 years 4 weeks ago #331218

Hi,

3. Not really. This link is for Joomla custom fields, not HikaShop custom fields. So what this article talks about is not possible here.
However, you can do something quite similar. You could develop a plugin implementing the "fields API" from HikaShop ( www.hikashop.com/support/documentation/6...entation.html#fields ) in order to add your own type of custom fields in HikaShop. And you could have it so that it would calculate the percentage dynamically when displaying it on the product page in the code of the plugin.
So it's similar to what you found but instead of putting the PHP code in the interface of the backend, you need to put it in a plugin.

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

  • Posts: 455
  • Thank you received: 35
3 years 4 weeks ago #331253

Hi Nicolas,
3 - Many Thanks for your suggestion. I meant that an HikaShop PHP Custom Field could be useful in many situations as a "last solution"...

In my specific case, the HikaShop Donation plugin, I think that should be included a "goal field", as I described, by using it... it is really a missing feature...

PS - Wouldn't it be time to switch to / add the default Joomla Custom Fields integration ? (More integration for HikaShop and less work for you)

Last edit: 3 years 4 weeks ago by joomleb.

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
3 years 4 weeks ago #331266

Hi,

Well, I understand what you mean, but from experience, I don't see many uses for that.
Here for example, doing what you want requires at least getting information on the current product, running a MySQL query and some processing on the results of the query to be able to display the percentage. So yo'ure looking at at least a dozen lines of code.
If you know how to do that in Joomla, you likely already know how to put up a Joomla plugin (a xml with 10 lines, and a PHP file with a few lines). So as a developer you should be able to easily put up a plugin together to do that and it wouldn't take you much longer than just writing your PHP code in a PHP custom field.
What's more, usually, when you want to customize custom fields, you want to extend from an existing custom field type. That way, it simplifies the code you need a lot.

Having a "goal" option in the donation plugin is a good idea. I'll note that on our todo list.

Regarding supporting Joomla custom fields, I've looked at it in the past, and it's not practical. HikaShop doesn't use Joomla's model system because it didn't exist when HikaShop was created. Also, the structure of the custom fields in Joomla is quite different from what we have in HikaShop. We would basically have to rewrite a big part of how HikaShop works. And the gain are not that important since most of the things you can do with the Joomla custom field types can also be do with HikaShop's custom field types.

The following user(s) said Thank You: joomleb

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

  • Posts: 455
  • Thank you received: 35
2 years 10 months ago #333569

Hi Nicolas,
HikaShop 4.4.3 is out, I read the changelog, Please:

A - (I'm not a developer, we always have to look for freelancers) - "...We've added a new action "Run PHP code" for mass actions so that you can run custom PHP code using the data from the elements being processed (you can access the data of the elements with tags like {product_id} or {order_id} in your code..." = Is it anything that can help here (instead to develop an entire plugin) ?
If yes, Would be better to " run PHP code " or to " run a SQL query " ?

B - "...Having a "goal" option in the donation plugin..." - Has it been added with this last release, or Is it still in the roadmap ?

Last edit: 2 years 10 months ago by joomleb.

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
2 years 10 months ago #333575

Hi,

A. Both can be useful and can serve different purposes. Running a MySQL query is nice when you only need to update an information in the database and is quite lightweight. PHP code can be used for when you need to run chained MySQL queries, or when you need to do things outside the database, like contacting a web service to update some information, or write a file somewhere, etc.
A PHP action is nice for a PHP developer who doesn't know how to develop Joomla plugins and/or just want to run some of his code without hassle. But as a long term solution I would rather recommend learning how to write Joomla plugins and developping a proper plugin for his code. It's cleaner and it will be better to maintain in the long run.

B. it's still on the roadmap. Please understand that we have a really long todo list and not everything we add to it can be added in the next release. Some things are added years later.

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

  • Posts: 455
  • Thank you received: 35
2 years 10 months ago #333617

Hi Nicolas,

A - Thanks for explanations ! Too useful for me to address me on the right way

B - Sure, I know it. I asked to be sure and be able to stay tuned on it... thanks

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

Time to create page: 0.092 seconds
Powered by Kunena Forum