Delete magento attribute with options and values

$attribute_code = ‘some_attribute_code’; $attribute = Mage::getModel(‘eav/config’)->getAttribute(‘customer_address’,$attribute_code); $options = $attribute->getSource()->getAllOptions(); foreach ($options as $option) { if ($option[‘label’] === ” && $option[‘value’]) { $newOptions[‘value’][$option[‘value’]][] = $option[‘label’]; $newOptions[‘delete’][$option[‘value’]]…

Remove get param from url

protected function removeQsVar($url, $varName) { $parts = parse_url($url); $queryParams = array(); parse_str(html_entity_decode($parts[‘query’]), $queryParams); unset($queryParams[$varName]); $queryString = http_build_query($queryParams); if(strlen($queryString)>0){ $queryString = ‘?’ . $queryString; } $url…

Estimating shipping price for product

$corehelper = Mage::helper(‘core’); $cheapestrate = 0; if($_product->isSaleable()) { $_product = Mage::getModel(‘catalog/product’)->load($_product->getId()); $quote = Mage::getModel(‘sales/quote’); $quote->getShippingAddress()->setCountryId(‘PL’); $addToCartInfo = (array) $_product->getAddToCartInfo(); $request = new Varien_Object($addToCartInfo); if ($_product->getStockItem())…