Friday, February 10, 2012

Magento Cron

http://inchoo.net/ecommerce/magento/creating-cron-script-in-magento/

http://fishpig.co.uk/magento-tutorials/magento-cron-jobs

Thursday, February 9, 2012

Magento : Get product Collection

The following shows how to filter by a range of values (greater than AND less than)
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('name');      
$collection->addAttributeToSelect('orig_price');        
//filter for products whose orig_price is greater than (gt) 100
$collection->addFieldToFilter(array(
        array('attribute'=>'orig_price','gt'=>'100'),
));     
//AND filter for products whose orig_price is greater than (lt) 130
$collection->addFieldToFilter(array(
        array('attribute'=>'orig_price','lt'=>'130'),
));

Tuesday, February 7, 2012

Magento making company field required

Question : when registering a new client, I want to make the field "company" required.
Which file should I edit?

Answer: You should as well add it in your attribute on the server side. If you're using Magento entreprise edition, you can simply edit the company attribute through back end, and set it to "required". If you're working with a community edition, you'll have to manually change this value with SQL. It's in eav_attribute table, the attribute_code is "company" and you just as to set "is_required" to 1.

Configuring PayPal Auto-Return (Redirect) After Payment

Configuring PayPal Auto-Return (Redirect) After Payment

If you are trying to set up a redirect or auto-return after accepting a PayPal payment for a product or service that is purchased on your website, try this:
1) login to paypal
2) click “edit profile) next to your name / email address

3) click “website payment preferences” under “selling preferences”


4) click “on” for “auto-return”

5) you must enter a return URL, even if you have separate ones for various products and/or payments from various sites that may take precedence over this one.
6) click save

Note #5.  That’s what threw us off.  We didn’t think to have one “return URL” for the overall account, b/c we have several different sites that all send payments to one PayPal email address, and in each case we use a custom return URL that we pass to PayPal from the site as part of the IPN posting (or whatever… I’m not a developer).  Anyhow, if this works for you when you find this post months from now, please post a comment and let me know!