customized articles at order entry

  • Posts: 27
  • Thank you received: 0
8 years 11 months ago #222491

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5

Dear,

Il would like to manage articles that can be customized by the client.
When the client add the article to the cart, he should be able to enter personnalized text (like nickname).
This text should be recorded, and appears in the confirmation order mail and in the order management process, so that our team can use it to prepare and send the order.

I have the business and multi vendor version of Hikashop.
Is there any plugin to do that?
If I have to write it, what could be the good design of this extension?
Especially, in which table should be recorder the personnlized text?

Regards,

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 11 months ago #222506

Hi

You can create a custom field of the table "item" and of the type "text" via the menu Display>Custom fields and that will do that automatically.

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

  • Posts: 27
  • Thank you received: 0
8 years 11 months ago #223000

Thank you.
It works fine.
But now, in the product list, we have a button "choose option" which let us enter the text.
Is it possible to change the text of the button "Choose option" to put something like "Enter nickame"?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 11 months ago #223064

Sure. You can change any text in HikaShop with a translation override:
hikashop.com/download/languages.html#modify

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

  • Posts: 27
  • Thank you received: 0
8 years 9 months ago #230721

How could I force the client to fill the custom field?

In the configuration of the custom field, I put it as required, I did not put any default value.
Despite this configuration, the client can make an order without fiiling the fied.

You can find enclosed the field configuration page

Attachments:

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #230728

Hi,

That should work like that.
If you try with the default template of Joomla, does it work ?
Can you provide a link to the product page with the custom field so that we can see that ?

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

  • Posts: 27
  • Thank you received: 0
8 years 9 months ago #230782

I've just put it on a public web server.
You can join it at test.debienne.fr
I create a login for you:
- login: hikashop
- pwd: hikashop

If you access to the product details, you can fill the field "Nom Enfant". It has been marked with "*" to show that this field is mandatory.
You are forced to enter something.

BUT, if you click, from the list of products, on the button "Ajouter au panier", the product is added to the basket, and you are not asked to fill the personnalized field.
And unfortunately, you can valid the order without filling the field.

Regards,

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #230839

Hi,

I actually don't see that field at all on the products listing:
take.ms/bXVrL
It should actually not be possible to see the add to cart button on the listing with a custom item field added to the product if you don't display the custom fields on the listing. So I think it comes from a modification of the view files.

So let me ask again:
If you try with the default template of Joomla, does it work ?
If it does, it would confirm my theory and renaming the folder templates/YOUR_TEMPLATE/html/com_hikashop/product would probably solve the problem.

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

  • Posts: 27
  • Thank you received: 0
8 years 9 months ago #230863

Effectively, from the product list, you don't see the field.
You see the field from the product detail ( test.debienne.fr/index.php/hikashop-menu...ng/product/7-liste-1 )

I use the protostar template.
In my understanding, it is the default template.
I've the feeling that it work differently a month ago, and I've updated hikashop to version 2.6.1

regards

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #230873

Hi,

Can you edit the menu item of that listing page via the Joomla menu manager and check that the "custom item fields" setting there is activated ?

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

  • Posts: 27
  • Thank you received: 0
8 years 9 months ago #231051

here is the screenshot of the product listing menu item:




If you prefer, to help diagnostic, I can give you admin login in a private message.

Attachments:

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #231054

Hi,

Yes, please provide a backend access via our contact form with a link to this thread:
www.hikashop.com/support/contact-us.html

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #231240

Hi,

Thank you for the access. I think I understand the issue.
Please change the code:

foreach($rows as &$row) {
							if(!isset($row->itemFields))
								$row->itemFields = array();

							if(!empty($itemField->field_products) && in_array((int)$row->product_id, $itemField->field_products)) {
								$row->itemFields[$itemField->field_namekey] =& $itemField;
								continue;
							}

							if(!empty($itemField->field_categories)) {
								$prod_cats = array_keys($row->categories);

								if(empty($item_cats)) {

									$tmp = array_intersect($itemField->field_categories, $prod_cats);
								} else {

									$tmp = array_intersect($item_cats, $prod_cats);
								}

								if(!empty($tmp))
									$row->itemFields[$itemField->field_namekey] =& $itemField;
							}
						}
to:
foreach($rows as &$row) {
							if(!isset($row->itemFields))
								$row->itemFields = array();

							if(!empty($itemField->field_products)) {
								if(in_array((int)$row->product_id, $itemField->field_products))
									$row->itemFields[$itemField->field_namekey] =& $itemField;
								continue;
							}

							if(!empty($itemField->field_categories)) {
								$prod_cats = array_keys($row->categories);

								if(empty($item_cats)) {
									// First test for the direct categories
									$tmp = array_intersect($itemField->field_categories, $prod_cats);
								} else {
									// Second test for the sub categories
									$tmp = array_intersect($item_cats, $prod_cats);
								}
								
								//no match so don't add the field
								if(empty($tmp))
									continue;
							}
							//no category or product restriction, so add the field
							$row->itemFields[$itemField->field_namekey] =& $itemField;
						}
in the file components/com_hikashop/views/product/view.html.php and that should fix the problem.

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

  • Posts: 27
  • Thank you received: 0
8 years 9 months ago #231310

Thank you for the fix.
But I have the display of "array(0) { } " like you can see in the capture




regards

Attachments:
Last edit: 8 years 9 months ago by Eroc.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #231317

Hi,

I had forgotten a debug test on the view. I've removed it. Sorry for that.

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

  • Posts: 27
  • Thank you received: 0
8 years 9 months ago #231461

Hi,

I'm afraid I'm still able to make an order without filling the field.

Regards

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #231467

Hi,

Also change the code:

foreach($item_keys as $k) {
							if(is_string($itemField->$k) && strpos($itemField->$k, ',') !== false) {
								$itemField->$k = explode(',', trim($itemField->$k, ','));
								JArrayHelper::toInteger($itemField->$k);
							} else if(!is_array($itemField->$k) && !empty($itemField->$k))
								$itemField->$k = array( (int)$itemField->$k );
						}
to:
foreach($item_keys as $k) {							
							if(is_string($itemField->$k) && strpos($itemField->$k, ',') !== false) {
								$itemField->$k = explode(',', trim($itemField->$k, ','));
								JArrayHelper::toInteger($itemField->$k);
							} else if(!is_array($itemField->$k) && !empty($itemField->$k) && is_numeric($itemField->$k))
								$itemField->$k = array( (int)$itemField->$k );
							else
								$itemField->$k = array();
						}
in the same file and that should definitely fix the problem.

The following user(s) said Thank You: Eroc

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

  • Posts: 27
  • Thank you received: 0
8 years 9 months ago #231504

Hi,

it works.

Thanks a lot for your very good support.

regards,

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

Time to create page: 0.100 seconds
Powered by Kunena Forum