- Posts: 2
- Thank you received: 0
Calculate price based on size (Square Inches)
- piperpilot
-
Topic Author
- Offline
Less
More
15 years 10 months ago #2617
by piperpilot
Calculate price based on size (Square Inches) was created by piperpilot
Hi,
Is it possible with HikaShop to calculate a price based on an item size? I am building a shop for PCB manufacturing. I have a custom Joomla component that allows someone to upload their design. I run some processing against it and eventually come out with a Square Inches size. I need to be able to pass that size to HikaShop and have the price calculated when it is added to the cart.
Possible?
Thanks,
Curtis
Is it possible with HikaShop to calculate a price based on an item size? I am building a shop for PCB manufacturing. I have a custom Joomla component that allows someone to upload their design. I run some processing against it and eventually come out with a Square Inches size. I need to be able to pass that size to HikaShop and have the price calculated when it is added to the cart.
Possible?
Thanks,
Curtis
Please Log in or Create an account to join the conversation.
15 years 10 months ago #2619
by nicolas
Replied by nicolas on topic Re: Calculate price based on size (Square Inches)
Hi,
What could be possible is to have several products (or one product with several variants) each one with a different price and then based on the size adding one product or the other to the cart.
You can easily add a product to the cart like that:
What could be possible is to have several products (or one product with several variants) each one with a different price and then based on the size adding one product or the other to the cart.
You can easily add a product to the cart like that:
Code:
include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php');
$cart = hikashop::get('class.cart');
$cart->update($product_id,$quantity,0);
Please Log in or Create an account to join the conversation.
- piperpilot
-
Topic Author
- Offline
Less
More
- Posts: 2
- Thank you received: 0
15 years 10 months ago #2623
by piperpilot
Replied by piperpilot on topic Re: Calculate price based on size (Square Inches)
Thank you for the response. This won't work for me because the quantity is actually calculated from a dynamic size. a design might be 1.24 x 3.11 = 3.86 square inches while another might be 1 x 2 = 2 square inches. Those would have different costs associated with them.
Please Log in or Create an account to join the conversation.
15 years 10 months ago #2625
by nicolas
Replied by nicolas on topic Re: Calculate price based on size (Square Inches)
You can always create a new value of the characteristic, then a new variant of the product and then add a price for that variant and add that variant to the cart, all that doing few SQL queries. But you can't just add a price to a product in the cart as the system needs the price to be linked to the product in the database.
Please Log in or Create an account to join the conversation.
Time to create page: 0.157 seconds