News:

Looking for documentation? Take a look on our wiki

Main Menu

Mpn display and new name

Started by TAIWAR, December 07, 2020, 18:31:23 PM

Previous topic - Next topic

TAIWAR

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

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

TAIWAR

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

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

TAIWAR