Results 1 to 4 of 4
  1. #1
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    How to create a custom SKU#
    I have working from the bullet proof datafeed thread and retooling and creating a new datafeed driven site. I have a merchant for which I'd like to create a custom SKU. I thought about using the feedID and product row number in the feed to create a SKU.

    Ex. FeedID = 4001 and product row in the feed = 467
    so the SKU would be 4001467

    I can see a potential problem though. If, more like when, the merchant adds or removes a product from the feed. That would result in a new SKU for all the products after the row where the change occured.

    I then thought about just using the feedID with a number and adding one to the number for each product that was added. But I can see the same type of think happening if the merchant adds or removes a product from the feed. IE all prodcts after the point of the change will have anew SKU.

    I am trying to keep a unique SKU for each product in the DB. Any ideas on a methood for creating a SKU which will not change when products are added or removed from the source datafeed?
    Thanks,
    Doug

  2. #2
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Hi Doug,

    You could take some part of the merchant's name or initials.

    For a site of mine, I found it helpful to have a field for the merchant's own sku, and then I have another that I do what I stated above.

    So, for example, if Haiko sold purple underwear here at ABestWeb, and the sku was 123456, I would probably have the unique sku of ABW123456. This way there's no concern for additional products or deletion of products.


    Is this what you're asking?


    Help this helps,
    bettylou

  3. #3
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Ok, I don't think I need to make a custom SKU. I found something in my code.

    Why does this work (single quotes)

    $query = "select * from $tablename Where Sku = '$productID'";

    while this gives me a column not found error (no single quotes)

    $query = "select * from $tablename Where Sku = $productID";

    Thanks
    Thanks,
    Doug

  4. #4
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Hi Doug,

    Single quotes work because you are querying to look for that value contained with the quotes.

    No quotes returns that error because you are querying where Sku is equal to a field in your database named $productID, which your database does not contain. That is why it is not found.

    Also, I just wanted to point out that queries are more efficient if you don't have
    SELECT *
    rather you should specifically ask for just the fields that you need, such as
    SELECT prod_id, prod_name

    I am guilty of throwing in an asterisk every now and then myself however. But I try to avoid it when it may affect visitors to my site.


    Have a great day,
    bettylou

  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Problem with 'Create a Custom Link to a page'
    By AnonD in forum ShareASale - SAS
    Replies: 7
    Last Post: October 27th, 2010, 05:06 PM
  2. Create Custom Link Result is 404
    By John Powell in forum ShareASale - SAS
    Replies: 2
    Last Post: May 1st, 2008, 10:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •