Prestashop: How translate "Featured Products"? - prestashop-1.7

Module: Ortho Theme Featured products
File:
modules/otfeaturedproducts/views/templates/hook/otfeaturedproducts.tpl
Code:
<h1 class="main-title">
{l s='Featured Products' d='Modules.Featuredproducts.Shop'}
</h1>
I tried with the option:
Translations ->International
After click in Modify only showed:

Solved it. 2 errors found:
1. The module: Is Featured products
2. The word: is "Featured products" ("products" in lower case).
<h1 class="main-title">
{l s='Featured products' d='Modules.Featuredproducts.Shop'}
</h1p

Related

i18n Angular Translations

Using the i18n ICU Select syntax, I have one dropdown working but not the other.
My xlf xml section here appears to be correct, but Angular throws parsing errors:
ERROR Error: Unable to parse ICU expression in "{VAR_SELECT, select, Asian {Asiático} ...
<trans-unit id="ethnicityTypes" datatype="html">
<source>{VAR_SELECT, select, Asian {Asian} African American {African American} Caucasian {Caucasian} Hispanic {Hispanic} Indian {Indian} Native American {Native American} Other {Other}}</source>
<target>{VAR_SELECT, select, Asian {Asiático} African American {Afroamericano} Caucasian {Caucásico} Hispanic {Hispano} Indian {Indio} Native American {Nativo americano} Other {Otro}}</target>
</trans-unit>
The associated Html dropdown is here:
<mat-form-field appearance="legacy">
<mat-select
*ngIf="ethnicitys"
placeholder="Ethnicity"
i18n-placeholder="##ethnicity"
formControlName="Ethnicity"
[disabled]="providerEdit"
[ngClass]="providerEdit ? 'disabled' : ''"
>
<!-- i18n ICU Select syntax -->
<mat-option *ngFor="let eth of ethnicitys" [(value)]="eth.UID">
<span i18n="Patient Edit modal|Ethnicity##ethnicityTypes">
{eth.EthnicityDescription, select, Asian {Asian} African American {African American} Caucasian {Caucasian} Hispanic {Hispanic} Indian {Indian} Native American {Native American} Other {Other}}
</span>
</mat-option>
</mat-select>
</mat-form-field>
Here's an example from my XLF Spanish file which works fine:
<trans-unit id="phoneTypeValue" datatype="html">
<source>{VAR_SELECT, select, Home {Home} Work {Work} Cell {Cell}}</source>
<target>{VAR_SELECT, select, Home {Casa} Work {Trabajo} Cell {Celular}}</target>
<note priority="1" from="meaning">patient-edit.modal</note>
</trans-unit>
This phoneTypeValue is associated with the following Html dropdown markup:
<mat-form-field appearance="outline" outline="never">
<mat-select
placeholder="Phone Type"
i18n-placeholder="##phoneType"
formControlName="PhoneType"
[disabled]="providerEdit"
>
<mat-option *ngFor="let pt of phoneTypes" [(value)]="pt.UID">
<span i18n="Phone Type value|The Phone Type data value##phoneTypeValue"
>{pt.PhoneTypeName, select, Home {Home} Work {Work} Cell {Cell}}</span
>
</mat-option>
</mat-select>
</mat-form-field>
The Angular line of code parsing the ICU Select message is:
const msgParts = replaceNgsp(message).split(PH_REGEXP); // value of PH_REGEXP = /�(\/?[#*]\d+):?\d*�/gi
This non-problematic message var comes back as:
'{�0�, select, Home {Casa} Work {Trabajo} Cell {Celular}}'
whereas this problematic var shows :
'{VAR_SELECT, select, Asian {Asiático} Work {Trabajo} Cell {Celular} Other {Otro}}'
So it's supposed to result in an array like this:
msgParts
['{�0�, select, Home {Casa} Work {Trabajo} Cell {Celular}}']
0: "{�0�, select, Home {Casa} Work {Trabajo} Cell {Celular}}"
length: 1
lastIndex: (...)
lastItem: (...)
[[Prototype]]: Array(0)
I don't know why Angular uses �0� (Unicode U+FFFD) here, but the VAR_SELECT section above for some reason is NOT replaced by the Unicode chars. I guess that's why it's failing.
I don't understand what's wrong.
Thanks in advance.

xpath for parent a tag

