WordPress Plugins for eCommerce

Wordpress
WP e-Commerce WP e-Commerce shopping cart plugin for WordPress is an elegant easy to use fully featured shopping cart application suitable for selling your products, services, fees online and connects you with your potential customers in a seamless manner. WP e-Commerce works well sites of all shapes and sizes. You can use it so sell actual physical products, digital downloads, or even memberships. WP e-Commerce Plugins Features Import/Export Payment Gateways Integration Search Engine Optimization Internationalization Support(Like multiple currencies) Shipping Checkout Managing Orders Catalog Mangement Link: http://wordpress.org/extend/plugins/wp-e-commerce/ [JWD-Wordpress-Development] eShop eShop is a another good option to make shopping cart in wordpress. The eShop plugin is easy to use and offers a solid all-around e-commerce solution for WordPress sites. You can apply discounts to products to help enhance sales, and there are…
Read More

Magento addAttributeToFilter SQL Conditionals

Magento
If you want to customize query or product collection data you can easily to do that with addAttributeToFilter funcation in magento. In short you can easily customize product collection select query based on your requirement in magento development. [php] <?php $collection = Mage::getModel('catalog/product')->getCollection(); ?> [/php] If you want get all fields then use below condition select [php] <?php $collection->addAttributeToSelect('*'); ?> [/php] If you want to get limited fields then use below condition [php] <?php $collection->addAttributeToSelect(array('name', 'product_url', 'small_image')); ?> [/php] [php] <?php $collection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect(array('name', 'product_url', 'small_image')) ->addAttributeToFilter('sku', array('like' => 'test-product%')) ->load(); ?> [/php] The above code would get a product collection which contain only products that have an SKU starting with "test-product". addAttributeToFilter Conditionals [php] <?php // Is Equal To (eq) $collection->addAttributeToFilter('status', array('eq' => 1)); // Is Not Equal…
Read More

Add Date field with Datepicker in Magento

Magento
Here I want to show you how to add date field with date picker in any of your form like contact, gift message etc in magento frontend design. Magento has a built in library for calendar functionality but its available only on admin so here I show you how to se date field with date picker in magento frontend. Add below css and javascript for calender in your current theme page.xml file. This will include all the calendar library functions frontend on your theme. [sourcecode language="plain"] <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params></params></action> <action method="addItem"><type>js</type><name>calendar/calendar.js</name></action> <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action> <block type="core/html_calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"></block> [/sourcecode] Now add below code in which form where you want to add date field like contact, gift message etc... [php] <div class="field"> <label for="dob"><?php echo Mage::helper('contacts')->__('DOB') ?></label> <div class="input-box"> <input name="dob" id="_dob"…
Read More

Multi Select Drag and Drop Jquery

JQuery
When data is very large and selection using multiselect is difficult so you can use this option multi select drag and drop with jquery. The first holds the options that are available, and the second holds the options that have been selected. Usually, the two boxes are separated by add and remove buttons. You can select an item from the first box, click the add button, and add it to the second box. Likewise, you can select an item from the second box, click the remove button, and it goes back into the unselected box. [sourcecode language="plain"] <table> <tr> <td> <label>All Value</label><br/> <select name="multi_list1" id="select1" multiple="multiple"> <option value="name1">Name 1</option> <option value="name2">Name 2</option> <option value="name3">Name 3</option> <option value="name4">Name 4</option> </select> </td> <td> <a href="#" id="add">&gt;&gt;</a> <br/><br/> <a href="#" id="remove">&lt;&lt;</a> </td> <td>…
Read More

Import And Export Mysql Heavy Database

MySql
Exporting and Importing database through PhpMyadmin is only good if you have small database. But you want to import and export big database then it is not possible. Here I show you script which is easily import and export heavy mysql database. Import big mysql database [php] &amp;lt;?php $mysqlDatabaseName ='MyDBName'; $mysqlUserName ='username'; $mysqlPassword ='yourPassword'; $mysqlHostName ='localhost'; $mysqlImportFilename ='db.sql'; $command='mysql -h' .$mysqlHostName .' -u' .$mysqlUserName .' -p' .$mysqlPassword .' ' .$mysqlDatabaseName .' &amp;lt; ' .$mysqlImportFilename; exec($command,$output=array(),$worked); switch($worked){ case 0: echo 'Import file &amp;lt;b&amp;gt;' .$mysqlImportFilename .'&amp;lt;/b&amp;gt; successfully imported to database &amp;lt;b&amp;gt;' .$mysqlDatabaseName .'&amp;lt;/b&amp;gt;'; break; case 1: echo 'Error during import. Please make sure the import file is saved in the same folder as this script and check your mysql details like username, password, host and database name.'; break; } ?&amp;gt; [/php] Export…
Read More

Magento get items in order

Magento
Here, I can show you how you can get information about all items in your magento shopping cart based on order id. How to get product details from order id or sometimes need to get product it, product sku, product name , category id, category name. So its easy to get product from order item based on order number. [php] <?php require 'app/Mage.php'; Mage::app(); $orderNumber = 100004544; $order = Mage::getModel('sales/order')->loadByIncrementId($orderNumber); // get order total value $orderValue = number_format ($order->getGrandTotal(), 2, '.' , $thousands_sep = ''); // get order item collection $orderItems = $order->getItemsCollection(); foreach ($orderItems as $item){ $product_id = $item->product_id; $product_sku = $item->sku; $product_name = $item->getName(); $_product = Mage::getModel('catalog/product')->load($product_id); $cats = $_product->getCategoryIds(); $category_id = $cats[0]; // just grab the first id $category = Mage::getModel('catalog/category')->load($category_id); $category_name = $category->getName(); echo "orderNumber=".$orderNumber."<br/>"; echo…
Read More

Magento category product count

Magento
Many times we need to show product count per category in magento. So here I am showing to how many products (Product count) in that categories. First of all I get all categories based on category position with ascending order and then get product count for that category. It shows like below example: Laptops (4) Hard Drives (4) Root Catalog (5) Monitors (4) Shirts (19) Shoes (46) Get category and product count in magento [php] <?php $categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('name') ->addAttributeToSelect('url_key') ->addAttributeToSelect('my_attribute') ->addAttributeToSelect('position') ->addAttributeToSort('position', 'ASC') ->setLoadProductCount(true) ->addAttributeToFilter('is_active',array('eq'=>true)) ->load(); ?> <?php foreach($categories as $key=>$category): ?> <?php if($category->getName() != ''):?> <?php $prodCollection = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category); // Magento product collection ?> <a href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?></a> (<?php echo $prodCollection->count() ?>)<br/> <?php endif;?> <?php endforeach; ?> [/php] [JWD-Magento-Development]
Read More

Remove all products,categories,customers,orders from magento

Magento
If you want to delete all products, categories, customers and orders or sample data from magento database using phpmyadmin then this is very help to you. Here I show you how you can delete all products from magento database as well as all categories,customers and orders. Delete all products from magento database Below code to delete all product and their related records from magento database. [sourcecode language="plain"] TRUNCATE TABLE `catalog_product_bundle_option`; TRUNCATE TABLE `catalog_product_bundle_option_value`; TRUNCATE TABLE `catalog_product_bundle_selection`; TRUNCATE TABLE `catalog_product_entity_datetime`; TRUNCATE TABLE `catalog_product_entity_decimal`; TRUNCATE TABLE `catalog_product_entity_gallery`; TRUNCATE TABLE `catalog_product_entity_int`; TRUNCATE TABLE `catalog_product_entity_media_gallery`; TRUNCATE TABLE `catalog_product_entity_media_gallery_value`; TRUNCATE TABLE `catalog_product_entity_text`; TRUNCATE TABLE `catalog_product_entity_tier_price`; TRUNCATE TABLE `catalog_product_entity_varchar`; TRUNCATE TABLE `catalog_product_link`; TRUNCATE TABLE `catalog_product_link_attribute`; TRUNCATE TABLE `catalog_product_link_attribute_decimal`; TRUNCATE TABLE `catalog_product_link_attribute_int`; TRUNCATE TABLE `catalog_product_link_attribute_varchar`; TRUNCATE TABLE `catalog_product_link_type`; TRUNCATE TABLE `catalog_product_option`; TRUNCATE TABLE `catalog_product_option_price`; TRUNCATE TABLE `catalog_product_option_title`;…
Read More

Recursive Delete Function

PHP
Sometimes we need to delete any particular directory or all files and sub directory in one specific directory. People who have computer repair training may need to do this from time to time. The following function is useful if you wish to clear out all files and folders in one particular directory. [php] <?php function DELETE_RECURSIVE_DIRS($dirname) { // recursive function to delete // all subdirectories and contents: if(is_dir($dirname))$dir_handle=opendir($dirname); while($file=readdir($dir_handle)) { if($file!="." && $file!="..") { if(!is_dir($dirname."/".$file))unlink ($dirname."/".$file); else DELETE_RECURSIVE_DIRS($dirname."/".$file); } } closedir($dir_handle); rmdir($dirname); return true; } ?> [/php] [JWD-Web-Development]
Read More

How to add SSL certificate magento

Magento
Here I can show how to install SSL certificate in Magento. Before we go to Magento SSL certificate this important to know all what is SSL and why we need this. What is SSL? SSL is an acronym for Secure Sockets Layer, an encryption technology that was created by Netscape. SSL creates an encrypted connection between your web server and your visitors' web browser allowing for private information to be transmitted without the problems of eavesdropping, data tampering, or message forgery. Once you have done the SSL install, you can access a site securely by changing the URL from http:// to https://. When an SSL certificate is installed on a website, you can be sure that the information you enter (credit card or any other information), is secured and only…
Read More