Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5846071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:31:30+00:00 2026-05-22T12:31:30+00:00

I want to send the units per box custom feature in my confirmation mails

  • 0

I want to send the “units per box” custom feature in my confirmation mails in prestashop.

Here’s an example if what I want to do

$myprod = new Product($product['id_product']);
$features = $myprod->getFrontFeatures(1));

foreach(from=$features item=feature)
{
  if ($feature.name == "Units per box")
  {
     $UnitsPerBox = $feature.value|escape:'htmlall':'UTF-8';
  }
}

However I need to do this within a php file (PaymentModule.php) rather than a tpl file, so that code won’t work.
If anybody could point me in the right direction of how to achieve this with php it’d be greatly appreciated.

EDIT:

I used the example code provided which seems to get inside the array but doesn’t return any values

When I run some test code like this

$myprod = new Product($product['id_product']);
$features = $myprod->getFrontFeatures(1);
$UnitsPerBox .= '100';
foreach ($features as $feature) 
{
  $UnitsPerBox .= '200';
  if ($feature->name == 'Units Per Box') 
  {
    $UnitsPerBox .= htmlentities($feature->value, 'ENT_QUOTES', 'UTF-8');   
    $UnitsPerBox .= $feature->name;
  }
  else
  {
    $UnitsPerBox .= $feature->name;
    $UnitsPerBox .= htmlentities($feature->name, 'ENT_QUOTES', 'UTF-8');
    $UnitsPerBox .= htmlentities($feature->value, 'ENT_QUOTES', 'UTF-8');
  }
}

I get this output: “100200200200200200”

Any help would be great, thanks.

Thanks,
Andrew

EDIT: Solution

Got it working in the end, thanks for the help

$myprod = new Product($product['id_product']);
$features = $myprod->getFrontFeatures(1);
foreach ($features as $feature) 
{
foreach ($feature as $key => $value) 
{
    if($value == "Units per box")
    {
        $UnitsPerBox = $feature['value'];
    }
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:31:31+00:00Added an answer on May 22, 2026 at 12:31 pm
    $myprod = new Product($product['id_product']);
    $features = $myprod->getFrontFeatures(1);
    
    foreach ($features as $feature) {
       if ($feature->name == 'Units per box') {
          $UnitsPerBox = htmlentities($feature->value, 'ENT_QUOTES', 'UTF-8');
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want send e-mail with some images in content. I think I must attached
I want send a email by Email Class in codeigniter with gmail, but i
In my application i want send a email to one account.in one button click
Hello Sir i want send list of data to php server i use following
Want to send the text from my current vb application to the Active Window
I want to send a opened file descriptor between two different programs. So I
I want to send a few variables and a string with the POST method
I want to send my Application to background simply clicking on Button inside my
I want to send email with my gmail account, I gave it a try,
I want to send SMS using LWUIT. what class should i be looking at?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.