How to Improve WordPress Security ?

We know as a matter of fact that having your site hacked is not fun. That is the reason, here at Universal WebTech, we consider security important. In accordance with our genuine way to deal with security, our items are…

Read More

Load product in magento by SKU or product id

To load product using product id we can use below code. $product = Mage::getModel(‘catalog/product’)->load($product_id); We can also load product using SKU. Below is the code for load product using SKU. $_sku = ‘product_sku’; $_product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,$_sku); echo $_product->getName();

Read More

Warning: simplexml_load_string() in Magento

Warning: simplexml_load_string() in Magento This error comes when there is any unwanted white space in any file or in the URL path. To fixed this error connect to database and open table core_config_data. find web/unsecure/base_url and web/secure/base_url URL in this…

Read More

Direct SQL Queries In Magento

Let’s assume we need to fetch data from direct database and we don’t want to use model in magento. At that time we can also access data direct from database using magento database connection and simple SQL query. Below is…

Read More

Get product image in Magento

Magento basically have 3 different types of product image which are as followed. Base Image Small Image Thumbnail image Now let’s see how we can get product images using product id. $products = Mage::getModel(‘catalog/product’)->load(900); echo $products->getImage(); echo $products->getSmallImage(); echo $products->getThumbnail();…

Read More

Get product collection filter by category id in magento

Below is the code by using we can get product collection filter by category id in magento $category = Mage::getModel(‘catalog/category’)->load(‘category_id’); $productCollection = $category->getProductCollection(); $productCollection ->addStoreFilter() ->setVisibility(Mage::getSingleton(‘catalog/product_visibility’)->getVisibleInCatalogIds()) ->addMinimalPrice() ->addFinalPrice() ->addTaxPercents() ->addAttributeToSelect(Mage::getSingleton(‘catalog/config’)->getProductAttributes()) ->addUrlRewrite();

Read More

SQL constraints

FOREIGN KEY – Ensure the referential integrity of the data in one table to match values in another table CHECK – Ensures that the value in a column meets a specific condition NOT NULL – It will not accept NULL…

Read More

Get subcategories of a main category in magento

To insincere sales it is important that your store must be user friendly where user easily find his/ her needed product and easily navigate in store. one of important page in magento is to display subcategory of main category. i.e…

Read More

Filter product collection with multiple SKU magento

Suppose, you need product information of more then one product using SKU at that time we can get all information using “array in” with filter. Below is code for the same. you just need to change SKU name in below…

Read More

Class Magento\Authorization\Model\Acl\Role\GroupFactory does not exist magento2

Getting error Class Magento\Authorization\Model\Acl\Role\GroupFactory does not exist magento 2 is quite complex to understand. We frequently get this error while developing store. Here is solution to fix this error. 1) go to var folder and find generation. now remove folder….

Read More