Page 47 of 68

How to get country details by id in PrestaShop 1.7

In this post I am going to explain how to get country details by id in PrestaShop 1.7. // Your Country Id $id_country = 21; // Load Country object $country = new Country((int) $id_country); // Validate Country object if (Validate::isLoadedObject($country)) { // Print Country Object echo “<pre>”; print_r($country); echo “</pre>”; }  

How to get order details by id in PrestaShop 1.7

In this post I am going to explain how to get order details by id in PrestaShop 1.7. // Your order id $id_order = 5; // Load order object $order = new Order((int) $id_order); // Validate customer object if (Validate::isLoadedObject($order)) { // Get Order Payment Method Name echo $order->payment; // Get Order Date echo $order->date_add;…

PrestaShop 1.7 – How to get customer details by id

In this post I am going to explain how to get customer details by id in PrestaShop 1.7. // Your customer id $id_customer = 4; // Load customer object $customer = new Customer((int) $id_customer); // Validate customer object if (Validate::isLoadedObject($customer)) { // Get Customer First Name echo $customer->firstname; // Get Customer Last Name echo $customer->lastname;…

Prestashop 1.7 – How to get product details by id

In this post I am going to explain how to get product details by id in PrestaShop 1.7. // Your product id $id_product = 10; // Language id $lang_id = (int) Configuration::get(‘PS_LANG_DEFAULT’); // Load product object $product = new Product($id_product, false, $lang_id); // Validate product object if (Validate::isLoadedObject($product)) { // Get product name echo $product->name;…

How to get current customer group id in PrestaShop 1.7?

In this post I am going to explain how to get current customer group id in PrestaShop 1.7. 1) Inside module or controller file (php) if ($this->context->customer->isLogged()) { $customerGroupId = $this->context->customer->id_default_group; echo $customerGroupId . “<br>”; // Do something here } else { // Do something here } 2) Inside template file (tpl) {if $customer.is_logged} {$customer.id_default_group}…

Prestashop 1.7 – Get current logged in customer details

In this post I am going to explain how to get current logged in customer details in PrestaShop 1.7. 1) Inside module or controller file (php) if ($this->context->customer->isLogged()) { $customerId = $this->context->customer->id; $firstname = $this->context->customer->firstname; $lastname = $this->context->customer->lastname; $email = $this->context->customer->email; echo $customerId . “<br>”; echo $firstname . “<br>”; echo $lastname . “<br>”; echo $email…

How to check if customer is logged in or not in PrestaShop 1.7?

In this post I am going to explain how to check customer is logged in or not in PrestaShop 1.7. 1) Inside module or controller file (php) if ($this->context->customer->isLogged()) { echo “Logged In”; // Do something here } else { echo “Not Logged In”; // Do something here } 2) Inside template file (tpl) {if…

Prepare Your Store For The Holiday Season With Our Free Halloween & Christmas Templates

The holiday season is a great opportunity for your ecommerce business to make money. It’s almost end of the year, and you know what it means? The countdown is beginning of holiday seasons. Halloween and Christmas has widely celebrated holidays around the world. As an ecommerce store owner, Now is the time to focusing on…

Magento 2 – How to Get All Guest Orders

In this post I am going to explain how to get guest orders collection in Magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_orderCollectionFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory, array $data = [] ) { $this->_orderCollectionFactory = $orderCollectionFactory; parent::__construct($context, $data); } public function getGuestOrderCollection() { $orderCollecion =…

Magento2 – How to Add or Generate Language Translation CSV

In this post I am going to explain how to add or generate language translation csv in Magento 2. In order to add translation csv file in magento2, first you need to create one folder named “i18n” inside your module’s folder. For Example, app/code/Namespace/Module/i18n Next to that, create a csv file name of language code….

« Older posts Newer posts »