Magneto Module Explore for Android App 1

http://192.168.1.84/p/m/ki
http://192.168.1.84/p/m/ki/index.php/csv/index/test
http://www.magentocommerce.com/magento-connect/erp-in-cloud-order-inventory-catalog-management-1.html
ERP-in-Cloud: Order, Inventory & Catalog management
http://www.magentocommerce.com/magento-connect/product-locator.html
Product Locator
http://www.magentocommerce.com/magento-connect/full-catalog-translate.html
Full catalog translate
http://www.magentocommerce.com/magento-connect/cloudgento-api-extension.html
CloudGento API Extension
http://www.magentocommerce.com/magento-connect/apiautoapplyrules-1.html
ApiAutoApplyRules
http://www.magentocommerce.com/magento-connect/mobile-pos-inventory-barcode-scanning-photos-and-more-on-android.html
Mobile PoS, Inventory, Barcode Scanning, Photos and more on Android
http://www.magentocommerce.com/magento-connect/infobip-storesms-2.html
Infobip StoreSMS
http://www.magentocommerce.com/magento-connect/developer-manual.html
Developer Manual
http://www.magentocommerce.com/magento-connect/shopdash-super-slick-shopping-app-for-the-iphone-ipad-and-android.html
ShopDash – Super Slick Shopping App for the iPhone, iPad and Android
http://www.magentocommerce.com/magento-connect/appy-pie-mobile-app-connect.html
Appy Pie Mobile App Connect
http://www.magentocommerce.com/magento-connect/mage-sms-sms-notification-sms-marketing-1.html
MAGE SMS – SMS notification & SMS marketing

Advertisements

SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

http://www.magentocommerce.com/boards/viewthread/136/

 

Support for non standard port or unix socket will be available in next release.

Meanwhile you can replace these 2 files:
Mysql.php: lib/Varien/Db/Adapter/Pdo/Mysql.php
Mysqli.php: lib/Varien/Db/Adapter/Mysqli.php

Specify non-standard port like this:

localhost:3307

For unix socket use only the path in DB host field during install:

/tmp/mysql5.sock

You can also try changing the driver Magento will access mysql in app/etc/config.xml:

<type>mysqli</type>

There are driver types under <core_setup> (used during install/upgrade) and <core_write> (used during normal operation). Possible values are mysqli and pdo_mysql

 

File Attachments
Mysql.php  (File Size: 5KB – Downloads: 907)
Mysqli.php  (File Size: 5KB – Downloads: 569)

Magento – Configurable products not visible until manually saved in admin panel

Solved this by going through the saveAction in the ProductController.

I wasnt setting the websiteIds correctly so the new products were never getting added to the site correctly.

Magento uses this method to get the currect website:

->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()))

 

