Dec 6 2009

Eclipse + ZendStudio + ZendServer + Android SDK = Awesome IDE

zend android Eclipse + ZendStudio + ZendServer + Android SDK = Awesome IDE

Recently installed the Zend Studio for Eclipse and took it upon myself to get Android Development setup as well.  I also found Magento works best with ZendServer, although it does require a few work arounds to get Magento to work with ZendServer.

However with that being said I’m pretty much happy to have one IDE that I can do both Web Development, and Android Development in one IDE!

Now if only I can setup C# development, and Eclipse not be such a resource/memory hog.

ZendServer Community Edition
:arrow: http://www.zend.com/en/products/server-ce/index

Zend Studio for Eclipse
:arrow: http://www.zend.com/community/pdt

Installing Android SDK
:arrow: http://developer.android.com/sdk/installing.html

Setting up Android SDK in Eclipse
:arrow: http://developer.android.com/sdk/eclipse-adt.html

If anyone desires I can write up a more detailed step by step guide, however at this point I think its pretty easy to figure out, with the links I provided. :mrgreen:

Possibly Related Posts:



Oct 20 2009

Magento: Phoning home to Big Brother/Varien?

It appears some have claimed there Magento installation has been making calls back to IP’s owned by Varien/Magento, The thread is initially a year old, and more recent discussions have claimed they haven’t found anything of such nature.  I know X-Cart used to use a javascript blank 1×1 gif image to track installations of X-Cart but it was only on the backend/admin side, and not the front end.  Has anyone else run into similar instances?  Also this may not pertain to 3rd party modules installed as that may a whole other can of worms you could be opening up your store up to, most modules are free, but nothing is really free in this world. 8O  Here is the original thread: Magento Phone Home?

Possibly Related Posts:



Oct 15 2009

Magento: Display a product image within Static Pages and Blocks

In this particular instance I needed to add product thumbnails for reference on a front page.

First create a new .phtml file with the following under catalog/product/view/your_new_page.phtml

1
2
3
4
5
<?php
$productId = $this->getProduct_id(); 
$_product = Mage::getModel('catalog/product')->load($productId); //load the product
?>
<img src="<? echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(75, 75); ?>" alt="<?php echo $this->htmlEscape($_product['name']); ?>" border="0" width="75" />

Now simply add the following to your CMS Page or Block and adjust the product ID to the product Image you wish to view:

1
{{block type="catalog/product_new" product_id="1" template="catalog/product/view/your_new_page.phtml"}}

Possibly Related Posts:



Oct 8 2009

Selecting 30 days or older entries using MySQL DateTime field

I’ve been doing quite a bit of Date and Time manipulations lately, and have grown to enjoy MySQL’s DateTime fields just as much as UNIX timestamps. Particularly its built-in functions for selecting any range of fields based on a time frame.

Needing to remove all entries from a table that are older than 30 days, at first I thought I would need to iterate over the very large table (90+k) rows of data and convert each MySQL DateTime field to a UNIX time stamp to do the calculations myself with PHP. However after a bit of research I’ve learned of a few things with MySQL DateTime that make this a lot easier.

1
SELECT fields FROM table WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) >= timestamp;

The “timestamp” field is the MySQL DateTime field. Using the DATE_SUB, CURDATE and INTERVAL one can easily grab all records that are 30 days old without the headache of converting to UNIX timestamps in PHP and doing the grunt work yourself.

:idea: Also as a side note, if you wish to convert a MySQL DateTime field to a UNIX timestamp you can easily do this by:

1
$mysql_timestamp = gmdate("Y-m-d H:i:s",$mysql_timestamp_value);

If anyone has any better more efficient means to accomplish this please feel free to leave a comment. :D

Possibly Related Posts:



Oct 8 2009

Magento: CMS Blocks in Static Pages

Just to follow up on my post: Magento: CMS Blocks in Templates, here is how you can call a CMS Block within a Static Page:

1
{{block type="cms/block" block_id="your_block_id_here" template="cms/content.phtml"}}

Happy Magento’ing! :mrgreen:

Possibly Related Posts:



Sep 27 2009

X-Cart creators release Gears based Ecwid E-Commerce Widgets in Beta

ecwid logo X Cart creators release Gears based Ecwid E Commerce Widgets in BetaIt appears the people behind X-Cart (qualiteam) have just released a beta version of their hosted AJAX/Gears based E-Commerce package. The package is free however it is a hosted solution with Amazon’s cloud hosting or EC2 web service for data storage.  Some of the cooler features is the Drag and Drop functionality for items to your basket.  Mobile version with static HTML Catalog for SEO purposes as well.  It is widget based so it can easily be dropped into any CMS system.

The biggest downside it seems to such a solution is there is no means currently to have a custom solution, via API or through Qualiteam themselves.  The Cart is visually customizable via CSS within the admin but I’m guessing it won’t be very “in depth”.  Also there is no manual.

On the plus to all these items though is it is FREE :)

