User enterable custom product fields.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #17840

Say I have a custom product field called: product_customer_reference

When displaying the product I could not see a way for the customer to enter their own value - it only displays what the shop owner entered when creating the product.

Also would it be possible for a customer to enter their reference, add product to cart, change the reference and add the product to the cart again. It would show as 2 lines in the cart/order - each with a different reference.

The values the customer entered would need to be available in the data structures of the on / after order triggers for passing to the back-end.

Additionally the custom product fields could be added to the order_product table in as well as the product table.
Selectable option? - default as current, option to add field to order_product table.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #17841

This is also related to post 16216

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 5 months ago #17847

I'm not following you. The post you're liking to show the answer to your question from what I understand.
Custom fields of the table "product" are only to display information to the user, not to let him set a value for a product. That can be done with custom fields of the table "item". That enables users to enter a value and then they can add that product to the cart. Then, if they enter another value int he custom item field and add the product again to the cart, the get a second line in their cart for their second value.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #17898

Sorry, I had overlooked the item custom field.
The item custom field will do the job.

See you have recently added a Category custom field - I might also have a use for that shortly.

For the item custom fields in my case I will need to modify the product / order templates to achieve the following:
(a) Hide / show item custom fields for individual products on product pages.
(b) Hide / show item custom fields for individual products on checkout / order listing.
(c) Limit maximum quantity per order to 1 for each item custom field unique value.
Both of these can be controlled by using product custom fields.
Could these features be added to your wishlist for core Hikashop functionality please.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 5 months ago #17919

A quick test and looks like item (c) above is catered for.

Create a product with maximum number in order set to 1.
Create a custom item.
Product can be added to cart more than once PROVIDED THAT each time the product is added the value entered by the customer in the custom item field is unique.

Only one niggle when trying to reuse a custom item value - the pop-up says product successfully added to cart - a bit confusing that, would be nice for message to say something like 'item already in cart'.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 5 months ago #18057

For a and b, it's quite easy to do.
As you say, creating a cusotm field of the product product, then editing the views in order to add a check to display the custom item fields or not based on the custom product field.
you should only have to do that on the product page. In the latest version, custom item fields should not be displayed on the checkout if empty.

For the last problem you raised, that's indeed the case. The system is not yet smart enough for that. We'll have to look at that in the future.

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

  • Posts: 9
  • Thank you received: 0
13 years 5 months ago #18060

Ok i think my question relates to this. I bought the Business Edition, and created two custom Item fields. The two fields are name and email. Every item in the order must have a name and email address. So if they are one the Item page, it works great, but if they are just in the category listing of all the items with the add to cart button, it adds a instance of the product with the custom fields blank even though they are required.

How can I get around this issue. I also have add-to-cats buttons elsewhere in the system where this problem is also occuring. Is there a way to edit a custom field for an item at checkout?


Thanks.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 5 months ago #18065

Custom item fields, options and characteristics can only be displayed on the product page so if you need them, you should deactivate the add to cart buttons on listings as it won't allow the users to enter the custom fields information.

You can always edit the different views of HikaShop via the menu Display->Views and change the code for that to work, that's possible, but that means really heavy modifications.

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

  • Posts: 9
  • Thank you received: 0
13 years 5 months ago #18080

So there is no way to edit the custom fields on the actual checkout page?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 5 months ago #18096

Not unless you change the code of the checkout views to handle it.
On the checkout, you can have custom fields of the table "order", but they are for the whole order.

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

  • Posts: 9
  • Thank you received: 0
13 years 5 months ago #18098

alright I see. Is there any way to default a custom field (text) to say...... the logged-in customers name, instead of just static text? Thanks.

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

  • Posts: 21
  • Thank you received: 0
13 years 5 months ago #18100

Hi,

I got question, it doesn't have to see with the topic in discussion. When I adding a new product in Hikashop I'd like to use different letters form (you know bold, italic, fontsize etc) even put some color in the letters and increase the size, how can I add that function to my hikashop is it possible ? Just like the toolbox that you can see in this form above.

Thanks

Sam

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
13 years 5 months ago #18107

Hi,

Custom fields allows you to create this feature.

In "Display -> custom fields" you can create a new field for "product" (with column name "custom_name" for example)
Select a "text" custom field and set "no" to the Front-end display.

After that, you have to edit the product display view and change code where the product name is displayed via the menu Display->Views.

So, in your new custom field (which is hidden in the front-end) you can set a new name which could contain some HTML code.
You won't have any conflict with the rest of HikaShop system because the name of the product (without formating) will be used.

product/show.php

echo $this->element->product_name;
Becomes:
echo $this->element->custom_name;

After that, in the back-end, you could assign an HTML formatting name to your product. Name which would be used just in the product/show (or in other views if you modify it).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 13 years 5 months ago by nicolas.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 5 months ago #18108

@ethanhunt123 : it can be done by editing the view where the custom field is displayed and adding one or two lines of code. However, that will depend on the table of custom fields you're using. What is the table of your custom field ?

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

  • Posts: 9
  • Thank you received: 0
13 years 5 months ago #18111

The custom field is an Item Custom Field. called alt_member_name . Seeing if the default could be "First Name" "Last Name" of the logged in user

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 5 months ago #18113

There is no first name and last name for users in joomla.
There is a last name and a first name for addresses of users in HikaShop. Is that what you want ?

In that case you need to edit the file show of the view product via the menu Display->Views and add the code below at the beginning of the file, after the first <?php tag :
$addressClass = hikashop::get('class.address');
$addresses = $addressClass->getByUser(hikashop::loadUser());
if($addresses){
$address = reset($addresses);
$this->element->alt_member_name = $address->address_firstname.' '.$address->address_lastname;
}

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

  • Posts: 9
  • Thank you received: 0
13 years 5 months ago #18115

ah, no I have CM installed and using their first name/last name schema, but i think this gives me enough info to do what i need to.

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

  • Posts: 9
  • Thank you received: 0
13 years 5 months ago #18116

basically $this->element->alt_member_name = "whataver"

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 5 months ago #18144

Yes.

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

Time to create page: 0.099 seconds
Powered by Kunena Forum