Filtering custom fields on orderpage

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #66169

I would like to have some custom fields to show up on the orderpage if a special product is in the cart.

The fields are set to show up for only one user group.

The reason for this is that the fields are required if this product is in the cart, if the cart doesn't have this product the fields are not needed.

Alternatively the fields could be set to "not Required" but that will eventually lead to people don't fill them in when needed and confusing for others.

Thanks

Jan

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #66340

Hi Jan,

Isn't it easiest to add this field in the product page ?

Another way could be to display the cart & the fields in the same checkout step, send the products name with a setVar, and edit the view "checkout / custom_fields" and add a check:
If the product with the product name ... is in the cart, display the custom field. (get the product name with a getString)

Not sure that this will work.

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #66343

Hi,

The product page isn't an option, the info should go along with the order, if the product is ordered.

But I can try the approach you suggest, I might need some assistance along the way :unsure:


Thanks


Jan

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 month ago #66420

I would also recommend to create a custom field of the table "item" for that.
The info WILL go along with the order when the product is ordered. That's the goal of the custom fields of the table "item".

There is no assistance needed normally. It's all automatic. The info is added to the invoices, the orders, the emails, etc.

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #66426

Ok, if the fields are set to mandatory, will that prevent the customer to order the item unless the fields are entered?

Jan

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #66465

Thanks, I got it working now.

Since it is only one product that needs this I moved in to its own category as a subcategory. Then I assigned the custom fields to that category.

It will however need some CSS tweaking to get it look right but that shouldn't be any problem.


You guys Rock B) B)


Jan

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #69858

Have to bring back this topic to life...

Now when most of the payment stuff works I have started to test other things and this topic works but the info from the field doesn't end up on the order page in back end.

Field settings is to be Required, Show on Front end, Show on Back End Form and Published.

The info is shown in the cart, but not in the backend.

ANy clues?


Jan

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 month ago #70030

That sounds like the column in the table order was not created and thus when the order is created the information of the field is not saved.

You should turn on the debug mode of the joomla config and it will display an error when the order is created if it comes from that.

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #70065

Hi Nicolas,

I found this in the debug database listing,

INSERT IGNORE INTO j1f5a_hikashop_order_product (order_id,product_id,order_product_quantity,order_product_name,order_product_code,order_product_price,order_product_tax,order_product_options,order_product_option_parent_id,order_product_tax_info,order_product_wishlist_id,puppy_born_date_item,puppy_delivery_date_item,puppy_mother_ittem)
  VALUES (800,520,2,'Breeder Adult Lamm','011920','343.20000','85.8','',594,'a:1:{i:0;O:8:\"stdClass\":12:{s:11:\"taxation_id\";s:1:\"1\";s:12:\"zone_namekey\";s:18:\"country_Sweden_203\";s:16:\"category_namekey\";s:12:\"VM_TAX_3_203\";s:11:\"tax_namekey\";s:4:\"Moms\";s:18:\"taxation_published\";s:1:\"1\";s:13:\"taxation_type\";s:0:\"\";s:15:\"taxation_access\";s:3:\"all\";s:19:\"taxation_cumulative\";N;s:9:\"tax_vm_id\";s:1:\"3\";s:8:\"tax_rate\";s:7:\"0.25000\";s:9:\"zone_type\";s:7:\"country\";s:10:\"tax_amount\";d:85.7999999999999971578290569595992565155029296875;}}',0,'','',''),(800,1247,1,'Valppaket','023020','','0','',595,'',0,'2012-10-02','2012-11-22','Carola')

The last four fields are in the table _hikashop_order_product and the values are entered in the table.


The customfields were made for the table "item"

The values are following through the order, in the cart, in the emails to the store owner and customer. But it doesn't end up in the order view in the back end.

I have another custom field that follows the order ( in table order) that is shown in the order view in the back end.


Jan

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 month ago #70152

Hi,

Maybe you had edited the file "form" of the view "order" before updating ?
Because it's working fine on our end. The custom item fields are displayed by that code there:

<p class="hikashop_order_product_custom_item_fields"><?php
								if(hikashop_level(2) && !empty($this->fields['item'])){
									foreach($this->fields['item'] as $field){
										$namekey = $field->field_namekey;
										if(empty($product->$namekey)){
											continue;
										}
										echo '<p class="hikashop_order_item_'.$namekey.'">'.$this->fieldsClass->getFieldName($field).': '.$this->fieldsClass->show($field,$product->$namekey).'</p>';
									}
								}?></p>

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #70165

No I haven't edited that file.

Exactly the same code is in my file.

I deleted all the fields, checked in the DB_tables that they were gone. Recreated them again but same result.

I am looking at the right place when I am expecting them to show up in the order view in the Additional Information pane, right?

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #70181

I tried a clean installation of Joomla and Hikashop and I get the same there. Custom Field "item" don't show up on order view.

Is this a bug??

Jan

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 month ago #70256

No, the item fields values will be displayed in the products listing, under the name of the products like on the emails/invoice.

The Additional information area will display the custom fields of the table "order".

I too tried with a clean install of joomla and HikaShop and it's working great.

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #70259

Hi Jan,

In the custom fields listing (HikaShop > Display > Custom fields), you have to enable the "Back-end Listing" for your custom fields with the type "Item".

The following user(s) said Thank You: jansuhr

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

  • Posts: 182
  • Thank you received: 15
12 years 1 month ago #70265

Thanks Xavier,

That made it!!


Jan

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

Time to create page: 0.087 seconds
Powered by Kunena Forum