Remove "Social Title" from order form in Prestashop? - prestashop

I have just downloaded and installed the latest version of Prestashop. And found out there is a Social Title-option in order checkout form.
I want to remove that. I have found how to remove the Mr and Mrs boxes. But the whole row and label "Social Title" remains.
Have tried to search on Google for an answer but can't find. Some answers refer to the addresses.tpl. But I think the templates might been changed since these threads.
In fact, I have tried to search for "social" in the whole template directory and can't find anything related to this.
The nearest I get is in the ../templates/customer/_partials/customer-form.tpl. And I think it's rendered where this is:
<section>
{block "form_fields"}
{foreach from=$formFields item="field"}
{block "form_field"}
{form_field field=$field}
{/block}
{/foreach}
{/block}
</section>
So, maybe the social title isn't able to change from templates anymore?
So, where do I change it nowadays?

In Prestashop 1.7 there is no need to edit any code, you can just go to Shop Parameters -> Customer Settings -> Titles and remove all existing titles.
This will prevent the "Social title" field from being generated.

Shop Parameters -> Customer Settings -> Titles - Delete titles
themes/xxx/templates/_partials/form-fields.tpl 9th line change
{if $field.type !== 'checkbox'}
{$field.label}
{/if}
to
{if $field.type !== 'checkbox' and $field.type !== 'radio-buttons'}
{$field.label}
{/if}
Yeah, it's kind of dummy workaround, but it works.
UPDATE:
More proper way would be to comment the block:
$genderField = (new FormField)
->setName('id_gender')
->setType('radio-buttons')
->setLabel(
$this->translator->trans(
'Social title', [], 'Shop.Forms.Labels'
)
)
;
foreach (Gender::getGenders($this->language->id) as $gender) {
$genderField->addAvailableValue($gender->id, $gender->name);
}
$format[$genderField->getName()] = $genderField;
You can find it in /classes/form/CustomerFormatter.php

You can find the code for Social Titles in file at the following path:
/themes/default-bootstrap/identity.tpl
Note: It is not a good practice to remove the code from a core file, we recommend to apply some CSS to hide the Social Title block.

Related

Drupal 8 - Get comments area on custom template

I am trying to get the comment form with all comments on a custom template article page of drupal. I can get the whole content with {{ page.content }} or get the comments by using {{ node.field_comments }} and make a loop on it (assuming my field comment machine name is field_comments).
But does anyone know I to render the whole comments block with :
links to add a comment
comments
comment form
Thank you very much for your help !
Try to use the new and refined comment module. It's in the core so all you have to do is enable it. After that just make a comment type, add it to your article and display. That's pretty much it.
In template files for a content type (eg node--article.html.twig), you have the 'content' variable available. I use this bit of Twig to render the whole comments block:-
{{ content.comment }}
I struggled with this too, but just for the next visitor, I got 2 out of 3 (I didn't want the form on my page)
- links to add a comment -> {{ content.links }}
- comments -> {{ content.comment_node_TYPE }}
To get the correct name for content.comment_node_TYPE, visit your Mange fields page for that content type and see what the comment field is called
e.g. my "Audio" content type names the field {{ content.comment_node_audio }}
Hope this helps someone in future

Smarty template variable carry to header.tpl

Editing the WHMCS template files (smarty) I can't seem to carry this variable outside of its tpl page and into the header.
knowledgebase.tpl
{assign var="page_alias" value="knowledgebase"}
header.tpl
{assign var="active_link" value="my value"}
{if isset($page_alias) && $page_alias == 'knowledgebase'}
{$active_link}
{else}
{}
{/if}
If all that is on the same page it outputs "my value". but when I have it setup on pages as described above it returns nothing. I've also tried the scope='global' at the end of the first code.
I see several people with similar questions on here but none seem to have an actual answer.
Use session instead. I had the similar problem. Couldn't find any solution. Even contacting WHMCS support did not help! So I just used session variables to handle my job.

prestashop free shipping issue

I just upgraded firstly manually but later on by 1-click Upgradev1.0.13 to 1.5.4 version. I got a big problem on shopping cart with the shipping fees.
The cart located on homepage top left was solve not to show "FREE SHIPPING" from the previous code in this forum.
But once I checked on the shopping cart inside after I select and press "Update Carrier List" button and
press "Update Cart" button, the shipping fees is not updated but show as "FREE SHIPPING".
Could anyone suggest me solution about this? Thank you very much. I very much appreciate it.
My demo website is http://store.relishthai.com/.
You can try to add item by selecting the "TEA" tag and add one item to the cart and see the "FREE SHIPPING" problem.
I have had a very similar issue. The problem is that there is a Javascript file that updates the value to "FREE SHIPPING" if the value(shipping price) is equal to 0.00. I am using a different version, so I can't exactly point you to the file, but you can definitely solve this in three minutes. (Check order-opc.js in your theme/js folder)
View source of the web page and see what .js files are included. Search "FREE SHIPPING" in Javascript files (such as cart.js) and see which one is the culprit. Then go on FTP and change it to 0.00. I prefer "Free!" by the way ;)
EDIT: It seems like I misread your Q.
I tried pressing "Update carrier list" and then "Update cart", but I do not see the shipping fees as "Free shipping." Instead, I see 8 dollars.
Thanks again. Previously before your answer the $0.00 appeared in the top left cart on the page but later on after your comments I double checked things and deleted unused zone (no fees in there). And I tried to put the real shipping fees for all weight ranges. Now, the old problems has been solved but the shipping fees with weight ranges (in small ranges) still exits. I'll try to figure things out.
Many Thanks!!
Open the file /themes/xxx/modules/blockcart/blockcart.tpl
and remove this block of code (or comment):
<div class="layer_cart_row">
<strong class="dark">
{l s='Total shipping' mod='blockcart'} {if $display_tax_label}{if $priceDisplay == 1}{l s='(tax excl.)' mod='blockcart'}{else}{l s='(tax incl.)' mod='blockcart'}{/if}{/if}
</strong>
<span class="ajax_cart_shipping_cost">
{if $shipping_cost_float == 0}
{l s='Free shipping!' mod='blockcart'}
{else}
{$shipping_cost}
{/if}
</span>
</div>

