- Posts: 16
- Thank you received: 0
dynamic options on product
13 years 11 months ago #73585
by mobe84
dynamic options on product was created by mobe84
Hi,
i have a question about product options. I already created some products with options like color or size and saw that the business version of HikaShop enables you to make a custom field where the customer can type in some content.
What i need is an option for the product where the customer can choose (dropdown for example) from dynamic created values like user created joomla articles.
For example: The user owns various articles on our site and for a specific product we want him to choose one of his articles for a product. So we need an option in the product view for selecting his articles.
Is that possible with HikaShop?
i have a question about product options. I already created some products with options like color or size and saw that the business version of HikaShop enables you to make a custom field where the customer can type in some content.
What i need is an option for the product where the customer can choose (dropdown for example) from dynamic created values like user created joomla articles.
For example: The user owns various articles on our site and for a specific product we want him to choose one of his articles for a product. So we need an option in the product view for selecting his articles.
Is that possible with HikaShop?
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
13 years 11 months ago #73725
by Mohamed Thelji
Replied by Mohamed Thelji on topic Re: dynamic options on product
Hi,
I don't think that it's possible with customfield without some developpment
.
I don't think that it's possible with customfield without some developpment
The following user(s) said Thank You: mobe84
Please Log in or Create an account to join the conversation.
13 years 10 months ago #74514
by mobe84
Replied by mobe84 on topic Re: dynamic options on product
We got stuck on the problem with the dynamic options. We dont want to "hack" the hikashop core files and now we got the idea to add the dynamic options within a plugin.
The workflow would be this:
The customer selects the dynamic options from a seperate menu which we integrate in a joomla module.
Then he selects the standart options and puts the product into the cart.
At this point our plugin would have to jump in and add the dynamic options.
Could we try this and does a function for adding options to an ordered product exist?
And if this is possible the way we planned, which trigger function should we use? We thought on the onBeforeProductCreate(&$element,&$do) function.
So we would need to create a function like $element->addCharacteristic($name, $value);
Moritz
The workflow would be this:
The customer selects the dynamic options from a seperate menu which we integrate in a joomla module.
Then he selects the standart options and puts the product into the cart.
At this point our plugin would have to jump in and add the dynamic options.
Could we try this and does a function for adding options to an ordered product exist?
And if this is possible the way we planned, which trigger function should we use? We thought on the onBeforeProductCreate(&$element,&$do) function.
So we would need to create a function like $element->addCharacteristic($name, $value);
Moritz
Please Log in or Create an account to join the conversation.
13 years 10 months ago #74621
by nicolas
Replied by nicolas on topic Re: dynamic options on product
You don't need to hack the hikashop files. You can just edit the file "show_default" via the menu Display->Views and add your code there to display the dropdowns based on the existing ones. The modifications will be created as a view override so no hack of core file here.
The following user(s) said Thank You: mobe84
Please Log in or Create an account to join the conversation.
13 years 10 months ago #74728
by mobe84
Replied by mobe84 on topic Re: dynamic options on product
Does a function/trigger exist, which is called, when a customer puts a product into the cart? We thought that would be the onBeforeCreateProduct() function, but that seems wrong 
We still need a place where we can add additional values from our database to a product and we thougt the best way would be to do that just before putting the product into the cart.
I am sorry if you tried to explain this already
We still need a place where we can add additional values from our database to a product and we thougt the best way would be to do that just before putting the product into the cart.
I am sorry if you tried to explain this already
Please Log in or Create an account to join the conversation.
13 years 10 months ago #75631
by nicolas
Replied by nicolas on topic Re: dynamic options on product
onBeforeCreateProduct is called when a product is created.
If you want a trigger for when products are added tot he cart, it's the triggers onBeforeCartUpdate and onAfterCartUpdate
They are not yet documented.
Here is how you can do:
function onBeforeCartUpdate(&$parent, &$cart, $product_id, $quantity, $add, $type,$resetCartWhenUpdate,$force,&$do) {
}
If you want a trigger for when products are added tot he cart, it's the triggers onBeforeCartUpdate and onAfterCartUpdate
They are not yet documented.
Here is how you can do:
function onBeforeCartUpdate(&$parent, &$cart, $product_id, $quantity, $add, $type,$resetCartWhenUpdate,$force,&$do) {
}
The following user(s) said Thank You: mobe84
Please Log in or Create an account to join the conversation.
13 years 10 months ago #75709
by mobe84
Replied by mobe84 on topic Re: dynamic options on product
thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.257 seconds