I have a string like a,b,c,d,e, I would like to remove last ',' and get the remaining string back OUTPUT: a,b,c,d,e Here is what i did echo rtrim("a,b,c,d,e,", ",") Hope it helps ^^
Search the Wiki
Magento – ADDATTRIBUTETOFILTER CONDITIONALS
addAttributeToFilter is a method that can be called on EAV collections in Magento. This includes product collections, category collections, customer collections and many more. In short, it adds a condition to the WHERE part of the MySQL query used to extract a collection from the database, therefore allowing you to filter the collection by custom Full Article…
Magento – Functions cheatsheet
General functions Function Description $this->getRequest()->getServer(‘HTTP_REFERER’); Get the referer URL Product related functions Function Description $product->getName() Get product name $product->getSku() Get product sku Mage::getModel(‘cataloginventory/stock_item’)->loadByProduct($_product)->getQty() Get product stock $product->getResource()->getAttribute(‘color’)->getFrontend()->getValue($product) Get a product attribute value (like color/size) $product->isSaleable() checks if a product is salable $product->isisAvailable() checks if a product type is salable Mage::getModel(‘catalogrule/rule’)->calcProductPriceRule($product,$product->getPrice()) Gets the product final price Full Article…
Magento – Set the default direction or ordering for category-pages
On Magento category-pages you can select how to view the available products: By price, name or relevance, and ascending or descending. Within the Magento backend, the default ordering (price, name or relevance) can be configured but strangely enough the default direction (ascending or descending) not. Here is a XML layout update that allows you to Full Article…
Ubuntu – Assign static name for partitions
If you are running Linux system and you have an additional disk in your computer, you can see that the partion name will change after you reboot your operating system. That's issue is not good for users who want to have a static link of those partitions. Here is the solution to resolve your problem. Full Article…
Linux – 10 Screen Command Examples to Manage Linux Terminals
Screen is a full-screen software program that can be used to multiplexes a physical console between several processes (typically interactive shells). It offers a user to open several separate terminal instances inside a one single terminal window manager. The screen application is very useful, if you are dealing with multiple programs from a command line interface Full Article…
Magento – List of Shopping Cart Price Rule Tables
Here is the table list of Shopping Cart Price Rule. 1. salesrule Create rule info will get it from here. 2. salesrule_coupon Coupon info will get here 3. salesrule_coupon_usage How many time used this coupon by customer ID 4. salesrule_customer 5. salesrule_customer_group Rule mapped to which customer groups 6. salesrule_label 7. salesrule_product_attribute attribute based rule Full Article…
Css – Meaning of numbers in col-md-4 , col-xs-1 , col-lg-2 in bootstrap
Meaning of numbers in col-md-4 , col-xs-1 , col-lg-2 in bootstrap Here's an attempt at a simple explanation: Ignoring the letters (xs, sm, md, lg) for now, I'll start with just the numbers… the numbers (1-12) represent a portion of the total width of any div all divs are divided into 12 columns so, col-*-6 spans 6 of 12 Full Article…
Mysql – Too many connections
If you see the error "… To many connections…" while you are accessing your website, you can do the following ways: 1. In your mysql my must to run this: Set Global max_connections=2000 I'm using phpMyAdmin and I executed 2. In your my.conf file (usually located in /etc) find the line that says: [mysqld] And somewhere Full Article…
SEO – How To Use H1-H6 HTML Elements Properly
The six heading elements, H1 through H6, denote section headings. Although the order and occurrence of headings is not constrained by the HTML DTD, documents should not skip levels (for example, from H1 to H3), as converting such documents to other representations is often problematic. W3C However, you do not need to use all six HTML elements to structure Full Article…