Magento Forum

   
Page 1 of 4
Shopping.com data feed module
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

Hi everyone,
I hope you find this as useful as I do.  The attached file needs to go in the root of your Magento folder, and you need to have an “export” folder with 777 permissions. Feel free to edit the script/improve as necessary.

A few important notes:  test on a non-production server first!  Use at your own risk.  Script is provided as-is, but I will try to help if you have issues.

Feel free to customize lines 40-50 to suit your own store. It’s pretty self explanatory smile You may have to edit a few lines if you get errors, as this was designed for my specific install. If you find this script useful, consider sharing something with the community, it’ll help everyone.

File Attachments
shoppingcom.php  (File Size: 3KB - Downloads: 2586)
 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

@turbo1 - You Rock and thanks again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blizzard182
Sr. Member
 
Avatar
Total Posts:  115
Joined:  2008-09-06
Argentina
 

At first. I didn’t know what they were for. Now, I must say a big THANK YOU.

 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

You’re very welcome. I urge others to contribute to the community if they’re able to do so. Community over profit. Call me a tree-huggin’ hippie LOL

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

@turbo1: does the following lines in your code work ok for you ?

$products->addAttributeToFilter('status'1);//enabled
        
$products->addAttributeToFilter('visibility'4);//catalog, search

Shouldn’t it be changed to

Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($products);

I suppose that these might return different product sets in multi-store setup if some products have visibility set to “Use Default Value” and some others have visibility set explicitly and not the same as default values.

You can check Mage_Catalog_Model_Product_Visibility->addVisibleInSiteFilterToCollection() and Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection->setVisibility() for details.

 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

@Michael
The code works for me, but you are welcome to change it smile I had it written so that things I mark out of stock/not visible won’t show up in my feed. Everyone is welcome to improve on it, of course !

 
Magento Community Magento Community
Magento Community
Magento Community
 
SKing
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2008-10-09
Kansas City, KS
 

Let me start by first, thank you for posting this script or scripts. I used the gbase and it all looks good. I just placed the shopping.com feed on and it came up with an error. Have you seen this?

Notice: Undefined index: product_type in /httpdocs/shoppingcom.php on line 58

All products are defined as simple products

Any help would be great…
Thanks again

 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

@Sking
Line 58 is this:  $product_data[’product_type’].=$category->getName().’, ‘;

I don’t know of anyone else who’s gotten an error on this line.  Do you have category names set up?

 
Magento Community Magento Community
Magento Community
Magento Community
 
alex.bsc
Guru
 
Total Posts:  340
Joined:  2008-06-06
 

hey turbo1, im getting the same error.. ive removed the product brand (manufacturer) as i dont use it, just like in the google base feed..

 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

@alex
Do you have categories set up under the “default” category?  Just trying to narrow down what could be giving you all this error. It doesn’t happen for me

 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

@Golddigger
I’m not a fan of Magento Connect. I’ll just leave it at that.  wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
John R
Sr. Member
 
Total Posts:  90
Joined:  2008-08-21
 

I am getting the same error:

NoticeUndefined indexproduct_type in /home/store/public_html/shoppingcom.php on line 58

SOLVED:

All you have to do is add:

$product_data['product_type''';

At line 57 right before the foreach[/b[ loop

- J

 
Magento Community Magento Community
Magento Community
Magento Community
 
nickwebdiverseon
Jr. Member
 
Total Posts:  1
Joined:  2008-09-30
 

Hi

I have upgraded my Magento sodtwar to 1.1.6 and this contribution no longer works .

here is what I get

Fatal error: Uncaught exception ‘Mage_Core_Model_Store_Exception’ in /home/baldysbl/public_html/magento/app/code/core/Mage/Core/Model/App.php:1131 Stack trace: #0 /home/baldysbl/public_html/magento/app/code/core/Mage/Core/Model/App.php(583): Mage_Core_Model_App->throwStoreException() #1 /home/baldysbl/public_html/magento/app/Mage.php(212): Mage_Core_Model_App->getStore(NULL) #2 /home/baldysbl/public_html/magento/app/Mage.php(217): Mage::getStoreConfig(’web/url/use_sto...’, NULL) #3 /home/baldysbl/public_html/magento/app/code/core/Mage/Core/Controller/Request/Http.php(118): Mage::getStoreConfigFlag(’web/url/use_sto...’) #4 /home/baldysbl/public_html/magento/app/code/core/Mage/Core/Model/App.php(263): Mage_Core_Controller_Request_Http->setPathInfo() #5 /home/baldysbl/public_html/magento/app/Mage.php(424): Mage_Core_Model_App->init(’default’, ‘store’, Array) #6 /home/baldysbl/public_html/magento/shoppingcom.php(8): Mage::app(’default’) #7 {main} thrown in /home/baldysbl/public_html/magento/app/code/core/Mage/Core/Model/App.php on line 1131

There is a problem with Mage::app(’default’) on line 8

Any Ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
turbo1
Sr. Member
 
Avatar
Total Posts:  296
Joined:  2008-08-19
Los Angeles, CA
 

Hey there,
If your store is not called “default”, it may have an issue.  I’m using 1.1.6 with no problem, so it might be related to your specific config. The script is looking for products that fall under “default”, you may have to change the script code to whatever name your products are under. I hope this helps (at least a little)!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrtech
Sr. Member
 
Total Posts:  87
Joined:  2008-06-30
 
turbo1 - 02 October 2008 09:26 AM

Hi everyone,
I hope you find this as useful as I do.  The attached file needs to go in the root of your Magento folder, and you need to have an “export” folder with 777 permissions. Feel free to edit the script/improve as necessary.

A few important notes:  test on a non-production server first!  Use at your own risk.  Script is provided as-is, but I will try to help if you have issues.

Feel free to customize lines 40-50 to suit your own store. It’s pretty self explanatory smile You may have to edit a few lines if you get errors, as this was designed for my specific install. If you find this script useful, consider sharing something with the community, it’ll help everyone.

hi

thank you very much for the code that you gave us for free
i am very new to php i am coming from the world of windows so i have a little question here
i am using tagging in the url in order to track in Google Analytics my conversion rate how can i add code to the feed that after the url it shuold add ?xxxx123

 
Magento Community Magento Community
Magento Community
Magento Community
 
John R
Sr. Member
 
Total Posts:  90
Joined:  2008-08-21
 

Simply change:

$product_data['link']=$product->getProductUrl();

to ..

$product_data['link']=$product->getProductUrl() . '?xxx123';

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 4