WARNING: This is my first patch.

Anyways, I used the form updating module to update the product.module for the 4.7 api. No error messages come up from http://drupalsite/node/x/product, but no content comes up either. Hopefully this can at least be a start for a competent coder!

CommentFileSizeAuthor
#8 node-add-product.png1.62 KBnedjo
product.module.patch11.85 KBflufftronix

Comments

gordon’s picture

Status: Needs work » Fixed

I have commited this, if there are any problems they will be fixed during the formapi updates

Thanks.

flufftronix’s picture

Status: Fixed » Active

K. Do you happen to know of a vague timeline in which the form API updates will be happening? I have a site I'd like to launch in early February which includes e-commerce module components, and can perhaps enlist extra help to get this done faster if it seems like you all won't have an update by then.

I can also continue running modules through the form updater and submitting patches if this helps, but I'd imagine the rest of them will be like this last one; perhaps better code-wise but still nonfunctional.

mfb’s picture

ah, looks like this patch was reversed..
well, it seems like any and all help is needed. I'm guessing we'd want people to take responsibility for a module and see it all the way through..

gordon’s picture

Yes after looking at it further, I found that too much as wrong with it and reversed it.

mfb’s picture

Assigned: Unassigned » mfb

with some sponsorship by goodstorm.com, I'm willing to take this on. Nedjo has offered to help out too. It will be a collaborative effort.

Once product.module is ported we can finally merge in new features like subproducts.

Unfortunately I can't get started until jan. 18th. but i'm going to print out some API docs and code and look at it while on vacation

If anyone else wants to help let me know, I dont want to slow anyone down ;)

flufftronix’s picture

That's great; as you can see I don't really know what I'm doing but the project I'm working on could really use an updated e-commerce suite.

nedjo’s picture

I've committed an initial upgrade. This is a significant simplification of the module, made possible in large part by forms api. The major change: there is no longer a two-stage process for product forms. Rather, on node/add/product, a list of available product types is given. This is designed to be consistent with the listing of available content types as given at node/add. Selecting one takes you directly to that product's form. (This list is also given in two other places: under 'product' in node/add and as the initial content of the 'product' tab on a non-product page, used for selecting which type of product to make a node into.)

This solution has the advantages of simplifying product creation. But, of course, this is only one of a number of possible approaches. Please comment on whether you think it's an improvement, or if you have other suggestions :)

To get product type modules to display descriptions help text on their type, module authors should add a case option to their hook_help() functions. I've committed a sample upgrade to tangible.module. Here are the changes:

   switch ($section) {
     case 'admin/modules#description':
       return t('Creates a tangible product. Dependency: product.module');
+    case 'node/add/product#tangible':
+      return t('A shippable product is a tangible, physical item.');
   }

This upgrade is not fully functional yet as product.module depends on price module, which isn't yet updated. I've only done minimal testing as yet so I'm sure we'll need to do more tweaking. But meanwhile the module seems to be basically usable and you should be able to use it for testing purposes while updating product type modules.

Please report remaining issues here as they come up.

nedjo’s picture

StatusFileSize
new1.62 KB

Screen shot of the node/add/product page.

gordon’s picture

This looks great, and the fact that we can simplify this process is great as well.

You may want to also add the product types to the submenu so that if they click on product they will get the list and then they can select the prodict type from the menu.

buendia’s picture

In products list view or products detail there is no input textbox for entering quantities. Am i missing something or the input fields are not implemented yet?

buendia’s picture

Is the function product_link going to be ported to forms api? If not, how is it possible to change 'add to cart' to something arbitrary? If I simply repeat this function in my module to change it to, say, 'add to my cart' the result would be something like:

add to my cart | add to cart

How is it possible to replace instead of extending the bread crumb?

gordon’s picture

If you want to change the wording use the locale to change the working. If you want to add a custom button then you can turn off the link in the node footer.

gordon’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)