Remove Product Id Form Gtin In Datafeed

Hi,

I am getting errors with GTIN in Google Merchant. It sems that CS-Cart is adding the product ID to any black GTIN in the datafeeds, can this be stopped?

I am not using cs-carts google base feed I created my own.

Your question is not quite clear. Why you cannot remove corresponding field from the fields map?

I have created a datafeed on 2 sites with cs-cart 4.5.2.

Both datafeeds are created from scratch.

When I specify GTIN in the product not all have GTIN code in them so some are left blank. When the datafeed is uploaded cs-cart seems to add product code field data to the blank GTIN fields. This causes errors with Google Shopping as the product code are not invalid GTIN codes.

If you have a custom generated feed, why don't you just check if GTIN is same as product ID and if it is, set the field to an empty string?

The GTIN field is blank in the product - confirmed.

CS-cart is adding the product id to the GTIN field in the daatfeed upload.

The GTIN field is blank in the product - confirmed.

CS-cart is adding the product id to the GTIN field in the daatfeed upload.

Got that. My point was that if you're doing your own custom export as stated in OP, then why not just manage the field youself by comparing its value to the product_id and if they're the same replacing it with an empty string (if that's what you want).

I believe (but not certain) that you will have to identify those products to Big-G as custom products not having a verifiable GTIN (UPC).

im having the same issue. You can flag a product that has no GTIN or MPN as false. However cs cart sends the productcode we use internally as a GTIN so the product is flagged as not valid by Google.

Im not sure how to fix this in the feed. I would like to turn it off totally.

is that possible?

Yes, I found a solution to the problem - I uninstalled CS-Cart and rebuilt with it WooCommerce.

Yes, I found a solution to the problem - I uninstalled CS-Cart and rebuilt with it WooCommerce.

hahahaa

Honestly, I found getting things fixed in CS took to long as opposed to my the newer software where fixes are availble on averge in a matter of days. I hope you find a solution cos the only thing CS told was it was working as designed, very helpful.

Your question is not quite clear. Why you cannot remove corresponding field from the fields map?

You cannot remove the field product code from the field map. Even if you remove it, or send a blank variable it remains there.

In /app/addons/google_export/func.php, edit the db_field to what you want or comment it out.

        Array (
            'position' => 0,
            'export_field_name' => 'gtin',
            'field' => 'GTIN',
            'avail' => 'Y',
            'db_field' => 'product_code'
        ),

In /app/addons/google_export/func.php, edit the db_field to what you want or comment it out.

        Array (
            'position' => 0,
            'export_field_name' => 'gtin',
            'field' => 'GTIN',
            'avail' => 'Y',
            'db_field' => 'product_code'
        ),

Thanks, ill give that a try!

In /app/addons/google_export/func.php, edit the db_field to what you want or comment it out.

        Array (
            'position' => 0,
            'export_field_name' => 'gtin',
            'field' => 'GTIN',
            'avail' => 'Y',
            'db_field' => 'product_code'
        ),

Works! Thank you!

Note that there has been a hook requested to resolve this issue (http://forum.cs-cart.com/topic/40547-your-add-on-needs-a-new-hook-in-cs-cart-post-it-here/?view=findpost&p=298801) but no response from cs-cart.

It makes sense for making thing simple for many people, but it throws sand it the gears for others. It should be an option to pre-load GTIN from another field.

You cannot remove the field product code from the field map. Even if you remove it, or send a blank variable it remains there.

Commenting out the line should make the GTIN field empty by default on new Google data feeds.

In /app/addons/google_export/func.php, edit the db_field to what you want or comment it out.

        Array (
            'position' => 0,
            'export_field_name' => 'gtin',
            'field' => 'GTIN',
            'avail' => 'Y',
            'db_field' => 'product_code'
        ),

Works! Thank you!

I checked it again. But i was wrong. It still sends the productcode as GTIN if the GTIN field is left empty or flagged as false. I spotted this line:

   if (!empty($data_product['product_code'])) {
                            if (!empty($d_product[$lang_code]['GTIN'])) {
                                $combination['GTIN'] = $data_product['product_code'];
                        } elseif (!empty($feature_fields['GTIN']) && !empty($d_product[$lang_code][$feature_fields['GTIN']])) {
                            $combination[$feature_fields['GTIN']] = $data_product['product_code'];
                        }
                    }

Im removing this to see what happens.

Commenting out the line should make the GTIN field empty by default on new Google data feeds.

So i need to create a new feed for this to work? Im sorry, i have not tried that.

i think i found it: in app/addons/data_feeds/func.php. Edit out this line.

// if ($field == 'GTIN' && empty($variants)) {
            // $variants[] = db_get_field(
                // 'SELECT product_code FROM ?:products WHERE product_id = ?i',
                // $product_id
            // );
        // }

I did the above to data_feeds/func.php and it didn't seem to do anything, but then commented out the google export bit and think it's done it for me?

                        if (!empty($data_product['product_code'])) {
                            if (!empty($d_product[$lang_code]['GTIN'])) {
                                //$combination['GTIN'] = $data_product['product_code']; 
                        } elseif (!empty($feature_fields['GTIN']) && !empty($d_product[$lang_code][$feature_fields['GTIN']])) {
                            //$combination[$feature_fields['GTIN']] = $data_product['product_code'];
                        }
                    }