whmcs title code how i can modified?

my whmcs title code show beleow. i want to modified it.
<title>{if $kbarticle.title}{$kbarticle.title} - {/if}{$pagetitle} - {$companyname}</title>
i want when i go my site homepage/index page then show this code like that
<title>{$companyname} - {$pagetitle}</title>
but when i go other page like shared hosting,reseller hosting etc then code show that
<title>{$pagetitle} - {$companyname}</title>
how i can do it. it possible?
You Should Some Modified Mr Caner G code. like this. i think it will be work.
<title>{if $filename eq "index"}{$companyname} - {$pagetitle}
{else}{$pagetitle} - {$companyname}{/if}</title>
In your templates, find header.tpl, use the following code :
{if $filename eq "index"}
<title>{$companyname} - {$pagetitle}</title>
{else}
<title>{$pagetitle} - {$companyname}</title>
{/if}
Yes it is possible. Please check the following offical document of WHMCS(Page titles section) : http://docs.whmcs.com/Seo
Alternatively you could use the template var {$isIndex}.
Like so
<title>
{if $isIndex}
{$companyname} - {$pagetitle}
{else}
{$pagetitle} - {$companyname}
{/if}
</title>
When in doubt about what template vars are available to you in WHMCS you can always use the {debug} command

dijit.InlineEditBox with highlighted html

I have some dijit.InlineEditBox widgets and now I need to add some search highlighting over them, so I return the results with a span with class="highlight" over the matched words. The resulting code looks like this :
<div id="title_514141" data-dojo-type="dijit.InlineEditBox"
data-dojo-props="editor:\'dijit.form.TextBox\', onFocus:titles.save_old_value,
onChange:titles.save_inline, renderAsHtml:true">Twenty Thousand Leagues <span
class="highlight">Under</span> the Sea</div>
This looks as expected, however, when I start editing the title the added span shows up. How can I make the editor remove the span added so only the text remains ?
In this particular case the titles of the books have no html in them, so some kind of full tag stripping should work, but it would be nice to find a solution (in case of short description field with a dijit.Editor widget perhaps) where the existing html is left in place and only the highlighting span is removed.
Also, if you can suggest a better way to do this (inline editing and word highlighting) please let me know.
Thank you !
How will this affect your displayed content in the editor? It rather depends on the contents you allow into the field - you will need a rich-text editor (huge footprint) to handle html correctly.
These RegExp's will trim away XML tags
this.value = this.displayNode.innerHTML.replace(/<[^>]*>/, " ").replace(/<\/[^>]*>/, '');
Here's a running example of the below code: fiddle
<div id="title_514141" data-dojo-type="dijit.InlineEditBox"
data-dojo-props="editor:\'dijit.form.TextBox\', onFocus:titles.save_old_value,
onChange:titles.save_inline, renderAsHtml:true">Twenty Thousand Leagues <span
class="highlight">Under</span> the Sea
<script type="dojo/method" event="onFocus">
this.value = this.displayNode.innerHTML.
replace(/<[^>]*>/, " ").
replace(/<\/[^>]*>/, '');
this.inherited(arguments);
</script>
</div>
The renderAsHtml attribute only trims 'off one layer', so embedded HTML will still be html afaik. With the above you should be able to 1) override the onFocus handling, 2) set the editable value yourself and 3) call 'old' onFocus method.
Alternatively (as seeing you have allready set 'titles.save_*' in props, use dojo/connect instead of dojo/method - but you need to get there first, sort of say.