Magento Forum

   
Export with Full Path for Image and Product
 
arthur_scholten
Jr. Member
 
Total Posts:  19
Joined:  2013-01-28
 

Hi,

I’m trying to create an export profile that will produce a CSV file for eg Google Merchant.
I aready have a script that will run the selected profile as a cron job.

The problem is that the Image path and product path are relative. A base dir needs to be added.
I looked at

/www/app/code/core/Mage/ImportExport/Model/Export/Entity/product.php line 631
And added:
if($attrCode==’url_path’){
$attrValue = str_replace(’’,’’,Mage::getBaseUrl()).$attrValue;

But that is not working.

How do I do this?

Thanx
Arthur

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbalca
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2013-02-04
 

Hi,

You can try this:

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).’catalog/product’.$item->getImage();

Cheers,
José

 
Magento Community Magento Community
Magento Community
Magento Community
 
arthur_scholten
Jr. Member
 
Total Posts:  19
Joined:  2013-01-28
 

Sorry it did not work. The stringrepace finds nothing to replace. because there is no index.php in the path of the product or the image URL.

I guess the magento way to do this is by creating a new adapter Long URL in

/www/app/code/core/Mage/Dataflow/Model/Convert/Adapter

This PHP file should contain a function like Long URL.

Public function ( Longurl)

if($attrCode==’url_path’){
$attrValue = Mage::getBaseUrl()).$attrValue;

if($attrCode==’url_field’){
$attrValue = Mage::getBaseUrl()).$attrValue;

But then something that works

In the advances dataflow profile you could add:

<action type="catalog/convert_parser_product???" method="Longurl">
<var name="url_field"><![CDATA[1]]></var>
<var name="url_path"><![CDATA[1]]></var>
</action>

But I don’t know how to do this. I’m not a developer.Can somewone create It. I think alot of people would be helped.

 
Magento Community Magento Community
Magento Community
Magento Community
 
SimonLindner
Member
 
Avatar
Total Posts:  31
Joined:  2011-09-08
Bremen
 

Hello,

one possibility is:

copy app/code/Mage/Dataflow/Convert/Mapper/Column.php to app/local/Mage/Dataflow/Convert/Mapper/Column.php.
Then scroll down to map()-function (line 140 in CE1.7) and change:

$newRow[$mapField] = isset($row[$field]) ? $row[$field] null;

to:

if($mapField == 'full_url_path'{
    $newRow[$mapField] 
= isset($row[$field]) ? Mage::getBaseUrl().$row[$field] null;
else {
    $newRow[$mapField] 
= isset($row[$field]) ? $row[$field] null;
}

Then configure your Dataflow-profile to use “full_url_path” as File-columnname for the Magento-field url_path.

 
Magento Community Magento Community
Magento Community
Magento Community
 
arthur_scholten
Jr. Member
 
Total Posts:  19
Joined:  2013-01-28
 

Hi,

I appreciate your help. Meanwhile I hired freelancer te fix it, He created a new addapter for me.

Thanx
Arthur

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vertius
Jr. Member
 
Total Posts:  2
Joined:  2013-11-16
 

Hi, could anybody help to:

Then configure your Dataflow-profile to use “full_url_path” as File-columnname for the Magento-field url_path.

Thank’s

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top