VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: TAIWAR on December 07, 2020, 18:31:23 PM

Title: Mpn display and new name
Post by: TAIWAR on December 07, 2020, 18:31:23 PM
Hello

I want to display on front end « mpn » I saw topic :

<?php echo $this->product->product_mpn ?>

But Where we have to add this code please ? Which file ?
Also I want to translate it what is the name constant ?

Thank you

Regards
Title: Re: Mpn display and new name
Post by: jenkinhill on December 07, 2020, 18:44:29 PM
The exact code is different for product & category pages:

$this->product      is for productdetails page
$product->   is for product fields on the category page

It should go into your template overrides, which one(s) and where depends on the above and where you want to display the mpn.

No translation is required.
Title: Re: Mpn display and new name
Post by: TAIWAR on December 07, 2020, 19:50:27 PM
Hello thank you for your answer.
It is on the product details page under the name of the product example under the title « cercle à tarte ... »

https://www.perledoree.fr/moule-patisserie/moule-de-cuisson/cercle-à-tarte-perforé-ø-28cm-detail.html

Thank you
Title: Re: Mpn display and new name
Post by: jenkinhill on December 07, 2020, 21:21:16 PM
OK so I have no idea how that template is built, but in standard VM the product title code is in the productdetails default.php

So assuming the template follows standard VM layout the override template file to edit is
templates/theme684/html/com_virtuemart/productdetails/default.php

In the VM default template the title H1 is labelled <?php // Product Title   ?>

You should be able to work it out from there. You may want to add a css class to your code to style the output.
Title: Re: Mpn display and new name
Post by: TAIWAR on December 08, 2020, 08:24:28 AM
Ok it is solved thank you