Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Justin Sainton

    (@justinsainton)

    Hi Francesco,

    Indeed, we do make the assumption that SKUs would be unique…as they should be.

    In your case, we do have a filter:

    $g_id = apply_filters( 'wpsc_google_product_feed_product_id', $g_id, $post );

    So you could add the following code to use the guid of the product instead of the SKU:

    add_filter( 'wpsc_google_product_feed_product_id', function( $sku, $post ){
         return preg_replace( '/[^a-zA-Z0-9]/', '', $post->guid ) ;
    }, 10, 2 );

    Add that code to your functions.php file or a custom functionality plugin and you should be fine.

    Thread Starter Francesco

    (@nym77)

    thx for the quick feedback!

    I will give it a try!
    btw, if the SKU should be unique it should also be automatically controlled if a user is inserting 2 times the same value.

    I mean… you want to prevent to have 2 products with the same SKU.

    Plugin Author Justin Sainton

    (@justinsainton)

    Hi Francesco,

    Thanks for that feedback! We’ll definitely consider that – but for now, we’ve elected to put that burden on the store owner. I could imagine a user experience where, upon entering a SKU, and dynamic call could be made and simply alert the user that a product is already using that SKU, but it’s nothing I imagine we’d enforce at a DB schema level.

    Thanks again!

    Thread Starter Francesco

    (@nym77)

    Thx Justing
    for the hard work that you are putting in. I am just happy to contribute how I can.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Duplicate ID in google merchant. Bug’ is closed to new replies.