:arrow: Ecwid: E-Commerce Widgets.

Possibly Related Posts:



Jul 30 2009

X-Cart Marketplace for X-Cart community

xcart logo X Cart Marketplace for X Cart community

Appears X-Cart is finally picking up where everyone else has been with 3rd party contributors for years.  Wordpress what?, MagentoConnect what?  Ever since I had developed some aftermarket products for X-Cart, Qualiteam pretty much frowned on the whole concept of anyone else besides themselves benefitting from custom solutions to their existing software.  However, I still see they require you be a special member in order to list your products in their market, unlike many others who will allow you to list them for free without much governing.

X-Cart can be a great ecommerce cart, don’t get me wrong but, there really isn’t much framework in it to allow for addons or modifications that can easily hookup into existing code without causing major headaches down the road once it is time to upgrade the base code.  This was the biggest reason I switched from X-Cart to MagentoCommerce.

Possibly Related Posts:



Apr 15 2009

Magento version 1.3.1 imminent

It appears Varien is has completed the list of items in the 1.3.1 branch.  Which includes fixes for the previous bugs I had previously posted about.  I’ve tried pulling down the alpha version with CVS to get a sneak peak at the upcoming changes but haven’t been successful, as March 30th seems to be the last commit change for 1.3.0.  There hasn’t been any news about when this release will be available publicly in a “official” form.  

A lot of users whom tried my fix for the add to cart issue with options reported getting an error such as getSKU() was undefined. This is in the list of items to be fixed in 1.3.1.

:!: Anyone who applied my “jerry rigged” fix, please remember to uncomment the line mentioned in the article BEFORE attempting to upgrade.

I have also been fighting with Magento and Google base always returning “Expected response code 200, got 404″, although it appears to be on a Google API change that has caused the issue, and I’m hoping 1.3.1 will have this issue fixed for me as well.

I will post up my findings once I’m able to get my hands dirty with the changes in 1.3.1.

:arrow: Magento – Roadmap – eCommerce Software for Growth.

Possibly Related Posts:



Apr 3 2009

RSS Feeds in Magento & Custom Admin Themes from Inchoo

Inchoo.net has been quite busy with Magento it seems, Tomislav Bilic wrote a how to get your Wordpress, Joomla, etc. RSS Feeds into Magento with a bit of simple code and no outside libraries, just Zend’s framework to parse and display any RSS feed. I’ve seen quite a few requests for such a feature.

:arrow: Latest News RSS box in Magento using Zend_Feed_Rss | Inchoo.

Ivan Weiler of Inchoo also posted up a really simple but handy Magento Module to allow for custom admin theme, the same way frontend works!

:arrow:  Magento Admin Custom Theme.

So far Inchoo.net’s been one of my favorite 3rd party Magento sites to keep an eye on! :D

Possibly Related Posts:



Mar 7 2009

Export X-Cart Products for Magento

xcart to mag Export X Cart Products for Magento

Something I have been wanting to do for awhile is attempt at writing a Magento X-Cart import module. Since I’m no where near getting such completed, and was needing to get a clients old X-Cart version 3.5.X product data imported into Magento 1.2.x, I decided to do it the old fashioned way. Export the X-Cart data into an Excel document and map the exported data. Since I had no idea what fields Magento would require for the import. I simply exported my existing Magento products I had added manually. If you don’t have any simply create a single test product and then proceed to export from Magento.

Please keep in mind this is a very basic import, as Product Options and Categories from X-Cart are ignored. I’m open to any ideas and/or thoughts to achieve this, so please feel free to add any comments.

Here is the SQL Query that I have used to grab the basic essential data out of X-Cart:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SELECT
xcart_products.productid,
xcart_products.productcode,
xcart_products.product,
xcart_products.brand,
xcart_products.model,
xcart_products.weight,
xcart_products.categoryid,
xcart_products.list_price,
xcart_products.descr,
xcart_products.fulldescr,
xcart_products.param00,
xcart_products.param01,
xcart_products.param02,
xcart_products.param03,
xcart_products.`type`,
xcart_pricing.productid,
xcart_pricing.quantity,
xcart_pricing.price,
xcart_thumbnails.image_path,
xcart_images.image_path,
xcart_images.image_x,
xcart_images.image_y,
xcart_images.image_size,
xcart_images.alt,
xcart_pricing.membership,
xcart_categories.category
FROM
xcart_products
Left Join xcart_pricing ON xcart_products.productid = xcart_pricing.productid
Left Join xcart_thumbnails ON xcart_products.productid = xcart_thumbnails.productid
Left Join xcart_images ON xcart_products.productid = xcart_images.productid
Left Join xcart_categories ON xcart_categories.categoryid = xcart_products.categoryid
GROUP BY xcart_products.productid

xcart-import-diagram-schema   

One Remote MySQL Manager I found very useful for alot of this was “NaviCat“, the free version doesn’t support export/importing however they do offer a 30 day trial with all the bells and whistles.

