Unable to create custom product field

  • Posts: 14
  • Thank you received: 0
11 years 1 month ago #165908

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.28
-- Browser(s) name and version -- : Firefox 31.0
-- Error-message(debug-mod must be tuned on) -- : Error

Error Saving

The field "howto" already exists in the table "product"

I have tried to create a custom product field called 'How To' that will appear in the products tabs.
But when I try to say I get the message that the 'howto' already exists in the table 'product'.

How can I make this tab appear in both the admin product page so I can add the details and then on the product page front end?


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com
Last edit: 11 years 1 month ago by Jerome.

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

  • Posts: 2334
  • Thank you received: 403
11 years 1 month ago #165929

Hi there,

Are you sure you don't have a custom field with the same name?
If yes, just set up a different "column name". If not, you can go in your data base and delete the column named howto in the table xxx_hikashop_product.

About the display, just select yes for the front-end and back end option when creating your custom field.

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

  • Posts: 14
  • Thank you received: 0
11 years 1 month ago #165971

Originally I tried to set this up using the Hikashop starter pack but it would only allow me to save custom fields as address. But now I have Essentials I can save custom field as product. There are no instances in the custom fields list that relate to 'howto'.

So I have now searched the database and see that 'howto' is in fact a the ***_hikashop_product table. But I am not sure how to remove it from the database.


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com

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

  • Posts: 14
  • Thank you received: 0
11 years 1 month ago #165974

ok managed to find the place to delete from the database and was able to create new custom field as product.
But this is not showing up on front end or in the admin section. How can I publish content to this new custom field?


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com

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

  • Posts: 14
  • Thank you received: 0
11 years 1 month ago #165977

Ok set to text area and now see a new field at the bottom of the left column on the product page. But no editor options.
I have typed in some content and saved but still this does not turn up on the front end product page. Also not on the front end I see that the product title is no longer displayed.

Not very straight forward.


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #166034

Hi,

The field will display a text area if you select the type text area. If you want a wysiwyg editor, you need to select the type wysiwyg editor in the options of the custom field.
In order to display the content of the field on the product page on the frontend, you need to make sure that the "frontend" option of the custom field is turned on.
The product title should always be displayed, regardless of the custom fields or anything else. There is no option to remove the product title from the product page, unless you remove the code displaying it from the view file. Could you provide a link to the product page ?

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

  • Posts: 14
  • Thank you received: 0
11 years 1 month ago #166108

Thank you for pointing out the wysiwyg editor option. I have now changed this and the editor is displaying correctly on the product editing page.
The field has bee set to display on both front and back end. But still this is not being added to the product as a new tab.
When I open a product on my site I only see 2 tabs. Description and Specifications. I notice in the Specifications tab the 'How To' text has been add with another title 'Specifications' and the the copy with the words 'How To' at the side.
I wanted these to be a new tab.
Why is it being added here and why is there another title that is not related?


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #166111

Hi,

By default the custom fields are added in the "Specifications" tab as generally these fields contains details.
Isn't "How to" the name of one of your custom fields ?

To create a new tab, you will have to edit the view "product / show_tabular" and add <li> and <div> entries like the other tabs are made. It require juste HTML modifications.

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

  • Posts: 14
  • Thank you received: 0
11 years 1 month ago #166686

ok I have managed to add another tab called 'How To' but the content still remains in the Specifications tab.

This is how and where I added the code after the specifications <li>.

<li id="hikashop_show_tabular_description_li" class="hikashop_tabs_li ui-corner-top"><a onclick="displayTab('hikashop_show_tabular_description');" href="javascript:void(0);"><?php echo JText::_('PRODUCT_DESCRIPTION');?></a></li>
			<?php if($hide_specs == 0){ ?>
			<li id="hikashop_show_tabular_specification_li" class="hikashop_tabs_li ui-corner-top"><a onclick="displayTab('hikashop_show_tabular_specification');" href="javascript:void(0);"><?php echo JText::_('SPECIFICATIONS');?></a></li>
          <li id="hikashop_show_tabular_howto_li" class="hikashop_tabs_li ui-corner-top"><a onclick="displayTab('hikashop_show_tabular_howto');" href="javascript:void(0);"><?php echo JText::_('How To');?></a></li>

How do I get it to display in the How To tab?


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com
Last edit: 11 years 1 month ago by Wicko.

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

  • Posts: 14
  • Thank you received: 0
11 years 4 weeks ago #167129

ok finally managed to do this with a bit of trial and error.

The custom content being added to the specifications tab was because the script by default is added there

I changed this

<div class="hikashop_tabs_content" id="hikashop_show_tabular_specification">
		<?php
			$this->setLayout('show_block_dimensions');
			echo $this->loadTemplate();
			if(!empty($this->fields)){
				}
			$this->setLayout('show_block_custom');
			echo $this->loadTemplate();
			if(!empty($this->fields)){
				}
		?>
		</div>
to this
<div class="hikashop_tabs_content" id="hikashop_show_tabular_specification">
		<?php
			$this->setLayout('show_block_dimensions');
			echo $this->loadTemplate();
			if(!empty($this->fields)){
				}
		?>
		</div>
then added this straight after </ul>
<div class="hikashop_tabs_content" id="hikashop_show_tabular_custom">
<?php
$this->setLayout('show_block_custom_main');
				echo $this->loadTemplate();{
				}
				?>
</div>

Then the content showed under my new tab.

I had to also change the show_block_custom_main in the view options to change the heading in the custom tab to the name of the custom tab.


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com
Last edit: 11 years 4 weeks ago by Wicko.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 4 weeks ago #167135

Hi,

Ok.
I was wondering why you used twice the layout "block_dimension" but you removed the duplicate one.
So, ok !

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.

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

  • Posts: 14
  • Thank you received: 0
11 years 4 weeks ago #167308

Actually was my error as I tried to recreate for the post. The 2nd default was show_block_custom which I then moved.


Oxford web design and print at Holywell Press
www.holywellpress.co.uk
www.wickodesign.com

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

Time to create page: 0.098 seconds
Powered by Kunena Forum