Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Join Date
    Mar 2016
    Location
    Scotland
    Posts
    44
    Plugin Contributions
    0

    help question generate product model, is it possible

    I have found a way to generate and assign product IDs (model numbers) within excel when an option is chosen from the dependent menus I have, so I assume if it can be done in excel it should be easier in a database such as sql but I know nothing of sql.

    So if I can find a way to get this done in sql, how would I get it to add the unique product Ids into zencart.

    any ideas ??
    Last edited by DrByte; 25 Apr 2016 at 03:19 AM. Reason: edited as requested

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: generate product id, is it possible

    You might be better off using this plugin
    https://www.zen-cart.com/downloads.php?do=file&id=2069

  3. #3
    Join Date
    Mar 2016
    Location
    Scotland
    Posts
    44
    Plugin Contributions
    0

    Default Re: generate product id, is it possible

    Not sure how that would work for this Kobra, if sql is already generating the IDs on an individual basis as a selection is made, does that mean I'd need to find another kind of script to generate the list within sql, then export it to a csv file then import it with easypopulate

    but as usual I'm probably missing something

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: generate product id, is it possible

    If you already have a method to do this in excel then getting into the database using ep4 should be easy

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: generate product id, is it possible

    If I may try to explain a little somethings as this looks confusing...

    When a new row of data is added to the products table (one of many tables that define the detail of a product and what to show on ZC), if that row does not include a products_id or depending on the mysql server if that value is zero (0) or null, then mysql assigns the next value for that products_id as tracked by the autonumber record for products_id. If the row has an assigned products_id then the mysql server will try to perform the requested operation (insert, update, delete, etc) based on that products_id.

    EP4 (EasyPopulate V4) as recommended by kobra, as well as many other versions of EasyPopulate, was written to use a primary key (similar to a unique products_id) that was independent of the ZC primary key because outside vendors do not supply a products_id that is the same for everyone. At the time of writing, the products_model was chosen as this primary key. Yes, there are some issues with using a vendor's model# only so guidance was provided to make this model# a unique number/letter combination in comparison to all such product (add perhaps a vendor identifier, or some other related information that would make the referenced product unique).

    So with such a unique model#, EP4 could take new data from a csv file and populate ZC. This population would generate a new products_id for a model# not in the database, or update the information for a product that had the same model#. (Further why the unique value is/was important.)

    In the last year or so, a modification was made to the code to allow population/modification by use of the products_id. Now it is possible through changing a setting in the configuration options to directly access product by their products_id, which includes generating a new one if the import file leaves the products_id as blank.

    So, depending on your overall need and planned usage, you could populate ZC with new product by use of the new products_id control method (there are two options, only populate/update product that have an assigned products_id, or populate/update product that have an assigned id (creating the new product in the database if the id is not present and updating product that have a matching id) and also to auto-assign the next products_id for a product that doesn't have a products_id in the file.

    So the other "thought" about how EP4 works is that it offers a two way street. Can upload product/info, but can also export that product/info which appears to be where the hangup is/was. In other words, it can be used to push new/updated data, and pull existing data. After the pull, changes can be made and then pushed again or, if the source of the change(s) is external, then the data can be always pushed and as long as the data "key" matches with the appropriate existing record, that record (as well as any that have the matching key) is updated. If the key being pushed is unique and not present in the database then a new product is created.

    Does this clarify the situation and operation a little?

    What is it that this other "software" is expected to do?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Mar 2016
    Location
    Scotland
    Posts
    44
    Plugin Contributions
    0

    Default Re: generate product id, is it possible

    Quote Originally Posted by mc12345678 View Post
    If I may try to explain a little somethings as this looks confusing...

    When a new row of data is added to the products table (one of many tables that define the detail of a product and what to show on ZC), if that row does not include a products_id or depending on the mysql server if that value is zero (0) or null, then mysql assigns the next value for that products_id as tracked by the autonumber record for products_id. If the row has an assigned products_id then the mysql server will try to perform the requested operation (insert, update, delete, etc) based on that products_id.
    Are we talking about the same product id ??

    I'm referring to a product id//model number, like a catalogue number, eg my product id would be formatted like this, 3AqCa0125, unrelated to any product id that is created when adding an item to the database eg pID=241

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,545
    Plugin Contributions
    127

    Default Re: generate product id, is it possible

    This is called the model number in Zen Cart. People will get confused if you call it the product ID, since there's a separate field with that name.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Mar 2016
    Location
    Scotland
    Posts
    44
    Plugin Contributions
    0

    Default Re: generate product id, is it possible

    Thread title has been changed.
    Last edited by DrByte; 26 Apr 2016 at 04:40 AM. Reason: edited as requested

  9. #9
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: generate product model, is it possible

    So the above answer about using EP4 still applies even though still talking about model # only... that is why such depth was provided in the statement as there was a mix of content/discussion originally. In principle still talking about "generating" the model # in a spreadsheet and then uploading it. If wanting to do this via mysql, well, need to know what the "formula" is to get the model# and then a suggestion of the sql query to modify the model# to match can be provided.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Mar 2016
    Location
    Scotland
    Posts
    44
    Plugin Contributions
    0

    Default Re: generate product model, is it possible

    Currently the spreadsheet reacts to what options are chosen on a dynamic basis, they are specific to the option chosen, it's not a list that is generated. There are over 18500 product options within this one main category, sad fact is I actually know every product number of every stock item off by heart but getting software to come up with the matching results has been a pain.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v150 Renamind the model number field possible ?
    By ocmusic in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 3 Jun 2013, 06:27 AM
  2. v138a Generate a list with id, model and product links
    By icecold in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Nov 2012, 12:59 AM
  3. Product Info page: can I move model value under 'model' title?
    By scott_ease in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Aug 2012, 04:24 PM
  4. v139h How to auto generate just product keywords from product page?
    By Feznizzle in forum General Questions
    Replies: 21
    Last Post: 2 Mar 2012, 06:30 AM
  5. Replies: 1
    Last Post: 24 Jan 2012, 09:10 AM

Posting Permissions

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