diako
April 10, 2018, 12:00am
1
Hello,
Is it possible to have 2 separate line of product name in product page?
I want to have 2 fields in the backend for product name. the first one for regular name and the second one for technical name, but nothing will change in database.
What will be sent to the database for product name will be like this:
Field A: Regular name
Field B: Technical name
If only one of the above fields have content, then the product name will be that field.
If both of them have content, then the product name will be:
Field A + "" + Field B + " "
Any help would be appreciated.
All the best,
diako
You can use products:main_info_title hook in the product template (design/themes/responsive/templates/blocks/product_templates/default_template.tpl) to override product header. Second name can be taken, for example, from the specific product feature
diako
April 10, 2018, 12:00am
3
Dear eComLabs,
Thank you for your reply. is it possible to make it more clear for me? here is the template file for my theme:
{script src="js/tygh/exceptions.js"}
{hook name="products:view_main_info"}
{if $product}
{if !$hide_title}
{$product.product nofilter}
{/if}
{include file="common/breadcrumbs.tpl"}
{assign var="obj_id" value=$product.product_id}
{include file="common/product_data.tpl" product=$product but_role="big" but_text=__("add_to_cart")}
{hook name="products:image_wrap"}
{if !$no_images}
{assign var="discount_label" value="discount_label_`$obj_prefix``$obj_id`"}
{if $product.image_pairs}
{$smarty.capture.$discount_label nofilter}
{else}
{$smarty.capture.$discount_label nofilter}
{/if}
{include file="views/products/components/product_images.tpl" product=$product show_detailed_link="Y" image_width=$settings.Thumbnails.product_details_thumbnail_width image_height=$settings.Thumbnails.product_details_thumbnail_height}
{/if}
{/hook}
{assign var="form_open" value="form_open_`$obj_id`"}
{$smarty.capture.$form_open nofilter}
{assign var="old_price" value="old_price_`$obj_id`"}
{assign var="price" value="price_`$obj_id`"}
{assign var="clean_price" value="clean_price_`$obj_id`"}
{assign var="list_discount" value="list_discount_`$obj_id`"}
{assign var="discount_label" value="discount_label_`$obj_id`"}
{*hook name="products:main_info_title"}{/hook*}
{if $product.discussion_type && $product.discussion_type != 'D'}
{assign var="rating" value="rating_`$obj_id`"}
{if $product.discussion.search.total_items > 0}
{else}
{/if}
{if $settings.abt__unitheme.show_block_in_product.value > 0}
{assign var="sku" value="sku_`$obj_id`"}
{$smarty.capture.$sku nofilter}
{/if}
{/if}
{hook name="products:ab__deal_of_the_day_product_view"}{/hook}
{include file="views/products/components/product_features_short_list.tpl" features=array($product.header_features[$addons.abt__unitheme.brand_feature_id]) feature_image=true feature_link=true}
{if $smarty.capture.$old_price|trim || $smarty.capture.$clean_price|trim || $smarty.capture.$list_discount|trim}
{if $smarty.capture.$old_price|trim}{$smarty.capture.$old_price nofilter}{/if}
{/if}
{if $smarty.capture.$price|trim}
{$smarty.capture.$price nofilter}
{/if}
{if $smarty.capture.$old_price|trim || $smarty.capture.$clean_price|trim || $smarty.capture.$list_discount|trim}
{$smarty.capture.$clean_price nofilter}
{$smarty.capture.$list_discount nofilter}
{/if}
{assign var="product_amount" value="product_amount_`$obj_id`"}
{$smarty.capture.$product_amount nofilter}
{if $capture_options_vs_qty}{capture name="product_options"}{$smarty.capture.product_options nofilter}{/if}
{assign var="product_options" value="product_options_`$obj_id`"}
{$smarty.capture.$product_options nofilter}
{if $capture_options_vs_qty}{/capture}{/if}
{if $capture_options_vs_qty}{capture name="product_options"}{$smarty.capture.product_options nofilter}{/if}
{assign var="advanced_options" value="advanced_options_`$obj_id`"}
{$smarty.capture.$advanced_options nofilter}
{if $capture_options_vs_qty}{/capture}{/if}
{assign var="product_edp" value="product_edp_`$obj_id`"}
{$smarty.capture.$product_edp nofilter}
{if $capture_options_vs_qty}{capture name="product_options"}{$smarty.capture.product_options nofilter}{/if}
{assign var="qty" value="qty_`$obj_id`"}
{if $smarty.capture.$qty && !$product.prices}
{$smarty.capture.$qty nofilter}
{else}
{$smarty.capture.$qty nofilter}
{/if}
{assign var="min_qty" value="min_qty_`$obj_id`"}
{$smarty.capture.$min_qty nofilter}
{if $capture_options_vs_qty}{/capture}{/if}
{if $capture_buttons}{capture name="buttons"}{/if}
{if $show_details_button}
{include file="buttons/button.tpl" but_href="products.view?product_id=`$product.product_id`" but_text=__("view_details") but_role="submit"}
{/if}
{assign var="add_to_cart" value="add_to_cart_`$obj_id`"}
{$smarty.capture.$add_to_cart nofilter}
{assign var="list_buttons" value="list_buttons_`$obj_id`"}
{$smarty.capture.$list_buttons nofilter}
{if $capture_buttons}{/capture}{/if}
{if $settings.abt__unitheme.show_block_in_product.value > 0}
{if $show_features && $settings.abt__unitheme.show_features_in_product.value == 'Y'}
{include file="views/products/components/product_features_short_list.tpl" features=$product.header_features no_container=true}
{/if}
{/if}
{hook name="products:change_product_ft_ds"}
{if $settings.abt__unitheme.show_block_in_product.value == ''}
{assign var="sku" value="sku_`$obj_id`"}
{$smarty.capture.$sku nofilter}
{/if}
{if $settings.abt__unitheme.show_block_in_product.value == ''}
{if $show_features && $settings.abt__unitheme.show_features_in_product.value == 'Y'}
{include file="views/products/components/product_features_short_list.tpl" features=$product.header_features no_container=true}
{/if}
{/if}
{if $show_descr && $settings.abt__unitheme.show_short_desc_in_product.value == 'Y'}
{assign var="prod_descr" value="prod_descr_`$obj_id`"}
{$smarty.capture.$prod_descr nofilter}
{/if}
{/hook}
{if $settings.abt__unitheme.show_block_in_product.value > 0}
{render_block block_id=$settings.abt__unitheme.show_block_in_product.value dispatch="products.view" use_cache=false parse_js=false}
{/if}
{hook name="products:promo_text"}
{if $product.promo_text}
{$product.promo_text nofilter}
{/if}
{/hook}
{assign var="form_close" value="form_close_`$obj_id`"}
{$smarty.capture.$form_close nofilter}
{if $show_product_tabs}
{include file="views/tabs/components/product_popup_tabs.tpl"}
{$smarty.capture.popupsbox_content nofilter}
{/if}
{/if}
{/hook}
{if $smarty.capture.hide_form_changed == "Y"}
{assign var="hide_form" value=$smarty.capture.orig_val_hide_form}
{/if}
{if $show_product_tabs}
{hook name="products:product_tabs"}
{include file="views/tabs/components/product_tabs.tpl"}
{if $blocks.$tabs_block_id.properties.wrapper}
{include file=$blocks.$tabs_block_id.properties.wrapper content=$smarty.capture.tabsbox_content title=$blocks.$tabs_block_id.description}
{else}
{$smarty.capture.tabsbox_content nofilter}
{/if}
{/hook}
{/if}
{capture name=“mainbox_title”}{assign var=“details_page” value=true}{/capture}