Price based on value of custom field

  • Posts: 7
  • Thank you received: 1
9 years 7 months ago #215519

-- Joomla version -- : 3.4.3

Hi,
I have created an Item custom field. (Was not sure if it had to be a product or item custom field)
I need a custom field for width of a product. So the user enters a value between 300 and 600 for the desired width.
Now based on the value entered I need to apply a different price. I have ranges for width for example 300-350 price=A, 351-400 price =B etc.
How can we manage to do this? So if I wanted the customer to enter a desired width, and the system to get the price and weight based on the width entered in that custom field?

I will need detailed explanation as I'm new to this.

thanks

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

  • Posts: 13201
  • Thank you received: 2322
9 years 7 months ago #215532

Hi,

This will require the creation of a plugin, a plugin based on the function "hikashop_product_price_for_quantity_in_cart".
Then in this plugin, get the value of the desired custom field and edit the price based on that value.

You can take as example the plugin "system / custom_price" which already allow to edit the price.
So you just have to add your code to apply your rules.

Here is the developer documentation:
www.hikashop.com/support/support/documen...r-documentation.html

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

  • Posts: 7
  • Thank you received: 1
9 years 7 months ago #215586

Hi,
I've never done this before. The example you mentioned "system / custom_price", where do I find it?
I've never done this before and I'm new to this. I could pay someone to do it for me if I could in order to save time.

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

  • Posts: 83858
  • Thank you received: 13574
  • MODERATOR
9 years 7 months ago #215629

Hi,

If you're a developer, you can take example on our donation plugin in order to implement your custom price calculation plugin:
demo.hikashop.com/index.php/en/hikashop/...t-page/donation-page

If you need someone to do it for you, I invite you to contact our partners and request a quote:
www.hikashop.com/home/our-partners.html
and/or post on our "commercial jobs" forum.

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

  • Posts: 7
  • Thank you received: 1
9 years 7 months ago #215750

After doing some reading and thinking,
when I create my plugin I need and xml file aswell right?

Now if I create the following custom fields for every product in a particular category:
Range1,Range2,Range3
Price1,Price2,Price3
Height1, Height2,Height3

which I will load information in these fields when entering a product.

Then, during the product view, the custom field for width that the user enters, needs to be checked against Range1, Range2, Range3 values (these range values need to be in the form of 300-400, or should I create Range1min Range1max?)
and
case1:
display and load Price1 and height1 to cart
case2:
display and load Price2 and height2 to cart
etc...

this should be easy enough right?
I'm still trying to understand the code in custom_price.php of the plugin you told me to look at.

Any feedback would be appreciated.
thanks

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

  • Posts: 12953
  • Thank you received: 1778
9 years 7 months ago #215760

Hello,

this should be easy enough right?
I'm still trying to understand the code in custom_price.php of the plugin you told me to look at.

Yes you'll be able to do it by creating a plugin based on the Hikashop custom price / HikaShopCustom Quantity Weight plugins but remember that some development skills will be required.

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

Time to create page: 0.177 seconds
Powered by Kunena Forum