Wednesday, April 15, 2015

How to override the Configurable product price with its Simple product price

In Magento , we often face the problem with the configurable product.If you are placing price to the simple product , whatever it might be only the configurable product price will be displayed.
For example , If you want to sell a simple product X which have the price $10 and a simple product Y which have the price of $20
The first step is to create a configurable product with the price $10, after that we need to open the Associative Product tab. Assign the products which we want to use with this configurable product. After assigning the simple products, we can able to see the Super product attributes configuration with the text box for entering the options and price differences .
We need to leave the product X empty and we need to assign (+$10) for the product Y.
In order to overcome this problem and to display the individual simple product prices our simple product. We need to do little modifications in the core code.
Goto  app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php(better override in your local folder)
Search for the method getFinalPrice() and change that to 
public function getFinalPrice($qty=null, $product){//Start edit$selectedAttributes = array();if ($product->getCustomOption('attributes')) {$selectedAttributes = unserialize($product->getCustomOption('attributes')->getValue());}//End editif (sizeof($selectedAttributes)) return $this->getSimpleProductPrice($qty, $product);if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {return $product->getCalculatedFinalPrice();}$basePrice = $this->getBasePrice($product, $qty);$finalPrice = $basePrice;$product->setFinalPrice($finalPrice);Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty));$finalPrice = $product->getData('final_price');$finalPrice += $this->getTotalConfigurableItemsPrice($product, $finalPrice);$finalPrice += $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice;$finalPrice = max(0, $finalPrice);$product->setFinalPrice($finalPrice);return $finalPrice;}Also  add the below method, after getFinalPrice() methodpublic function getSimpleProductPrice($qty=null, $product){$cfgId = $product->getId();$product->getTypeInstance(true)->setStoreFilter($product->getStore(), $product);$attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);$selectedAttributes = array();if ($product->getCustomOption('attributes')) {$selectedAttributes = unserialize($product->getCustomOption('attributes')->getValue());}$db = Mage::getSingleton('core/resource')->getConnection('core_read');$dbMeta = Mage::getSingleton('core/resource');$sql = <<<SQLSELECT main_table.entity_id FROM {$dbMeta->getTableName('catalog/product')} `main_table` INNER JOIN{$dbMeta->getTableName('catalog/product_super_link')} `sl` ON sl.parent_id = {$cfgId}SQL;foreach($selectedAttributes as $attributeId => $optionId) {$alias = "a{$attributeId}";$sql .= ' INNER JOIN ' . $dbMeta->getTableName('catalog/product') . "_int" . " $alias ON $alias.entity_id = main_table.entity_id AND $alias.attribute_id = $attributeId AND $alias.value = $optionId AND $alias.entity_id = sl.product_id";}$id = $db->fetchOne($sql);return Mage::getModel("catalog/product")->load($id)->getFinalPrice($qty);}

Sunday, April 5, 2015

Use of Magento Registry Variable

The Main Advantage of using Magento is because of its registry methods. Registry is a term which is the method of registering or creating a new variable which you can use it later on the functionalities or methods you want to make use of those variables. You can able to use that variable anywhere to get the stored values back.

There are three registry methods available in magento which are listed below

1.  Mage::register

You can register a variable using this register method

Syntax:

Mage::register(‘keyvalue’, $variablename);

Example

For example, I am going to load the product using product id and get all the product details and I register that product details in a variable which I can use it later on to my code

$product_id = ‘23’;$_product = Mage::getModel(‘catalog/product’)->load($product_id);Mage::register(‘product’, $_product);

2.  Mage::registry

This Registery method is used for fetching the registered variable

Syntax:

$newvariable = Mage::registry(‘keyvalue’);

Example

In previous method, we register a product details. In this method we can fetch the registered value.

$productdetails = Mage::registry(‘product’);//This keyalue should be same as that of the variable which we used to register.

3.  Mage::unregister

This Method is used to unregister the variable which is registered

Syntax:

Mage::unregister(‘keyvalue’);

Example:

After fetching all the product details, if we want to remove the values from the stored registry we can use this method.


Mage::unregister(‘product’);

Saturday, April 4, 2015

Why Magento is the Best Ecommerce Solution?

Ecommerce websites have the best part of exploring wide variety of products and services and their details without need to visiting the store. Peoples Nowadays prefer shopping online simply through website in just a mouse click or by using smart phones and tablets. There is lot of open source e-commerce platforms available to create an online web store but the most significant, popular and the best platform is Magento, because of its rich feature and extensive inbuilt functionalities.

Most of the ecommerce developers are highly recommending magento and advising you to go for this CMS, because it is robust and offers you the user friendly methods and functions.

List of 5 reasons to choose Magento for  your  Website

Easy for maintaining the Website

Magento has one of the prominent features that will let you to manage more stores from a single admin panel. Even you can maintain operate on multiple websites with more than one store you can able to assign different domains and different IP address for a website with different store with multi language and multi currency support.

Search Engine Optimization

Even though we are having the best website design and development, without any traffic through search engines then the website is not going to get you the business. All search engines love Magento because it automatically creates clean URLs, product tags, descriptions, keywords, SEO friendly product URLs. We can able to track the website visitors, sessions and all other details using Google Analytics. Magento also offers metadata for products and categories which will increase the identity of your website in search engines.

Order Management

Magento gives your user an easy way of ordering system which will helps you to increase your business in the ecommerce market. Once your customer placed order from the website, you will receive the order email generated from the admin end automatically regarding the ordered products, customer details, payment information’s and the total price of the order. You can able to create, edit and view the orders, create invoices, shipments and send those customers from the admin panel itself instead of using email providers. Magento helps you to extract the order sales reports monthly wise or daily basis. Because of this extended Order Management functionality, Magento is still being the powerful CMS.

Product management

Using Magento you can easily create products, inventory and multiple images to the products. Also there is an option for importing and exporting the products using CSV files. Magento comes with five different types of the products like configurable, bundled, grouped, simple, downloadable and virtual. It also provides easy way of adding and maintains the products stock and status. Users can able to give their reviews and rating for every product that you can able to accept or delete that reviews from the admin panel which was added advantage of Magento.

Security and Payment Option

Magento CMS is very secure and provides you the bulletproof for your ecommerce website. By default Magento comes with the built-in security features. Your customers can able to buy from your magento website safely and easily. Magento supports quite a lot of payment gateways that you can able to set it up for your website. It comes with PayPal, authorize.net, cash payment or Money order, Cash on delivery, Money bookers etc. if you need to set it up different payment gateway, the payment provider will give you magento plug-in which you can integrate easily in your website.

We develop new unique and dynamic themes for Magento, Customized themes, Maintenance and refurbishing the existing website with new Magento Website Development applications and designing, conversion of the website from different application to Magento, Integrating Shopping Cart functionalities for ecommerce website with the payment gateways CCavenue, EBS, PayPal, 2checkout, Innovate etc…..

To know more about us, please feel free to contact us.

Wednesday, April 1, 2015

Hire Magento Developers

We are an experienced Magento Website Development Company with strong web development team of highly talented Magento Certified Developers. We mainly focus on the customers experience and requirements as we believe that these both will give us more ecommerce website to build. We have an exact vision about your requirements and will give you the best Magento Website Design and Development for your website in affordable price.

Listed below some our expertise in Magento Website Design and Development

1. Magento Themes Development
2. Magento Extension Development
3. Responsive and Mobile Designs and Development
4. Custom Magento Development
5. Third Party Integration 
6. Modifying the existing extensions
7. Refurbishing the existing Magento website
8. Converting existing websites to new Magento Website
9. Catalog Management
10. Order Management 
11. Importing / exporting Products and customers
12. Multiple Shipping rate customization and integration, etc…

Our Magento Resource and Development team of technocrats will accurately blend your requirements with creative and innovative website designs and development. We as an Ecommerce Website Development company mainly aimed at our customer’s satisfaction.