so I've been trying to scrape this without much luck. I have tried with the following xpaths with no luck:
../#href
parent::a/#href
Here's what I'm trying to scrape:
<a href="https://placeholder.url.com" class="infoclass_3392 classghzb">
<div class="hgs-983hsa" data-testid="Name">Casing NZXT H510i Black Matte or White</div>
<div class="hgs-212gsa" data-testid="Price">Rp1.747.999</div>
</a>
I can scrape the price data, but from the price data I'm trying to access the parent a tag.
If your current node is the text(), you need to go up two levels: ../../#href or parent::div/parent::a/#href. The parent of the text() is the div.
Demonstated in xsh:
open file.xml ;
cd a/div[2]/text() ;
ls ; # Rp1.747.999
echo ../../#href ; # https://placeholder.url.com
echo parent::div/parent::a/#href ; # https://placeholder.url.com

How to get text which has no HTML tag

Following is the HTML:
<div class="ajaxcourseindentfix">
<h3>CPSC 353 - Introduction to Computer Security (3) </h3>
<hr>Security goals, security systems, access controls, networks and security, integrity, cryptography fundamentals, authentication. Attacks: software, network, website; management considerations, security standards in government and industry; security issues in requirements, architecture, design, implementation, testing, operation, maintenance, acquisition, and services.
<br>
<br>Prerequisite: CPSC 253U
<span style="display: none !important"> </span> or CPSC 254
<span style="display: none !important"> </span> and CPSC 351
<span style="display: none !important"> </span>
, declared major/minor in CPSC, CPEN, or CPEI
<br>
</div>
I need to fetch the following text from this HTML:
From Line 6 - or
From Line 7 - and
, declared major/minor in CPSC, CPEN, or CPEI
I am able to get the href [Course number: CPSC 254 etc...] with the following XPath:
# This xpath gives me all the tags followed by h3 and then I iterate through them in my script.
//div[#class='ajaxcourseindentfix']/h3/following-sibling::text()[2]/following-sibling::*
Update
And, then the text with the following XPath:
# This xpath gives me all the text after the h3 tag.
//div[#class='ajaxcourseindentfix']/h3/following-sibling::text()[2]/following-sibling::text()
I need to have these course name/prerequisite in the same way they are at URL 1.
In this approach I am getting all the HREF first, then all text. Is there a better way to achieve this? I don't want to iterate over 2 XPaths to get the HREF first, then Text and after that club them to form the prerequisite string.
1 http://catalog.fullerton.edu/ajax/preview_course.php?catoid=16&coid=99648&show
Try to use below code to get required output:
div = soup.select("div.ajaxcourseindentfix")[0]
" ".join([word for word in div.stripped_strings]).split("Prerequisite: ")[-1]
The output is
'CPSC 253U or CPSC 254 and CPSC 351 , declared major/minor in CPSC, CPEN, or CPEI'

Prestashop 1.6. How to check if product isPack in .tpl?

I want to check in theme (front) product.tpl file (PS 1.6.1.4) if state if product is Standard product or Pack of existing products
{if $product_type == Product::PTYPE_PACK} not working....
I want to return boolean.
use:
{if $packItems|#count > 0}
an example of using you can find it in product.tpl in the theme folder.
used in this way:
{if $packItems|#count > 0}
<div class="short_description_pack">
<h3>{l s='Pack content'}</h3>
{foreach from=$packItems item=packItem}
<div class="pack_content">
{$packItem.pack_quantity} x {$packItem.name|escape:'html':'UTF-8'}
<p>{$packItem.description_short}</p>
</div>
{/foreach}
</div>
{/if}
in addition, there is in a products object:
$product->id_pack_product_attribute = null
$product->cache_is_pack = 0
for non-pack products

Remove standard title from Magento bundled products

Hope anybody can help me on this matter.
I want to delete the standard title from the bundled products, but I can not find where to do this.
Help is appreciated.
Thanks and regards
Extra information
In my email confirmation I see:
Test Bundled products (= product name)
[title]
1x Product A - € 5.00 SKU1
[title]
1x Product B - € 5.00 SKU2
I already cleared the price in /app/code/local/Mage/Bundle/Block/Sales/Orders/Items/Renderer.php, but the [title] must be hidden or gone in my email notification so it finally looks like this:
1x Product A - € 5.00 SKU1
1x Product B - € 5.00 SKU2
Hello you can change product meta title check below path
Admin->Catalog->manage products->select particular product->meta information -> add meta title -> save
In your phtml template you can replace:
<?php echo $this->getSelectionQtyTitlePrice($_selection) ?>
with
<?php echo $this->escapeHtml($_selection->getName()); ?>
<span class="price-notice">
<span class="price">
+ <?php echo $this->formatPriceString($_selection->getPrice()); ?>
</span>
</span>

Resources