adding URL parameters

Posted by ray | Posted in cheat codes | Posted on August 4th 2009

0

product id example:

  • $this->getUrl(’[any valid url]‘, array(’id’=>$_product->getId()));

then retrieve it:

  • $productId = $this->getRequest()->getParam(’id’);
Share and Enjoy:
  • Print this article!
  • E-mail this story to a friend!
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • StumbleUpon
  • Technorati

use secure URLs in Magento

Posted by ray | Posted in cheat codes | Posted on August 4th 2009

0

  • $this->getUrl(’checkout/onepage’, array(’_secure’=>true));

‘checkout/onepage’ can be any valid URL on your site…

Share and Enjoy:
  • Print this article!
  • E-mail this story to a friend!
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • StumbleUpon
  • Technorati

get the name of a products attribute set

Posted by ray | Posted in cheat codes | Posted on August 4th 2009

0

$_product = $this->getProduct();

$setId = $_product->getAttributeSetId();
$set = Mage::getModel(’eav/entity_attribute_set’)->load($setId);
$setName = $set->getAttributeSetName();

Share and Enjoy:
  • Print this article!
  • E-mail this story to a friend!
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • StumbleUpon
  • Technorati

get URLs

Posted by ray | Posted in cheat codes | Posted on August 3rd 2009

0

Mage::app()->getStore()->getBaseUrl();

$this->getUrl(’customer/account/login’);

Share and Enjoy:
  • Print this article!
  • E-mail this story to a friend!
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • StumbleUpon
  • Technorati

Get current user and attributes

Posted by ray | Posted in cheat codes | Posted on August 3rd 2009

0

  • $customer = Mage::getModel(’customer/customer’);
  • $customer->load(Mage::getSingleton(’customer/session’)->getCustomerId());
  • $arr = $customer->getAttributes();
Share and Enjoy:
  • Print this article!
  • E-mail this story to a friend!
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • StumbleUpon
  • Technorati