How to Sort product list by custom attribute in Magento?
-
zendnwar
-
April 3, 2013
-
Magento
-
0 Comments
Please open \app\design\frontend\default\<your theme name>\template\catalog\product\ toolbar.phtml Line number may be 63. just replace with below code : <fieldset> <?php //$this->_availableOrder = array(‘name’=>__(‘Alphabetical’), ‘price’=>__(‘Price’)); ?> <label><?php echo $this->__(‘Sort by’) ?></label> <select onchange=”setLocation(this.value)”> <option value=”<?php echo $this->getOrderUrl(‘featured’, ‘asc’) ?>”<?php if($this->isOrderCurrent(‘featured’) && $this->getCurrentDirection() == ‘asc’): ?> selected=”selected”<?php endif; ?>>Featured </option> <option value=”<?php echo $this->getOrderUrl(‘sku’, ‘asc’) ?>”<?php if($this->isOrderCurrent(‘sku’) && $this->getCurrentDirection() == ‘asc’): ?> selected=”selected”<?php …
Continue Reading
How to get url in Magento?
-
zendnwar
-
March 28, 2013
-
Magento
-
232 Comments
Get Base Url : Mage::getBaseUrl(); Get Skin Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); (i) Unsecure Skin Url : $this->getSkinUrl(‘images/imagename.jpg’); (ii) Secure Skin Url : $this->getSkinUrl(‘images/imagename.gif’, array(‘_secure’=>true)); Get Media Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); Get Js Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); Get Store Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); Get Current Url Mage::helper(‘core/url’)->getCurrentUrl(); Get Url in cms pages or static blocks Get Base Url : {{store url=””}} Get Skin Url : …
Continue Reading
What is OOP( object-oriented programming)?
-
zendnwar
-
March 22, 2013
-
Advanced PHP(OOP)
-
0 Comments
OOP is a programming paradigm that uses abstraction to create models based on the real world. It provides for better modeling of the real world by providing a much needed improvement in domain analysis and then integration with system design. The power of object-oriented systems lies in their promise of code reuse which will increase productivity, reduce costs and improve …
Continue Reading
How to copy a file from one directory to another using PHP?
-
zendnwar
-
March 18, 2013
-
PHP Basic
-
0 Comments
This should be pretty easy. You want to copy & rename images that already exist on the server while still retaining the original image. Here’s the original image location: images/ folder/ your_image_name.jpg This is what I want: images/ folder/ your_image_name.jpg your_image_new_name.jpg <?php $file = ‘images/folder/your_image_name.jpg’; $newfile = ‘Images/folder/your_image_new_name.jpg’; if (!copy($file, $newfile)) { echo “failed to copy”; } Hope it will …
Continue Reading
How to decrease database size in Magento?
-
zendnwar
-
February 20, 2013
-
Magento
-
0 Comments
To decrease database size you take below action. It will not effect your database. You can say this is unwanted data. TRUNCATE dataflow_batch_export; TRUNCATE dataflow_batch_import; TRUNCATE log_customer; TRUNCATE log_quote; TRUNCATE log_summary; TRUNCATE log_summary_type; TRUNCATE log_url; TRUNCATE log_url_info; TRUNCATE log_visitor; TRUNCATE log_visitor_info; TRUNCATE log_visitor_online; TRUNCATE report_viewed_product_index; TRUNCATE report_compared_product_index; TRUNCATE report_event; TRUNCATE index_event; TRUNCATE catalog_compare_item; TRUNCATE catalogindex_aggregation; TRUNCATE catalogindex_aggregation_tag; TRUNCATE catalogindex_aggregation_to_tag; Hope …
Continue Reading
How to edit, “Thank you for registering with Default Store View” in Magento?
-
zendnwar
-
February 11, 2013
-
Magento
-
2 Comments
This is very simple. Please follow the step Goto System > Manage Stores > Default Store View. Just edit the NAME field default “main store” and make it, whatever you need. Thats all. Hope it will work.
Continue Reading
How to increase Session Timeout in cakePHP?
-
zendnwar
-
February 1, 2013
-
Cakephp
-
0 Comments
Please follow at the following code. APP -> config-> core.php /** * Session time out time (in seconds). * Actual value depends on ‘Security.level’ setting. */ Configure::write(‘Session.timeout’, ‘3600’); //3600 seconds Hope it will work.
Continue Reading
How to Create a custom 404 error page in cakePHP
-
zendnwar
-
February 1, 2013
-
Cakephp
-
201 Comments
If you need to change the page that users see when a document is not found, create: /app/views/errors/error404.thtml Hope it will work.
Continue Reading
How to Speed up Magento?
-
zendnwar
-
January 31, 2013
-
Magento
-
0 Comments
Please check below info to Speed up Magento: Speed up Magento with these simple admin settings. When you’re ready to go live with your Magento store, remember to setup your admin for maximum performance! These are the settings that will significantly speed up your Magento installation: 1. Most users are well aware of this one. Just navigate to System > …
Continue Reading
Deprecated: Function set_magic_quotes_runtime()
-
zendnwar
-
January 31, 2013
-
PHP Basic
-
234 Comments
Open the “include/config.php” find: set_magic_quotes_runtime(0); replace: ini_set(“magic_quotes_runtime”, 0); Hope it will work.
Continue Reading