dynamic options on product

  • Posts: 16
  • Thank you received: 0
12 years 2 weeks ago #73585

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?

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

  • Posts: 12953
  • Thank you received: 1778
12 years 2 weeks ago #73725

Hi,

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.

  • Posts: 16
  • Thank you received: 0
12 years 1 week ago #74514

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

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 week ago #74621

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.

  • Posts: 16
  • Thank you received: 0
12 years 1 week ago #74728

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 ;)

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 5 days ago #75631

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) {
}

The following user(s) said Thank You: mobe84

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

  • Posts: 16
  • Thank you received: 0
12 years 5 days ago #75709

thank you!

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

Time to create page: 0.045 seconds
Powered by Kunena Forum