It would be great to have an option to automatically BULK generate Alternate SKU adjustments based on a configurable per option prefix or suffix.

patch #18 here http://drupal.org/node/298395 creates a bulk feature to modify all options of current products nodes based on the settings of the classes. It would be great to have this functionality also for SKU adjustments and possibly merge that uc_attribute patch functionality into this power tools module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hedac’s picture

Title: automatic Alternate SKU adjustemets » automatic Alternate SKU adjustments

would be too much also to ask for automatic file downloads based on token or replacement patterns? :)

willvincent’s picture

Status: Active » Postponed
melwyn.s’s picture

I would also like to know how to automatically BULK generate Alternate SKU as well . I am new to Ubercart and trying to create my first e-commerce retail store.

If ...I have many products in my store with diffirent attributes and i would like to have diffirent Alternate SKU in adjustments.. How can i have the Alternate SKU gernerated automatically ...Rather than typing it for every product.... probably if possible have the SKU filled automatically as well .

It would nice if it could be done via Token patterns ... Is it possiblE?

willvincent’s picture

Re: is it possible?

Not yet. Hopefully in the next release of the power tools module I will be able to provide this feature.

I've been swamped with other work for the past several months and haven't had time to work on adding a lot of the planned features to this module. I will be returning to its development soon.

melwyn.s’s picture

thanks tcindie ...

I will keep a tab on this ..It will be an excellent tool if that feature is implemented :)

dawick’s picture

I think this could be done with the node import module.

sgriffin’s picture

You could always use views bulk operations to perform a bit of php on each node to set its sku correctly for each adjustment.

patchak’s picture

sgriffin : could you post a bit of detail about the code you would use to do this? We need some similar feature where SKU's need to be managed automatically for produts with lots of options!

Or maybe this feature now has been added to this module?
Thanks,
Patchak

sgriffin’s picture

The main node has a model field and each adjustment as well for its own sku
You can use drupal_execute for the uc_product_adjustments_form.

jerry’s picture

Subscribing.

brisath’s picture

Subscribing

rumble’s picture

FileSize
13.11 KB

I created this patch that appends the previously auto generated sku with the names of the option combinations that a product class has during node creation. It also alters the node creation/edit form of any product class content type so that you can remove options from the class if a product does not have that option. For example a t-shirt shop, each shirt has colour and sizes. So during the creation of a new shirt, this patch will create all available combinations of colour and size so that each option has a unique sku. You must still specify what the prefix will be in the power tools settings.
tshirt1 large red
tshirt1 medium red
.
.
.
etc.
As of its current state this patch is always on once it is installed but is easily modified so that it may be set as a optional function later.
If people are interested I can continue to make it more robust, this is just what I have now which is working.

jerry’s picture

I've given this a try and it looks promising. I'd love to see you polish it up for release.

Breen’s picture

@ rumble

I think this patch sounds really interesting. I applied it with cygwin and it appeared to go ok and my test site is running it now. When creating a new item I get the alternative sku numbers as planned! This should solve my stock problem. One major issue though is when I click on the actual stock tab I get some variation of "Fatal error: Allowed memory size of xxx" on form.inc. I have tried this with various memory sizes including 256MB so it should work???

TR’s picture

Status: Postponed » Needs work

The patch isn't ready to be put in. It is in the wrong format, introduces a lot of coding standards problems, and comments out some lines instead of deleting them. See http://drupal.org/patch and http://drupal.org/coding-standards for more info.

Breen’s picture

Thanks TR. I ended up backing out and going in a different and I think better direction to do what I wanted.

intrex9’s picture

rumble: thanks for the patch, you make my day! :)

heyyo’s picture

Any updated patch for the last dev ?

remkovdz’s picture

+1 for D7.

nyleve101’s picture

+1 for D7.

jerry’s picture

Status: Needs work » Needs review
FileSize
13.71 KB

I've re-rolled the patch against the current 6.x-1.x-dev version, and hopefully addressed some of TR's concerns about coding standards. I've also completed the work on making this option selectable per class, and changed the SKU formatting separator to '-' from ' '. What I haven't done is tested it extensively yet, so take appropriate precautions before using it. Seems to work OK here so far; posting for feedback from other testers.

halloffame’s picture

Applied the patch and enabled the option but nothing seems to happen. There is no sku auto generated for each option of the product.

jerry’s picture

It's been some months since I looked at this, but my recollection is that it worked only at product creation time and with product classes to which default attributes and options had been attached, not with the default "Product" type. I have one client who uses this routinely, and it's working OK there.

docans’s picture

Any progress on this

I need to automatically generate Alternate SKU, with the ability to accept token from already exiting fields

In my store of 200 products, each product has 2 different part number types. a part number for 240 volts and another for 120 volts. The part numbers for the 240 and 120 volts are in custom text fields.

I will like to dynamically create attributes using the data in the two text fields for all the 200 products. And have the attribute display on the add to cart form

so i will like my user to select either of them before adding it to the cart and have the select they chose( the attribute they chose) appear on the checkout as well as get emailed out.

Any help

Thanks

kopeboy’s picture

Version: 6.x-1.10 » 7.x-1.x-dev
Priority: Normal » Major
Issue summary: View changes

Guys, this is strongly needed, can we make it work with already created products of no class (normal general "Product")??

chilligroup’s picture

any update on this?

mr_byte’s picture

I've applied the patch to the 7x version of the module, and it mostly applies. I can't test it fully because the database methods are D6, and I don't know how to convert all of them to D7 styles.

Any help would be appreciated.

mr_byte’s picture

In working on this, I've trashed the D6 db methods, and have managed to add auto alternate skus in product_adjustments and uc_stock. However, I can't figure out how to build the combination field in uc_product_adjustments. The info says it's a serialized array with attribute id's as a key and option id's as values.

I need an example, in plain english, of what goes into it, for instance (attribute id + attribute id + option id), (aid,aid,oid) etc.