protected function checkFile(){
// echo ‘ check file ‘.$this->file_name;
$media_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
$store_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
$file_path = $media_url.’csv/’.$this->file_name.’.csv’;
// $file_path = $media_url.’csv/’.$this->file_name.’.txt’;
// $file_path = ‘/media/csv/’.$this->file_name.’.txt’;
// echo ‘ check file ‘.$file_path.’ ‘.$store_url;
$this->fileFunc($file_path,$store_url);
// $this->resave();

}
protected function fileFunc($file,$lib){
//define(‘MAGENTO_MAGE_LOCATION’,$lib.’app/Mage.php’);
//error_reporting(E_ALL);
if($handle = fopen($file, “r”)){
$count=0; $mediaAttribute = array(‘thumbnail’,’small_image’,’image’);
$imgUrl = ‘media/catalog/product/’;
// $imgUrl = ‘media/csv/img/’;
while (($data = fgetcsv($handle)) !== FALSE)
{
$count++;
// print_r($data); echo ‘<br />’;
// $cat = Mage::getResourceModel(‘catalog/category_collection’)->addFieldToFilter(‘name’, $data[0]);
// $catId = $cat->getFirstItem()->getEntityId();
// echo $catId.'<hr><br />’;
// echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).’csv/i/’.$data[17].'<br /><hr><br />’;
// print_r($data);echo ‘<hr><br />’;
// /*
if($count > 1)
{
$cat = Mage::getResourceModel(‘catalog/category_collection’)->addFieldToFilter(‘name’, $data[0]);
$catId = $cat->getFirstItem()->getEntityId();

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$product = Mage::getModel(‘catalog/product’);

try{
$store_id = Mage::app()->getStore()->getStoreId();
$store_website_id = Mage::app()->getStore()->getWebsiteId();
$product
->setStoreId($store_id)
// ->setWebsiteId($store_website_id)
->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()))
// ->setWebsiteIds(array(1))
->setAttributeSetId(64)
->setTypeId(‘simple’)
->setCreatedAt(strtotime(‘now’))
->setSku($data[1])
->setName($data[2])
->setWeight($data[3])
->setStatus(1)
->setTaxClassId(2)
// ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
->setVisibility(4)
->setPrice($data[5])
->setCost($data[6])
->setSpecialPrice($data[7])
->setSpecialFromDate($data[8])
->setSpecialToDate($data[9])
->setMetaTitle($data[10])
->setMetaKeyword($data[11])
->setMetaDescription($data[12])
->setDescription($data[13])
->setShortDescription($data[14])
// ->addImageToMediaGallery(‘media/catalog/product/demo.jpg’, array(‘image’,’thumbnail’,’small_image’), false, false)
// ->addImageToMediaGallery($imgUrl.’demo.jpg’, array(‘image’,’thumbnail’,’small_image’), false, false)
->addImageToMediaGallery($imgUrl.$data[15], array(‘image’,’thumbnail’,’small_image’), false, false)
// ->addImageToMediaGallery($data[15], array(‘image’,’thumbnail’,’small_image’), false, false) //assigning image, thumb and small image to media gallery
// ->addImageToMediaGallery( $imgUrl , $mediaAttribute, false, false )
->setStockData(
array(
‘use_config_manage_stock’ => 0, //’Use config settings’ checkbox
‘manage_stock’=>$data[16], //manage stock
‘min_sale_qty’=>$data[17], //Minimum Qty Allowed in Shopping Cart
‘max_sale_qty’=>$data[18], //Maximum Qty Allowed in Shopping Cart
‘is_in_stock’ => $data[19], //Stock Availability
‘qty’ => $data[20] //qty
)
)
->setCountryOfManufacture(‘AF’)
->setNewsFromDate(’06/26/2014′)
->setNewsToDate(’06/26/2019′)
->setSize($data[21])->setColor($data[4])->setCategoryIds(array($catId));
//
if(!is_null($data[22])){$product->addImageToMediaGallery( $imgUrl.$data[22] , null, false, false );}
if(!is_null($data[23])){$product->addImageToMediaGallery( $imgUrl.$data[23], null, false, false );}
if(!is_null($data[24])){$product->addImageToMediaGallery( $imgUrl.$data[24] , null, false, false );}
$product->save();

echo ‘save success’.'<hr><br />’;

}catch(Exception $e){
Mage::log($e->getMessage());
echo ‘while saving product ‘.$this->errorFunc();
}
}//if statement ends here

// */

}// end of while loop
fclose($handle);
}else{
echo ‘<br />not yet<br />’;
$this->errorFunc();
}
}

Magento deleting product BIGINT UNSIGNED value is out of range

Several of our clients get an unusual recurring error in their Magento stores looking like:

SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '(`magento_store`.`q`.`items_count` - 1)'

Option 1

DELETE FROM magento_sales_flat_quote WHERE updated_at < DATE_SUB(Now(),INTERVAL 30 DAY);

Option 2

DELETE FROM magento_sales_flat_quote WHERE customer_is_guest = 0;

Option 3

SET FOREIGN_KEY_CHECKS=0;
#truncate magento_enterprise_customer_sales_flat_quote;
#truncate magento_enterprise_customer_sales_flat_quote_address;
truncate magento_sales_flat_quote;
truncate magento_sales_flat_quote_item;
truncate magento_sales_flat_quote_address;
truncate magento_sales_flat_quote_shipping_rate;
SET FOREIGN_KEY_CHECKS=1;



http://www.pkdavies.co.uk/162-magento-deleting-product-bigint-unsigned-value-is-out-of-range.html

Magento Developer Knowledge Links

Magento for Developers
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-1-introduction-to-magento

Magento API
http://www.magentocommerce.com/api/soap/introduction.html

Magento Documentation (phpdoc) Varien Lib Documentation
http://docs.magentocommerce.com/

Others
https://www.yireo.com/tutorials/magento/magento-programming/629-connecting-to-magento-with-soap-part-1
http://stackoverflow.com/questions/8569275/magento-retrieve-highest-product-price-in-current-collection-from-layered-nav

http://www.webdosh.net/2011/04/magento-get-skin-url-get-media-url-get.html