As you can tell I am only exporting xcart_products, xcart_pricing, xcart_thumbnails, xcart_images and xcart_categories. However I did not use xcart_categories when mapping my data in Excel, I merely wanted to export it so it was easier to determine products while in Excel.

When exporting with NaviCat I noticed two Excel options, both seem to yield the same results, however I noticed with one of the options long descriptions over 255 characters were being truncated, here is the option to use for best results I’ve found:
export option

A few things to take note while mapping and/or copying your X-Cart exported data to your Magento exported data is:

  • You will need to remove the full path that X-Cart uses in its image tables, i.e. /home/mysite/public_html/
  • Keep a front slash ‘/’ in front of your image filename’s.
  • Copy all of your X-Cart product’s Images via FTP or however you choose. And upload them to /media/import/
  • Keep existing data in the fields of the Magento products export the same. The most note-able are: store, attribute_set and type.
  • You may have some custom data from X-Cart that can be utilized, per say if you were using param00 for a cost field, you can easily map this field into Magento’s custom attributes you can create to be able to port this information over. You can find custom attributes under “Catalog”->”Attributes”->”Manage Attributes” within the Admin.
  • Export as a “Comma Separated Values” (CSV) file. I opened this file up in notepad after exporting and re-saved just to ensure line-breaks and odd characters aren’t miss-interrupted.

All of Magento’s export and import functionality can be found under “System”->”Import/Export”->”Profiles”.

I created a new profile entitled “X-Cart Import” and used the following settings:
xcart-import-magento-profile-settings

Here is the XML profile for my X-Cart import profile as well:

1
2
3
4
5
6
7
8
    <var><![CDATA[,]]></var>
    <var name="enclose"><![CDATA["]]></var>
    <var name="fieldnames">true</var>
    <var name="store"><![CDATA[0]]></var>
    <var name="number_of_records">1</var>
    <var name="decimal_separator"><![CDATA[.]]></var>
    <var>catalog/convert_adapter_product</var>
    <var>parse</var>

One Idea I didn’t realize during my first initial import was the import process at least on a low-end server can take hours to complete, so you may want to take a small portion of your spreadsheet, export to CSV and do a small amount of data to ensure you have all of your data properly laid out. I made this mistake and am now in the process of re-importing all 2000+ products after doing a small amount to ensure things are in order.

If at anytime you want to wipe all of your products and start from no products, run this query in NaviCat or PHPMyAdmin:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
TRUNCATE TABLE `catalog_product_entity_text`;
TRUNCATE TABLE `catalog_product_entity_tier_price`;
TRUNCATE TABLE `catalog_product_entity_varchar`;
TRUNCATE TABLE `catalog_product_link`;
TRUNCATE TABLE `catalog_product_link_attribute`;
TRUNCATE TABLE `catalog_product_link_attribute_decimal`;
TRUNCATE TABLE `catalog_product_link_attribute_int`;
TRUNCATE TABLE `catalog_product_link_attribute_varchar`;
TRUNCATE TABLE `catalog_product_link_type`;
TRUNCATE TABLE `catalog_product_option`;
TRUNCATE TABLE `catalog_product_option_price`;
TRUNCATE TABLE `catalog_product_option_title`;
TRUNCATE TABLE `catalog_product_option_type_price`;
TRUNCATE TABLE `catalog_product_option_type_title`;
TRUNCATE TABLE `catalog_product_option_type_value`;
TRUNCATE TABLE `catalog_product_super_attribute`;
TRUNCATE TABLE `catalog_product_super_attribute_label`;
TRUNCATE TABLE `catalog_product_super_attribute_pricing`;
TRUNCATE TABLE `catalog_product_super_link`;
TRUNCATE TABLE `catalog_product_enabled_index`;
TRUNCATE TABLE `catalog_product_website`;
TRUNCATE TABLE `catalog_product_entity`;
 
TRUNCATE TABLE `cataloginventory_stock`;
TRUNCATE TABLE `cataloginventory_stock_item`;
TRUNCATE TABLE `cataloginventory_stock_status`;
 
insert  into `catalog_product_link_type`(`link_type_id`,`code`) values (1,'relation'),(2,'bundle'),(3,'super'),(4,'up_sell'),(5,'cross_sell');
insert  into `catalog_product_link_attribute`(`product_link_attribute_id`,`link_type_id`,`product_link_attribute_code`,`data_type`) values (1,2,'qty','decimal'),(2,1,'position','int'),(3,4,'position','int'),(4,5,'position','int'),(6,1,'qty','decimal'),(7,3,'position','int'),(8,3,'qty','decimal');
insert  into `cataloginventory_stock`(`stock_id`,`stock_name`) values (1,'Default');

(thanks to Mike Smullin on the Magento Forums for this query!)

Whats planned? I am also going to be attempting to apply the same method for importing X-Cart customer data into Magento. As well as making product options and categories importable as well.

There is a good thread on importing product’s in Magento’s community discussing this topic as well.

Possibly Related Posts: