Category: php
-
Convert VueJS site to NuxtJS
To convert a Vue.js website to Nuxt.js, you need to follow a few steps. Nuxt.js is a framework built on top of Vue.js that provides server-side rendering (SSR) and other useful features for building universal web applications. Here’s a general process to convert your Vue.js website to Nuxt.js: Set up a new Nuxt.js project: Create…
-
Install Latest or Old version of Magento2 via Composer
To get the Magento metapackage: Log in to your Magento server or localhost path where you would like to install the Magento. Make sure you have proper permissions to use that folder. Change to the web server docroot directory or a directory that you have configured as a virtual host docroot. Create a new Composer…
-
Magento 2: Static files are present but shows 404 Error
Instead of look on the server directly, we should check first the Magento setup. Generally, this errors comes when the setup missing the .htaccess file in the pub/static folder. Here below I mentioned the .htaccess file code. You can copy it and create a .htaccess file inside pub/static folder and paste. Tweet This Post
-
How to replace string in parentheses using regex
PHP, Java and other languages provide replace all functionality to replace any character by any specific character. But REGEX is best method to replace or remove any specific value using pattern. Suppose, we have input string is $xyz = “This is my best (friend)”; and we want to remove words from “()”. So it so…
-
How to programmatically add shipment with a tracking number to any order : PART II
In my previous post [How to programmatically add shipment with a tracking number to any order : PART I], you found that how can we generate shipment for an order programmatically. Here we are going to learn next step to add tracking number with generated shipment. We are assuming that you are going to use…
-
How to programmatically add shipment with a tracking number to any order : PART I
We are assuming that we have an order incremented id. and we want to make shipment for this order. Here also we are assuming that invoice has been generated for order already. so we are going to generate only shipment. $orderId = ‘1000001’; $order = Mage::getModel(‘sales/order’)->loadByIncrementId($orderId); Here we are checking the current status of order…
-
How to get ordered Items and their detail for an order ID in Magento?
I tried to wrote this code when I was working on a cron file for all orders. My client wants a cron file that get all orders information including all ordered item and their detail. First, I searched on google but I didn’t found any exact solution then I tried below code: By below code…
-
How to add custom layout template in Magento
Magento provides following types of page layout in default. 1column, 2columns-left, 2columns-right, 3columns, empty, and print. But sometimes we need to change design in layout and we do not want to affect on other pages. For example, we want to use different layout for all static pages. and we want to use 2columns-left layout style…
-
Magento: How to merge multiple fields in a colum in Magento admin panel grid?
Magento provides lot of inbuild functionalities. Using “protected function _prepareColumns()” function we can create or add new column to the grid. Like: protected function _prepareColumns() { $this->addColumn(‘first_name’, array( ‘header’ => Mage::helper(‘custommodule’)->__(‘First Name’), ‘align’ => ‘left’, ‘width’ => ’50px’, ‘index’ => ‘first_name’, )); $this->addColumn(‘last_name’, array( ‘header’ => Mage::helper(‘custommodule’)->__(‘Last Name’), ‘align’ => ‘left’, ‘width’ => ’50px’, ‘index’…
-
What is Memcached?
Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. Memcached is simple yet…
-
Magento: How to debug error quickly
Magento provides log file to maintain each type of error on your application. By this you can add log error or exception to magento’s system log file. Its very handy to view coding errors. Developing for Magento is often hard, especially since it’s not always possibly to have error reporting on (and even when it…
-
Zend: Join doesn’t work in my model
Zend provides JOIN, joinLeft, joinRight keywords to join two or multiple tables. you can make an sql object by calling select function of current model by: $select = $this->getDbTable()->select(); Use below line to use JOIN terms in your SQL: $select->setIntegrityCheck(false); By default its integrity value set to True and it do not allow to use…
-
Zend: How to use multiple conditions at delete time?
Zend provides a facility to delete a row from the database table using the delete() method. This method takes one argument, which is an SQL expression that is used in a WHERE clause, as criteria for the rows to delete. For example : $modelObj = new ModelName(); $where = $modelObj >getAdapter()->quoteInto(‘id = ?’, ‘1235’); $modelObj…
-
CSS: Opacity in all browsers
Today’s market is based on 3D and most things are doing by jQuery or Javascript to make fast loading application. Opacity is a part of CSS to make transparent image without PNG format. To set the opacity property to an image you can use: .img_transparent_class{ opacity: 0.5; } But this line will suitable for some…