Explore the orders information with the Prestashop module

Hello

I am trying to display the details of orders similar to the ones in history orders

I have used the history.js but I am not able to get the page that displays the details of orders

Below is some code snippet:

{foreach from=$orders item=order name=myLoop}
    {if $order.id_order_state==5}
        {if isset($order.invoice) && $order.invoice && isset($order.virtual) && $order.virtual}
        {/if}
        -|-
        {$order.id_order}
        {Order::getUniqReferenceOf($order.id_order)}
        -|-
        {$order.date_add|date_format:'Y-m-d H:i:s'}

        -|-
            {foreach from=$histories item=history name=hLoop}
                {if $history[0].id_order==$order.id_order}
                    {$history[0].date_add}
                {/if}
            {/foreach}
        -|-

        {$order.payment|escape:'htmlall':'UTF-8'}
        -|-
        {if isset($order.order_state)}{$order.order_state|escape:'htmlall':'UTF-8'}
        {/if}

        <br>
            <a class="color-myaccount" href="javascript:showOrder(1, {$order.id_order|intval}, '{$base_dir}?fc=module&module={$module_name}&controller=products');">{l s='details'}</a>


    {/if}

{/foreach}

This code is supposed to display order and its details.

However, I am facing issues with retrieving the details.

Answer №1

Check out this static function:

Order::getOrdersWithInformations()

This function returns information such as date added, customer ID, total amount paid, statistics, and more.

Answer №2

Which PS version should I refer to?

If you are using 1.5, please check the "OrderDetailControllerCore" class in the controllers/front/ directory and the order-detail.tpl file in themes/your_template/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The match() function does not seem to be functioning properly on iOS and Android devices, as it consistently returns a

Currently, I have a loop set up to go through a list of names in order to check if the user's search query (stored as variable "s") matches any of the names. This loop functions perfectly on desktops and laptops, but unfortunately, it does not work on ...

What is the process for sending a post request with a JSON payload to an external API using Node.js?

I am currently facing an issue while attempting to send a POST request with a JSON payload to an external API using node.js. Below is the code I am using: var express = require('express'); var bodyParser = require('body-parser'); var ...

Update a roster with AJAX following the addition or removal of a user

My goal is to implement two functions: Adding and Deleting a User from the database using Mongoose. However, when I run the code, I receive a 200 OK response but with an empty username. I suspect there might be an issue with the ajax calls. Can anyone hel ...

Eliminate every instance using the global regular expression and the replace method from the String prototype

function filterWords(match, before, after) { return before && after ? ' ' : '' } var regex = /(^|\s)(?:y|x)(\s|$)/g var sentence1 = ('x 1 y 2 x 3 y').replace(regex, filterWords) console.log(sentence1) sentence2 ...

JavaScript Build Failure: Linting Error Detected - no-constant-condition

I am encountering an error labeled as Unexpected constant condition no-constant-condition when attempting to compile this code. (The error is on a line indicated with >>>) This code operates based on user input. The variables commandVariable0 and ...

The ripples can be found at the bottom of the map, not at the front

Having an issue when working with Globe where Ripple rings are always appearing on the backside of the map, rather than in front of it Referencing the source code from https://github.com/vasturiano/globe.gl/blob/master/example/random-rings/index.html and ...

Export data from Angular Material data table to Excel format

I'm currently utilizing the angular material data table to showcase data in a tabular layout. I have a requirement to add a feature that enables the export of tabular data to an Excel sheet. Unfortunately, I haven't been able to locate any resour ...

The `.babelrc` file is unable to locate presets within a nested node_modules directory

My file structure is organized as follows: > build > node_modules > webpack.config.js > .babelrc > .gitignore In my .babelrc file, the configuration appears like this: { "presets": ["es2015", "stage-0", "react"] } However, I ...

Material UI Card shadow effect getting cropped

Currently experiencing an uncommon issue while using Material UI's Card component - the box-shadow is cut off on the top and bottom sides. Any suggestions on how to resolve this problem? Check out my code below: import React, { Component } from & ...

``Is there a way to align components with the same width side by side horizontally

I have a situation where I need to align three components, a radio button and two select fields, on the same row within a container. Currently, they are displaying on separate rows but I want them to be in three columns on a single line. I tried following ...

Is the Await keyword failing to properly pause execution until the promise has been fulfilled?

I'm currently working on manipulating a variable within an async function, and I've noticed that the variable is being returned before the completion of the data.map function below. Even though I have the await keyword in place to pause the code ...

The following code automatically triggers the loading of a modal, which contains a checkbox upon loading

What is the best way to prevent the modal from showing again if the user checks the checkbox and clicks the close button? function popUp() { $("#LoadModal").show() var modal = document.getElementById('LoadModal') var closeBtn = document ...

What is the process for applying a class in jQuery to empty HTML elements?

Working on a WordPress/PHP website and looking to dynamically add a class when child elements are empty? This is the HTML structure: <div class="featured-block"> <a href="/" class="featured-block__item cf"> <div class="featured-bl ...

I am encountering an issue with Three.js version r69

I encountered an issue with line geometry.vertices.push(new THREE.Vertex(vector)); In the earlier version of Three.js, r36, this line was functioning. var vector = new THREE.Vector3(-300 + x/4, 240 - y, 0); geometry.vertices.push(new THREE.Vertex(ve ...

Adding a dynamic Dojo-enabled element using Zend Framework

Currently, I am developing a form using Zend_Dojo_Form. Everything is working smoothly, except when I dynamically add elements to the form (via ajax where users can click a [+] button to add more elements). Although I have successfully inserted my new Ze ...

Add several additional views following an element within a View in Backbone

addDimensions: function (order_id, counter) { this.dimensionsView = new dimensionsView({ el: "#panel-boxes-" + order_id + "_" + counter, id: order_id, counter: counter }); $("#panel-boxes-" + order_id + "_1").append(this.dimensionsView.render().el) ...

How can you display each input in a form sequentially?

My goal is to use jQuery to display each form text input one by one, allowing the user to enter data before moving on to the next input. Once the user has completed the entire form in segments, I want to submit all the responses at once. Is it possible to ...

Best practices for sending variables to an HTML page using nodemailer

I am interested in sending an email with an HTML template that includes dynamic data. For example, I want to include a unique id within a link on the page. Is it possible to insert dynamic data into HTML content when sending emails? If yes, I would apprec ...

Using Handlebars, populate a select box with two variables - one in the select tag and the other as options within the select box

Good day, currently working on a project that involves obtaining data from an API in JSON or Object format. The first variable contains categories of achievements, while the other one contains the actual achievements. My goal is to create a select box wi ...

How can I adjust a number using a shifter in JavaScript?

Searching for an event handler where I can use a shifter to adjust the value of a number by moving it left or right. Would appreciate any links to documentation on how to achieve this. Many thanks UPDATE Thanks to the suggestions from other users, I hav ...