Donation Plugin

  • Posts: 256
  • Thank you received: 21
11 years 4 months ago #109804

I'm really struggling to get my head around how the custom proice plugin works. I have a Fabrik form that generates a product price that is represented by $this->data

How do I pass this figure into the custom price field that I have linked to a product?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #109822

Hi,

Here is the custom price plugin, if you want to use is you'll have to :
- create a category named donation
- 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 texte
- set the "default value" to 0
- add the donation category

- add the custom price plugin and enable it.

Hope this will help you a little .

Attachments:
Last edit: 11 years 4 months ago by Mohamed Thelji.

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

  • Posts: 256
  • Thank you received: 21
11 years 4 months ago #109961

Sorry, I don't understand how that gets the data from the Fabrik form? I've done all of the above but what changes in the code need to be made for the field value in Fabrik to be passed to the amount field in the product?

Last edit: 11 years 4 months ago by rodfarrell.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #110008

Ok, Can you show me where your "Fabrik form" is ?

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

  • Posts: 256
  • Thank you received: 21
11 years 4 months ago #110489

Sorry for the delay. I've been moving the site to a live server for you to see. www.trueerp.co.uk/licenses/

The "Addjusted Price with Training" is the amount to be passed into the shopping Cart

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #110498

Ok, the problem is coming from the fact that you'll have to do it through a product page which is in the "donation" category.

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

  • Posts: 256
  • Thank you received: 21
11 years 4 months ago #110637

Sorry Mohamed but I'm at a loss as to what you are trying to say. I've changed the name of both the product and category to Donation but I can't see how that helps get the amount from the form variable into the amount field in the donation product.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #110707

Hi,

As Mohamed said, I think that you have to move your Fabrik form that generates a product price in a product page (the Donation product page) by editing the view "product / show_default".
If it's a module, just add it with a loadmodule (joomla function) and then when the price is updated in your Fabrik form, update the value of the custom field in the product page.

Make this field not editable by the user, by this way when the Fabrik form price change, you change the value of the custom field.

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

  • Posts: 256
  • Thank you received: 21
11 years 4 months ago #110828

"when the price is updated in your Fabrik form, update the value of the custom field in the product page"

That's the bit I am asking about. How do I do that?

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

  • Posts: 82758
  • Thank you received: 13346
  • MODERATOR
11 years 4 months ago #110888

When the user click on the "purchase now" button of your fabrik form, you need to redirect the user to the add to cart HTML link of your product like that:
www.trueerp.co.uk/index.php?option=com_h...=1&product_id=2&data [item][amount]={amount}

and replace {amount} by the amount that fabrik gives you.

That will automatically add the product to the cart with the amount that fabrik calculated and display the checkout to the user.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum