Product field, under price

  • Posts: 57
  • Thank you received: 2
10 years 4 months ago #162016

Hi, I want a product field to be under the product description, options, and price.
prntscr.com/3wtuuq like here.

However all product fields are added to the specifications page, how do I add a product_field to be under the product?

And only show it when I have it enabled for that category / product? / filled in?


The reason I want to do this, I have certain products that have a long delivery time, I want to make it say, delivery time, 2 weeks for example

But I don't want this to be said on all the products, just the products that qualify. (warehouse)
I am so confused, I am dealing into this because you cannot set a restock time for products.

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
10 years 4 months ago #162047

Hi,

In that case, you want to turn off the "frontend" option of the custom field and instead edit the file "show_tabular" via the menu display>Views and such code:
<?php if(!empty($this->element->FIELD)) echo 'My Field:'.$this->element->FIELD; ?>
where FIELD needs to be replaced with the column name of your field.
You can add that code where you need it in that view file so that it displays at the place you want.

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

  • Posts: 57
  • Thank you received: 2
10 years 4 months ago #162161

Thank you nicolas for the answer! Great,

Now I want to do the following, I want to make it a multiple dropdown in the back-end, and have HTML code in there, however it won't let me, I want to put a tiny image infront of the text (field) that difers from each entry.

However I cant do html code there?

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

  • Posts: 57
  • Thank you received: 2
10 years 4 months ago #162184

oh nicolas, can you make the code a bit easier to understand?

i am a little confused on how to do this, lets say my columb name is delivery_time and my label is levertijd, how would i implement this code?

<?php if(!empty($this->element->delivery_time)) echo 'levertijd:'.$this->element->delivery_time; ?>

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
10 years 4 months ago #162186

Hi,

1. I'm not sure how you want to add HTML code in the field at the same time as having the field being a multiple dropdown.
Normally, when you have a text, textarea custom field where you want to add HTML in the field as value of the elements, you need to turn off the "input filtering" option of the custom field.

2. Yes, your code is correct.

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

  • Posts: 33
  • Thank you received: 0
9 years 7 months ago #194550

Hi Nicolas,

I've done everything what is stated here, but still I see the Delivery_time in specification

Thanks

Last edit: 9 years 7 months ago by suhail.

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
9 years 7 months ago #194559

Hi,

Please do a screenshot of the settings of your custom field, a screenshot of the code modification that your made and a link to the page.

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

  • Posts: 33
  • Thank you received: 0
9 years 7 months ago #194682





Hi Nicolas,
the only thing I have done is place the code in show_tabular and then the Costum_Fields with the data of the code!: tag: delivery time and delivery_time in columun. that's it!

Attachments:

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
9 years 7 months ago #194747

Hi,

This will display the value of the field on the product page, but only if:
- you're using the "tabular" product page layout and not another layout
- you edited the view file for the correct joomla template that you're using on your frontend
- the product doesn't have characteristics

So if you don't see it, it must come from one of these three things.

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

  • Posts: 33
  • Thank you received: 0
9 years 7 months ago #194779

Hi,

Maybe I was not clear enough. I would like to see the delivery_time under the price and not in specifications.


Attachments:

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
9 years 7 months ago #194787

Hi,

Removing the specifications area can be done by just turning off the "frontend" display option of the field.
And to display the field value below the product price, the custom code that you have added in the view will do the trick.
So no, it was clear and I told you what to do in order to do what you want.
Note that looking at your screenshot, it seems that you're not using the tabular product layout but the "default" one. So you should do that code modification in the show_default view file, not show_tabular. That's one of the points I mentioned in my previous message.

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

  • Posts: 33
  • Thank you received: 0
9 years 7 months ago #195120

Hi,

be patient with your customers! It is new for me!

Thank you for explaining

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

Time to create page: 0.102 seconds
Powered by Kunena Forum