Jump to content

product combinations generator with unique reference


zeki893

Recommended Posts

Hi anybody know how to modify the combinations generator so that we can get unique reference codes? Currently it uses the same code for all new combinations. Would like to add the color and size attribute to it for example <reference>-<color>-<size>

Any help is appreciated  :)

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I developed a product builder what would do the Job. Please see attached Screen shot.

where can i find this? where does it generate a unique reference code?

Does anybody else run into this problem? I'm using the amazon module and updating reference code for every size and color combination is taking up a lot of time.

Link to comment
Share on other sites

  • 2 weeks later...

Hi zeki893,

You can tell exactly what you want to do and I will provide you this app as testversion for your use only. The requirements are Windows, .NET 4.0, MySQL installed. I would upload a zip in the cloud.

hm... i was looking for something in the back office. i guess i can try it out. i want to generate combinations with unique reference.

Edited by zeki893 (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Okay so I'm gonna try to figure this out myself.

 

I found in AdminAttributeGeneratorController.php is where I can modify the reference.

'reference' => pSQL($_POST['reference']),
 
So I got the product attribute id, but how can i convert from id to name from attribute_lang.id_attribute to attribute_lang.name
so i can add to the reference the color name?
Edited by zeki893 (see edit history)
Link to comment
Share on other sites

Actually hacked a way to get this working. 

So if anybody needs help with creating unique product reference IDs this will save you tons of time especially for posting combination products with 8 different colors.

Super useful for posting on Amazon using the Amazon module since amazon requires unique reference ID.

Screenshot-2015-03-01-17.47.41.png?resiz

http://itheadaches.com/prestashop-create-unique-reference-id-product-combinations-generator/

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Actually hacked a way to get this working. 

So if anybody needs help with creating unique product reference IDs this will save you tons of time especially for posting combination products with 8 different colors.

Super useful for posting on Amazon using the Amazon module since amazon requires unique reference ID.

Screenshot-2015-03-01-17.47.41.png?resiz

http://itheadaches.com/prestashop-create-unique-reference-id-product-combinations-generator/

 

 

I implemented this but still no reference is made when i update the combinations

Link to comment
Share on other sites

  • 2 months later...

After struggling with the problem, finally I found the error on zeki893's solution.

 

Apparently he didn't use the usual table prefix ps_ so just replacing:

$sqltest = 'SELECT * FROM `attribute_lang` WHERE `id_attribute` = '. $attribute .' LIMIT 0 , 1';

for:

$sqltest = 'SELECT * FROM `ps_attribute_lang` WHERE `id_attribute` = '. $attribute .' LIMIT 0 , 1';

worked for me

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...